const
      inp='easy.in';
      outt='easy.out';
var
    a,b:Array[1..10000] of real;
    n,m,k:longint;


procedure readdata;
 var
      i:longint;

begin
   assign(input,inp);
    reset(input);
     readln(m,n,k);readln(a[1]);
     for i:=2 to k do
      begin
       readln(a[i]);
       b[i]:=a[i];
       a[i]:=a[i]+a[i-1];
      end;
   close(input);
end;

procedure solve;
 var
      i:longint;
      pm,pn:real;

begin
 for i:=n to k do
  begin
   pm:=(a[i]-a[i-m]);
   pn:=(a[i]-a[i-n])/n;
   pm:=pm/m;
   if pm>pn then
    begin
     pm:=(a[i-1]-a[i-1-m])/m;
     pn:=(a[i-1]-a[i-1-n])/n;
     if i=n then writeln('BUY ON DAY ',I)
            else if pm<pn then writeln('BUY ON DAY ',I);
    end else
             if pm<pn then
              begin
               pm:=(a[i-1]-a[i-1-m])/m;
               pn:=(a[i-1]-a[i-1-n])/n;
               if i=n then writeln('SELL ON DAY ',i)
                      else if pm>pn then writeln('SELL ON DAY ',i)

              end;
  end;
end;

procedure writedata;

begin
  assigN(output,outt);
   rewrite(output);
end;

begin
  readdata;
  writedata;
   solve;
  close(output);
end.
