{$APPTYPE CONSOLE}
const maxk=10000;
type realnum=extended;
var m,n,k:longint;
    p:array[1..maxk] of longint;
    lastsell,lastbuy:boolean;

procedure readdata;
var a:realnum;
    i:longint;
begin
 read(m,n,k);
 for i:=1 to k do
 begin
  read(a);
  p[i]:=round(a*100);
 end;
end;

procedure solve;
var i,sn,sm:longint;
begin
 sn:=0;
 for i:=1 to n do
 sn:=sn+p[i];
 sm:=0;
 for i:=n-m+1 to n do
 sm:=sm+p[i];
 lastsell:=false;
 lastbuy:=false;
 for i:=n to k do
 begin
  if (sm*n>sn*m) and ((i=n) or lastsell) then
   begin
    lastsell:=false;
    lastbuy:=true;
    writeln('BUY ON DAY ',i)
   end
  else if (sm*n<sn*m) and ((i=n) or lastbuy) then
   begin
    lastsell:=true;
    lastbuy:=false;
    writeln('SELL ON DAY ',i)
   end;
  if i<k then
   begin
    sn:=sn+p[i+1]-p[i+1-n];
    sm:=sm+p[i+1]-p[i+1-m];
   end; 
 end;
end;

procedure outdata;
begin
end;

begin
 assign(input,'easy.in');
 reset(input);
 assign(output,'easy.out');
 rewrite(output);
 readdata;
 solve;
 outdata;
 close(output);
end.

