{$APPTYPE CONSOLE}
{$O-,Q+,R+}

uses Math, SysUtils;

type
  int = integer;
  bool = boolean;
  real = extended;

var
  n, m, k, i, md: integer;
  p: array[1..11000] of real;
  p1, p2: real;

begin
  reset(input, 'easy.in');
  rewrite(output, 'easy.out');

  read(m, n, k);
  for i := 1 to k do read(p[i]);

  p1 := 0;
  for i := 1 to n do p1 := p1 + p[i];
  for i := n - m + 1 to n do p2 := p2 + p[i];

  md := 0;
  for i := n to k do begin
    if p1*m > p2*n then begin
      if md <> 1 then begin
        writeln('SELL ON DAY ', i);
        md := 1;
      end;
    end else begin
      if md <> 2 then begin
        writeln('BUY ON DAY ', i);
        md := 2;
      end;
    end;
    p1 := p1 - p[i - n + 1] + p[i + 1];
    p2 := p2 - p[i - m + 1] + p[i + 1];
  end;
end.