program zhenya;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
 Filec='easy';
 Filei=Filec+'.in';
 Fileo=Filec+'.out';

var
  m,n,k,i,j: integer;
  price: array[1..20000] of real;
  new_trend, old_trend: integer;
  summa_m, summa_n: real;
  day: integer;

begin
 Assign(input,Filei); Reset(input);
 Assign(output,Fileo);Rewrite(output);

 readln(m, n, k);

 for i := 1 to k do readln(price[i]);

 summa_m := 0; summa_n := 0;
 for i := n-m+1 to n do summa_m := summa_m + price[i];
 for i := 1 to n do summa_n := summa_n + price[i];

 old_trend := 0;

 for day := n to k do
   begin
     if (summa_m / m) > (summa_n / n) then new_trend := 1
     else new_trend := 2;

     if (old_trend <> new_trend) then
       begin
         old_trend := new_trend;
         if new_trend = 1 then writeln('BUY ON DAY ', day)
         else writeln('SELL ON DAY ', day);
       end;

     summa_m := summa_m + price[day+1] - price[day+1-m];
     summa_n := summa_n + price[day+1] - price[day+1-n];
   end;

 Close(input);Close(output);
end.
 