{$R+,Q+,O-}
{$MINSTACKSIZE $00404000}
{$APPTYPE CONSOLE}
type
  int = longint;

var
  p, w1, w2: array [0..11000] of extended;
  second: array [1..11000] of boolean;
  n, m, k, i: int;
  
begin
  assign(input, 'easy.in');
  assign(output, 'easy.out');
  reset(input);
  rewrite(output);

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

  fillchar(w1, sizeof(w1), 0);
  fillchar(w2, sizeof(w2), 0);
  for i:=1 to m do
  begin
    w1[i]:=w1[i - 1] + p[i];
    w2[i]:=w2[i - 1] + p[i];
  end;

  for i:=m + 1 to n do
  begin
    w1[i]:=w1[i - 1] + p[i] - p[i - m];
    w2[i]:=w2[i - 1] + p[i];
  end;

  for i:=n to k do
  begin
    w1[i]:=w1[i - 1] + p[i] - p[i - m];
    w2[i]:=w2[i - 1] + p[i] - p[i - n];
    
    if (w1[i] * n < m * w2[i]) then
    begin
      second[i]:=true;
      if (i = n) or (not second[i - 1]) then
        writeln('SELL ON DAY ', i);

      continue;
    end;

    second[i]:=false;
    if (i = n) or (second[i - 1]) then
      writeln('BUY ON DAY ', i);
  end;
end.

