program probE;
{$APPTYPE CONSOLE}
const
   maxn = 100;
   maxk = 10000;
var
  p : array[0..maxk]of real;
  pn, pm : real;
  n, m, k, i : longint;
  u:array[1..maxk]of boolean;
begin
  assign(input,'easy.in');
  reset(input);
  assign(output,'easy.out');
  rewrite(output);
  read(m);
  read(n);
  read(k);
  p[0]:=0.0;
  for i:=1 to k do begin
   read(p[i]);
   p[i]:=p[i]+p[i-1];
  end;
  for i := n to k do begin
      pn := p[i] - p[i-n];
      pm := p[i] - p[i-m];
      if pn*m < pm*n then begin
        if (i=n)or(not u[i-1]) then writeln('BUY ON DAY ',i);
        u[i]:=true;
      end else begin
         if (i=n)or(u[i-1])then  writeln('SELL ON DAY ',i);
         u[i]:=false;
      end;
  end;

  close(input);
  close(output);
end.
