program pe;

uses math;

const infile  = 'easy.in';
      outfile = 'easy.out';
      maxk    = 10000;

var p : array[1..maxk]of extended;
    pm, pn : array[1..maxk]of extended;
    m, n, k : longint;

procedure init;
var i : longint;
 begin
  assign(input, infile); reset(input);
  assign(output, outfile); rewrite(output);
  read(m, n, k);
  for i := 1 to k do read(p[i]);
 end;

procedure solve;
var i : longint;
    bu : boolean;
    be : boolean;
 begin
  pn[1] := p[1];
  for i := 2 to n do pn[i] := pn[i - 1] + p[i];
  for i := n + 1 to k do pn[i] := pn[i - 1] + p[i] - p[i - n];

  pm[1] := p[1];
  for i := 2 to m do pm[i] := pm[i - 1] + p[i];
  for i := m + 1 to k do pm[i] := pm[i - 1] + p[i] - p[i - m];

  for i := max(m, n) to k do
   if (pm[i] / m) > (pn[i] / n) then begin
     bu := true;
     if (i = n) or be then writeln('BUY ON DAY ', i);
     be := false;
    end else begin
     be := true;
     if (i = n) or bu then writeln('SELL ON DAY ', i);
     bu := false;
    end;
 end;

procedure save;
 begin
  close(output);
 end;

begin
 init;
 solve;
 save;
end.