program P_E;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  i, j, lm, m, n, k, ln: integer;
  p: array [1..10000] of double;
  bb: boolean;
  pn, pm: double;


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

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


  lm := 0;
  ln := 0;

  for i := 1 to n - 1 do
    pn := pn + p[i];

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

  if (pm/(m - 1)) > (pn/(n - 1)) then
  begin
    bb := true;
    writeln('BUY ON DAY ', n)
  end else
  begin
    bb := false;
    writeln('SELL ON DAY ', n);
  end;

  pn := pn + p[n];
  pm := pm + p[n];

  ln := 1;
  lm := n - m + 1;

  for i := n + 1 to k do
  begin
    pn := pn - p[ln] + p[i];
    ln := ln + 1;

    pm := pm - p[lm] + p[i];
    lm := lm + 1;

    if (pm/m) > (pn/n) then
    begin
      if not bb then
        writeln('BUY ON DAY ', i);
      bb := true;
    end else
    begin
      if bb then
        writeln('SELL ON DAY ', i);
      bb := false;  
    end;

  end;




  close(input); close(output);
end.

