var a:array[-200..10000] of int64;
    tt:double;
    pn,pm:int64;
    nm:boolean;
    m,n,k,i:integer;

procedure sign(i:integer; b:boolean);
begin
 if not b then writeln('BUY ON DAY ',i) else writeln('SELL ON DAY ',i);
end;

begin
 assign(input,'easy.in'); reset(input);
 assign(output,'easy.out'); rewrite(output);
 read(m,n,k);
 pn:=0; pm:=0;
 for i:=1 to k do begin
  read(tt);
  a[i]:=round(tt*100);
 end;
 for i:=1 to k do begin
  pn:=pn-a[i-n]+a[i];
  pm:=pm-a[i-m]+a[i];
  if i=n then begin
   if pn*m<pm*n then nm:=false else nm:=true;
   sign(i,nm);
  end;
  if i>n then begin
   if (pn*m<pm*n)and nm then begin nm:=false; sign(i,nm) end else
   if (pn*m>pm*n)and (not nm) then begin nm:=true; sign(i,nm) end;
  end;
 end;
 close(output);
 close(input);
end.