program e;

{$APPTYPE CONSOLE}

const fname = 'easy';
      ifile = fname + '.in';
      ofile = fname + '.out';
      MAXN = 10100;

var n,m,num: longint;
    mas: array[1..MAXN]of longint;
    pm,pn: array[1..MAXN]of extended;

procedure load();
var k: longint;
    e: extended;
begin
  read(m,n,num);
  for k:=1 to num do begin
    read(e);
    mas[k]:=round(e*100);
  end;
end;

procedure solve();
var f,k,sum: longint;
begin
  sum:=0;
  for k:=1 to m do
    inc(sum,mas[k]);
  pm[m]:=sum/m;
  for k:=m+1 to num do begin
    inc(sum,mas[k]);
    dec(sum,mas[k-m]);
    pm[k]:=sum/m;
  end;

  sum:=0;
  for k:=1 to n do
    inc(sum,mas[k]);
  pn[n]:=sum/n;
  for k:=n+1 to num do begin
    inc(sum,mas[k]);
    dec(sum,mas[k-n]);
    pn[k]:=sum/n;
  end;

  if pm[n]>pn[n] then begin
    f:=1;
    writeln('BUY ON DAY ',n);
  end
  else begin
    f:=0;
    writeln('SELL ON DAY ',n);
  end;
  for k:=n+1 to num do
    if pm[k]>pn[k] then begin
      if f=0 then
        writelN('BUY ON DAY ',k);
      f:=1;
    end
    else begin
      if f=1 then
        writeln('SELL ON DAY ',k);
       f:=0;
    end;
end;

procedure save();
begin

end;

begin
  assign(input,ifile);
  reset(input);
  assign(output,ofile);
  rewrite(output);
  load;
  solve;
  save;
end.
 