var i, k, m, n: Integer;
    p: array [1..10000] of Real;
    Pm, Pn: Real;
    fl: Boolean;
begin
  Assign(input, 'easy.in');
  Assign(output, 'easy.out');
  Reset(input);
  Rewrite(output);

  Pn := 0;
  Pm := 0;
  Readln(m, n, k);
  for i := 1 to k do
  begin
    read(p[i]);
    if i <= n then
      Pn := Pn + p[i] / n;
    if (i <= n) and (i >= n-m+1) then
      Pm := Pm + p[i] / m;
  end;
  if Pm > Pn then
  begin
    writeln('BUY ON DAY ', n);
    fl := true;
  end
  else
  begin
    writeln('SELL ON DAY ', n);
    fl := false;
  end;
  for i := n+1 to k do
  begin
    Pn := Pn - p[i-n]/n + p[i]/n;
    Pm := Pm - p[i-m]/m + p[i]/m;
    if (Pm > Pn) and (not fl) then
    begin
      writeln('BUY ON DAY ', i);
      fl := true;
    end
    else if (Pm < Pn) and (fl) then
    begin
      writeln('SELL ON DAY ', i);
      fl := false;
    end
  end;

  Close(input);
  Close(output);
end.
