program easy;
{$APPTYPE CONSOLE}
var
  f1,f2:text;
  p,pm,pn:array[1..10000] of double;
  cnt,i,j,n,m,k:integer;
  sum:double;
begin
  //input
  Assign(f1,'easy.in');
  Reset(f1);
  Readln(f1,m,n,k);
  For i:=1 to k do
    Readln(f1,p[i]);
  Close(f1);
  //solve & output;
  For i:=n to k do
  begin
    sum:=0;
    cnt:=0;
    For j:=i-m+1 to i do
    begin
      sum:=sum+p[j];
      inc(cnt);
    end;
    pm[i]:=sum/cnt;

    sum:=0;
    cnt:=0;
    For j:=i-n+1 to i do
    begin
      sum:=sum+p[j];
      inc(cnt);
    end;
    pn[i]:=sum/cnt;
  end;
  Assign(f2,'easy.out');
  Rewrite(f2);
  If (pm[n]>pn[n]) then writeln(f2,'BUY ON DAY ',n)
  else writeln(f2,'SELL ON DAY ',n);
  For i:=n+1 to k do
  begin
    If ((pm[i]>pn[i])and(pm[i-1]<pn[i-1])) then
      writeln(f2,'BUY ON DAY ',i);
    If ((pm[i]<pn[i])and(pm[i-1]>pn[i-1])) then
      writeln(f2,'SELL ON DAY ',i);
  end;
  Close(f2);
end.
