var
  i, n, m, k: integer;
  c, pm, pn: array[1..10005] of extended;
  s1, s2: extended;

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

  read(m, n, k);
  for i := 1 to k do
    read(c[i]);

  s1 := 0;
  s2 := 0;
  for i := 1 to m - 1 do
    s2 := s2 + c[i];
  for i := m to k do begin
    pm[i] := (s2 - s1 + c[i])/m;
    s1 := s1 + c[i - m + 1];
    s2 := s2 + c[i];
  end;


  s1 := 0;
  s2 := 0;
  for i := 1 to n - 1 do
    s2 := s2 + c[i];
  for i := n to k do begin
    pn[i] := (s2 - s1 + c[i])/n;
    s1 := s1 + c[i - n + 1];
    s2 := s2 + c[i];
  end;

  for i := n to k do begin
    if (pm[i] > pn[i]) and ((i = n) or (pm[i - 1] < pn[i - 1])) then begin
      writeln('BUY ON DAY ', i);
    end;
    if (pm[i] < pn[i]) and ((i = n) or (pm[i - 1] > pn[i - 1])) then begin
      writeln('SELL ON DAY ', i);
    end;
  end;
   
end.
