program easy;

{$APPTYPE CONSOLE}

uses
  SysUtils;


var
 i,j,n,m,k:integer;
 fin,fout:textfile;
 price:array[1..10000] of real;
 am,an:double;
 pr:byte;


begin
 assignfile(fin,'easy.in');
 assignfile(fout,'easy.out');
 reset(FIN);
 REWRITE(FOUT);
 read(fin,m,n,k);
 for i:=1 to k do
 begin
  read(fin,price[i]);
//  writeln(fout,v[i].w,' ',v[i].h);
 end;
 pr:=0;an:=0;am:=0;

 for i:=1 to n do
 begin
  an:=an+price[i];
  if i>(n-m) then am:=am+price[i];
 end;
 if (an/n)>(am/m) then
 begin
  writeln(fout,'SELL ON DAY ',n);
  pr:=1;
 end
 else
 begin
  writeln(fout,'BUY ON DAY ',n);
  pr:=2;
 end;

 for i:=n+1 to k do
 begin
  an:=an-price[i-n]+price[i];
  am:=am-price[i-m]+price[i];
 if ((an/n)<(am/m)) and (pr=1) then
 begin
  writeln(fout,'BUY ON DAY ',i);
  pr:=2;
 end;
 if ((an/n)>(am/m)) and (pr=2) then
 begin
  writeln(fout,'SELL ON DAY ',i);
  pr:=1;
 end;
 end;
 closefile(fin);
 closefile(fout);

  { TODO -oUser -cConsole Main : Insert code here }
end.
