program taske;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
 i,n,m,k:integer;
 A,P:array[0..10000] of real;
 DaY:ARRAY[ 0..10000] of integer;
 pn,pm:real;
begin
assign(input,'easy.in');reset(input);
assign(output,'easy.out');rewrite(output);
readln(m,n,k);
P[0]:=0;Day[0]:=-1;
for i:=1 to K do
 begin
   readln(A[i]);
   P[i]:=P[i-1]+A[i];
 end;
for i:=n to k do
 begin
   pn:=(P[i]-P[i-n])/n;
   pm:=(P[i]-P[i-m])/m;
   if (pm>pn) then
    begin
     Day[i]:=1;
     if (i=n) or (Day[i-1]=2) then writeln('BUY ON DAY ',i);
    end;
   if (pm<pn) then
    begin
     Day[i]:=2;
     if (i=n) or (Day[i-1]=1) then writeln('SELL ON DAY ',i);
    end;
 end;
close(output);
close(input);
end.
 