program Project1;

{$APPTYPE CONSOLE}

Uses
  SysUtils;

Const
  cIN  = 'easy';
  cOUT = 'easy';
var
  K,n,m,i,j: integer;

  PN, PM: real;

  Fb: boolean = false;
  Fs: boolean = false;

  Mas: array[1.. 10000] of real;

begin
  AssignFile(Input, cIN + '.in');
  Reset(Input);
  AssignFile(Output, cOUT + '.out');
  Rewrite(Output);

  Pn := 0;
  Pm := 0;

  Read(M, N, K);
  For i := 1 to k do
   read(mas[i]);

  For i := 1 to k do
   If (i >= n) and  (i >= m) then
   begin
     For j := i - n + 1 to i do
       Pn := Pn + Mas[j];
     For j := i - m + 1 to i do
       Pm := Pm + Mas[j];

     Pn := Pn/n;
     Pm := Pm/m;

     if (not fB) and (Pn < Pm) then
     begin
       Writeln('BUY ON DAY ' + inttostr(i));
       fB := True;
       fS := False;
     end;

     if (not fS) and (Pn > Pm) then
     begin
       Writeln('SELL ON DAY ' + inttostr(i));
       fB := False;
       fS := True;
     end;

     Pn := 0;
     Pm := 0;
   end;
  
  CloseFile(Input);
  CloseFile(Output);  
end.
