const
  InFile  = 'easy.in';
  OutFile = 'easy.out';
  
var
  inf, outf : textfile;
  m,n,k : integer;
  p : array [1..20000] of real;

procedure Init;
var i : integer;
begin
  Assign(inf, InFile);
  Assign(outf, OutFile);
  Reset(inf);
  Rewrite(outf);
  Read(inf, m, n, k);
  for i := 1 to k do
  begin
    Read(inf, p[i]);
  end;
end;

function FindSumm(day, count: integer): real;
var i : integer;
Summ : real;
begin
  Summ := 0;
  for i := 0 to count - 1 do
  begin
    Summ := Summ + p[day - i];
  end;
  FindSumm := Summ;
end;

procedure Run;
var flag, i : integer;
pm, pn : real;

begin
  flag := 0;
  for i := n to k do 
  begin
    pm := FindSumm(i, m) / m;
    pn := FindSumm(i, n) / n;
    if ((flag = 0)  or  (flag = 1)) and (pm < pn) then
    begin
      writeln(outf, 'SELL ON DAY ', i);
      flag := 2;
    end;
    if ((flag = 0)  or  (flag = 2)) and (pm > pn) then
    begin
      writeln(outf, 'BUY ON DAY ', i);
      flag := 1;
    end;
  end;
end;

procedure Done;
begin
  Close(inf);
  Close(outf);
end;


begin
  Init;
  Run;
  Done;
  Halt(0);
end.