{$APPTYPE CONSOLE}
{$O-,R+,Q+}
uses
  Sysutils, Math;
const
  inf = 1000000000;
  eps = 1e-9;
  base = 10;
type
  int = longint;
  bool = boolean;
  real = extended;
var
  i, j, k, n, m: int;
  p: array[1..10001] of real;
  pn, pm: real;
  ppn, ppm: real;

begin
  assign(input, 'easy.in');
  reset(input);
  assign(output, 'easy.out');
  rewrite(output);
  read(m, n, k);
  for i := 1 to k do
  begin
    read(p[i]);
  end;
  p[k + 1] := 0;
  p[k + 1] := 0;
  pn := 0;
  pm := 0;
  for i := 1 to n do
  begin
    pn := pn + p[i];
  end;
  for i := n - m + 1 to n do
  begin
    pm := pm + p[i];
  end;
  pn := pn / n;
  pm := pm / m;
{  if pm > pn then
  begin
    writeln('BUY ON DAY ', n);
  end;
  if pm < pn then
  begin
    writeln('SELL ON DAY ', n);
  end;{}
  for i := n to k do
  begin
    if pm > pn then
    begin
      if i = n then
      begin
        writeln('BUY ON DAY ', i);
      end else if ppm < ppn then
      begin
        writeln('BUY ON DAY ', i);
      end;
    end;
    if pm < pn then
    begin
      if i = n then
      begin
        writeln('SELL ON DAY ', i);
      end else if ppm > ppn then
      begin
        writeln('SELL ON DAY ', i);
      end;
    end;
    ppn := pn;
    ppm := pm;
    pn := pn + (p[i + 1] - p[i - n + 1]) / n;
    pm := pm + (p[i + 1] - p[i - m + 1]) / m;
  end;

  close(input);
  close(output);
end.
//Leafy tops of root vegetables strike back...