const
  maxN = 10000;

var
  i, k, nn, mm : longint;
  w, n, m : array [1..maxN] of extended;

begin
  assign(input, 'easy.in');
  reset(input);
  assign(output, 'easy.out');
  rewrite(output);

  read(mm, nn, k);
  for i := 1 to k do
    read(w[i]);
  fillchar(m, sizeof(m), 0);
  fillchar(n, sizeof(n), 0);
  for i := 1 to mm do
    m[mm] := m[mm] + w[i];
  m[mm] := m[mm] / mm;
  for i := 1 to nn do
    n[nn] := n[nn] + w[i];
  n[nn] := n[nn] / nn;

  for i := mm + 1 to k do
    m[i] := m[i - 1] + (w[i] - w[i - mm]) / mm;
  for i := nn + 1 to k do
    n[i] := n[i - 1] + (w[i] - w[i - nn]) / nn;
  for i := nn to k do
  begin
    if (m[i] > n[i]) then
      if (i = nn) or ((i >= 2) and (n[i - 1] >  m[i - 1])) then
        writeln('BUY ON DAY ', i);
    if (m[i] < n[i]) then
      if (i = nn) or ((i >= 2) and (n[i - 1] <  m[i - 1])) then
        writeln('SELL ON DAY ', i);
  end;

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