program easy;

{$APPTYPE CONSOLE}

var
 i,j,n,m,k:integer;
 r:array[1..10000] of real;
 c:boolean;

Function Pm(i:integer):extended;
var
 t:extended;
 j:integer;
Begin
 t:=0;
 for j:=i-m+1 to i do
  t:=t+r[j];
 pm:=t / m;
End;

Function Pn(i:integer):extended;
var
 t:extended;
 j:integer;
Begin
 t:=0;
 for j:=i-n+1 to i do
  t:=t+r[j];
 pn:= t / n;
End;

begin
 assign(input,'easy.in');reset(input);
 assign(output,'easy.out');rewrite(output);
 readln(m,n,k);
 for i:=1 to k do
  read(r[i]);

 c:=false;
 if Pm(n)>Pn(n) then Begin writeln('BUY ON DAY ',n); c:=true; End else writeln('SELL ON DAY ',n);

 for i:=n+1 to k do
 Begin
  if (Pm(i)>Pn(i))and(not c) then begin writeln('BUY ON DAY ',i); c:=true; end
 else
 if (Pm(i)<Pn(i))and(c) then
  Begin writeln('SELL ON DAY ',i);c:=false;End;
 End;
 close(input);
 close(output);
end.

