{$APPTYPE CONSOLE}
Const
     Filein='easy.in';
     Fileout='easy.out';
     MaxN=10000;
Var
     p                  :array [1..MaxN] of real;
     i,j,n,m,k,l        :integer;
     pm,pn              :real;
Procedure Load;
Begin
    Assign(input,filein);
    Reset(input);
    Read(m,n,k);
    For i:=1 to k do begin
        Read(p[i]);
    end;
End;

Procedure WriteFile;
Begin
     Assign(output,Fileout);
     Rewrite(output);
End;

Procedure work;
Begin

     For i:=n-m+1 to n do begin
         pm:=pm+p[i];
     end;

     For i:=1 to n do begin
         pn:=pn+p[i];
     end;
     if (pm/m)>(pn/n) then begin
                           Writeln('BUY ON DAY ',n);
                           l:=1;
                      end
                      else begin
                           Writeln('SELL ON DAY ',n);
                           l:=-1;
                      end;

     For i:=n+1 to k do begin
         pn:=pn-p[i-n]+p[i];
         pm:=pm-p[i-m]+p[i];
         if ((pm/m)>(pn/n)) and (l<0)
            then begin
                 Writeln('BUY ON DAY ',i);
                 l:=1;
            end;
         if ((pm/m)<(pn/n)) and (l>0)
            then begin
                 Writeln('SELL ON DAY ',i);
                 l:=-1;
            end;
     end;

End;


Begin
    Load;
    WriteFile;
    Work;
End.







