program taske;
{$APPTYPE CONSOLE}
{$I+,Q+,R+,O-}
uses
  SysUtils,Math;
type
  short=smallint;
  long=longint;
  real=extended;
  bool=boolean;
const
  maxk=10000;
var
  m,n,k,i: long;
  s: real;
  p,pm,pn: array[1..maxk] of real;
  bu,be: array[1..maxk] of bool;

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]);

  s:=0;
  for i:=1 to m do s:=s+p[i];
  pm[m]:=s/m;
  for i:=m+1 to k do begin
    s:=s-p[i-m]+p[i];
    pm[i]:=s/m;
  end;

  s:=0;
  for i:=1 to n do s:=s+p[i];
  pn[n]:=s/n;
  for i:=n+1 to k do begin
    s:=s-p[i-n]+p[i];
    pn[i]:=s/n;
  end;

  fillchar(be,sizeof(be),false);
  fillchar(bu,sizeof(bu),false);
  for i:=n to k do begin
    if pm[i]>pn[i] then begin
      bu[i]:=true;
      if (i=n) or (be[i-1]) then begin
        writeln('BUY ON DAY ',i);
      end;
    end;
    if pm[i]<pn[i] then begin
      be[i]:=true;
      if (i=n) or (bu[i-1]) then begin
        writeln('SELL ON DAY ',i);
      end;
    end;
  end;

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