program easy;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Math;

var
  p, pm, pn: array[0..10000] of double;
  i,j,k, m, n: integer;

function avg(i,j: integer): double;
var
  k: integer;
  sum: double;
begin
  sum := 0;
  for k := i to j do begin
    sum := sum + p[k];
  end;
  Result := sum / (j - i + 1);
end;

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

  readln(m, n, k);

  for i := 1 to k do begin
    readln(p[i]);
  end;

  for i := n to k do begin
    pm[i] := avg(i - m + 1, i);
    pn[i] := avg(i - n + 1, i);
    if (pm[i] > pn[i]) and ((i=n) or (pm[i-1] < pn[i-1])) then writeln('BUY ON DAY ', i);
    if (pm[i] < pn[i]) and ((i=n) or (pm[i-1] > pn[i-1])) then writeln('SELL ON DAY ', i);    
  end;

  close(output);
end.
