program ze;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
   m,n,i,k,j,c:integer;
   pm,pn:real;
   a:array[1..10000] of real;
   bear:boolean;
begin
  assign(input,'easy.in');
  reset(input);
  bear:=true;
  readln(m,n,k);
  assign(output,'easy.out');
  rewrite(output);
  for i:= 1 to k do
    readln(a[i]);
  for i:= n to k do begin
    c:=0; pm:=0;
    if (i-m+1)>1 then
      for j:=i-m+1 to i do begin
        pm:=pm+a[j];
        inc(c);
      end
    else begin
      for j:= 1 to i do pm:=pm+a[j];
      c:=i;
    end;
    pm:=pm/c;
    c:=0; pn:=0;
    if (i-n+1)>1 then
      for j:=i-n+1 to i do begin
        pn:=pn+a[j];
        inc(c);
      end
    else begin
      for j:= 1 to i do pn:=pn+a[j];
      c:=i;
    end;
    pn:=pn/c;
    if (pn<pm) and ((bear and (i>1)) or (i=n))  then writeln('BUY ON DAY ',i);
    if (pm<pn) and (((not bear) and (i>1)) or (i=n))  then writeln('SELL ON DAY ',i);
    if pm>pn then bear:=false else bear:=true;
  end;
end.
