{$I-,Q-,R-,S-,D-,L-,O+}
{I+,Q+,R+,S+,D+,L+,O-}
program E;
{$APPTYPE CONSOLE}
const
  inf = 'easy.in';
  ouf = 'easy.out';
  maxn = 10002;

type
  real = extended;
  int = longint;

var
  a : array [0..maxn] of real;
  k, i, n, m, max, f : int;
  sn, sm : real;

function  more(a, b : real) : boolean;
begin
  more := a - b > 1e-8;
end;

begin
  assign(input, inf);
  reset(input);
  read(m, n, k);
  for i := 1 to k do read(a[i]);
  close(input);

  assign(output, ouf);
  rewrite(output);
  f := 0;
  max := n;
  if n < m then max := m;

  for i := 1 to k do begin

    sn := sn + a[i];
    if i > n then sn := sn - a[i - n];
    sm := sm + a[i];
    if i > m then sm := sm - a[i - m];

    if(i = max)then begin
      if(more(sm / m, sn / n))then begin
        f := 1;
        writeln('BUY ON DAY ', i);
      end else begin
        f := 2;
        writeln('SELL ON DAY ', i);
      end;
    end;

    if i > max then begin
      if(f = 2)and(more(sm / m, sn / n))then begin
        f := 1;
        writeln('BUY ON DAY ', i);
      end else
      if(f = 1)and(more(sn / n, sm / m))then begin
        f := 2;
        writeln('SELL ON DAY ', i);
      end;

    end;
  end;
  close(output);
end.
