program Project2;

{$APPTYPE CONSOLE}
var M,N,K:integer;
    p_m,p_n,pp:array[1..10000] of double;
    i,j:integer;
    sum1,sum2:double;
    b1,b2:boolean;
    
begin
   assign(input,'easy.in');
   reset(input);
   assign(output,'easy.out');
   rewrite(output);

   read(M,N,K);

   for i:=1 to K do read(pp[i]);

   i:=1;
   sum1:=0;
   sum2:=0;
   while i<=K do begin
      sum1:=sum1+pp[i];
      sum2:=sum2+pp[i];
      if i>=M then begin
         p_m[i]:=sum1/M;
         sum1:=sum1-pp[i-M+1];
      end;

      if i>=N then begin
         p_n[i]:=sum2/N;
         sum2:=sum2-pp[i-N+1];
      end;

      inc(i);
   end;

   b1:=false;
   b2:=false;
   for i:=N to K do begin
      if (p_m[i]>p_n[i])and((i=N)or b2) then begin
         writeln('BUY ON DAY ',i);
         b1:=true;
         b2:=false;
         continue;
      end;
      if (p_m[i]<p_n[i])and((i=N)or b1) then begin
         writeln('SELL ON DAY ',i);
         b2:=true;
         b1:=false;
         continue;
      end;

   end;
end.

{
3 5 17
8.45
9.10
9.40
10.15
10.40
11.08
11.52
12.12
12.51
12.15
11.90
11.25
11.73
10.77
10.80
10.01
9.14

}