program easy;

{$APPTYPE CONSOLE}

uses
  SysUtils;

label
  pls;
var
  fin,fout:text;
  i,k,n,m,g,j,buyday,sellday:integer;
  s,pn,pm,razn:array [1..10000] of real;
  sd:boolean;
  begin
  { TODO -oUser -cConsole Main : Insert code here }
  assign(fin,'easy.in');
  assign(fout,'easy.out');
  reset(fin);
  rewrite(fout);
  readln(fin,m,n,k);

  for i:=1 to k do
    readln(fin,s[i]);
  g:=n;
  for i:=g to k do
     begin
     pm[i]:=0;
     pn[i]:=0;
     for j:=i-m+1 to i do
       pm[i]:=pm[i]+s[j];
     for j:=i-n+1 to i do
       pn[i]:=pn[i]+s[j];
     pm[i]:=pm[i]/m;
     pn[i]:=pn[i]/n;
     razn[i]:=pm[i]-pn[i];
  end;

  if razn[g]>0 then sd:=false
                     else sd:=true;

  if (not sd) then begin
                 write(fout,'BUY ON DAY ');
                 writeln(fout,g);
                 end else begin
                          write(fout,'SELL ON DAY ');
                          writeln(fout,g);
                          end;
  for i:=g+1 to k do
    if razn[i]*razn[i-1]<0 then begin
                                sd:=not sd;
                                if (not sd) then begin
                                               write(fout,'BUY ON DAY ');
                                               writeln(fout,i);
                                               end else begin
                                                        write(fout,'SELL ON DAY ');
                                                        writeln(fout,i);
                                                        end;
                                 end;


  close(fin);
  close(fout);
end.
