program easy;

var
  n, m, k, i: Integer;
  p: array of extended;
  sm, sn: extended;
  buy: boolean;

begin
  Assign(Input, 'easy.in');
  Assign(Output, 'easy.out');
  Readln(m, n, k);
  sm:=0; sn:=0;
  SetLength(p, k+1);
  for i:=1 to k do readln(p[i]);
  for i:=1 to n do sn:=sn+p[i];
  for i:=m to n do sm:=sm+p[i];
  buy:=sm/m > sn/n;
  if buy then Writeln('BUY ON DAY ',n)
  else Writeln('SELL ON DAY ',n);
  for i:=n+1 to k do
  begin
    sn:=sn-p[i-n];
    sm:=sm-p[i-m];
    sn:=sn+p[i];
    sm:=sm+p[i];
    if buy <> (sm/m > sn/n) then
    begin
      buy:=sm/m > sn/n;
      if buy then Writeln('BUY ON DAY ',i)
      else Writeln('SELL ON DAY ',i);
    end;
  end;

end.
