{$APPTYPE CONSOLE}

uses SysUtils;

var M,N,K:integer;
    A:array[1..10000+239] of extended;
    aM,aN:array[1..10000+239] of extended;
    aU:array[1..10000+239] of boolean;
    sum:extended;
    i:integer;

begin
 reset(input,'easy.in');
 rewrite(output,'easy.out');

 read(M,N,K);

 for i:=1 to K do
  read(A[i]);

 sum:=0;
 for i:=1 to m do
  sum:=sum+A[i];
 aM[m]:=sum;
 for i:=m+1 to K do
  aM[i]:=aM[i-1]-A[i-m]+A[i];

 sum:=0;
 for i:=1 to n do
  sum:=sum+A[i];
 aN[n]:=sum;
 for i:=n+1 to K do
  aN[i]:=aN[i-1]-A[i-n]+A[i];

 if aM[n] * n > aN[n] * m then begin writeln('BUY ON DAY ',n); aU[n]:=true; end
                          else begin writeln('SELL ON DAY ',n); aU[n]:=false; end;
 for i:=n+1 to k do
  begin
   aU[i]:=aM[i] * n > aN[i] * m;
   if aU[i]<>aU[i-1] then
    if aU[i] then writeln('BUY ON DAY ',i)
             else writeln('SELL ON DAY ',i);
  end; 

end.
