program e;

{$APPTYPE CONSOLE}

uses
  SysUtils;
  var f:text;
      f1:text;
  h,i,n,m,k:integer;
  a:array [1..10000] of  real;
  ppm:array [1..10000] of real;
  ppn:array [1..10000] of real;
  
begin
  assignfile (f,'zad.in');
  assignfile(f1,'zad.out');
  reset(f);
  rewrite(f1);
  read(f,m,n,k);
  for i:= 1 to k do
  readln(f,a[i]);
  for i:=n  to k do begin
  ppm[i]:=0;
 for h := i-m+1 to i do
  ppm[i]:=ppm[i]+a[h];
  ppm[i]:= ppm[i] / m;
end;
  for i:=n  to k do begin
  ppn[i]:=0;
 for h := i-n+1 to i do
  ppn[i]:=ppn[i]+a[h];
  ppn[i]:= ppn[i] / n;
end;
for i := n to k do begin
if ppm[i] > ppn[i] then
if (i=n) xor (ppm[i-1] < ppn[i-1]) then
writeln (F1,'BUY ON DAY ',i);
if ppn[i] > ppm[i] then
if (i=1) xor (ppn[i-1] < ppm[i-1]) then write  (F1,'SELL ON DAY ',i);
end;
closefile(f1)
  {
   TODO -oUser -cConsole Main : Insert code here }
end.
