{$apptype console}
{ $q+,r+,o-}
{$q+,r+,o+}
{ $q-,r-,o+}

uses
  math, sysutils;

type
  int = longint;
  bool = boolean;
  float = extended;

const
  fn = 'easy';

var
  i, m, n, k : int;
  pm, pn : extended;
  a : array[0..15000] of extended;
  last, bull : bool;
  nm : int;

begin
  reset(input, fn + '.in');
  rewrite(output, fn + '.out');

  a[0] := 0;

  read(m, n, k);
  for i := 1 to k do begin
    read(a[i]);
  end;
  pm := 0; pn := 0;

  nm := max(n, m);

  for i := nm downto (nm - m + 1) do begin
    pm := pm + a[i];
  end;

  for i := nm downto (nm - n + 1) do begin
    pn := pn + a[i];
  end;

  if (pn / n) < (pm / m) then begin
    bull := true;
  end else begin
    bull := false;
  end;

  for i := nm to k do begin
    last := bull;
    if i <> nm then begin
      pn := pn + a[i];
      pm := pm + a[i];

      pn := pn - a[i - n];
      pm := pm - a[i - m];
    end;

    if (pn / n) > (pm / m) then begin
      bull := true;
    end else begin
      bull := false;
    end;

    if last and (not bull) then begin
      writeln('BUY ON DAY ', i);
    end;
    if (not last) and bull then begin
      writeln('SELL ON DAY ', i);
    end;

  end;

end.