uses
  SysUtils;
var
  m, n, k: integer;
  pn, pm, a: array[1 .. 10000] of extended;
  i: integer;
begin
  assignfile(input, 'easy.in');
  assignfile(output, 'easy.out');
  reset(input);
  rewrite(output);
  read(m, n, k);
  for i := 1 to k do
    read(a[i]);

  pn[n] := 0;
  for i := 1 to n do
    pn[n] := pn[n] + a[i];
  for i := n + 1 to k do
    pn[i] := pn[i - 1] - a[i - n] + a[i];
  for i := n to k do
    pn[i] := pn[i] / n;

  pm[n] := 0;
  for i := 1 to m do
    pm[m] := pm[m] + a[i];
  for i := m + 1 to k do
    pm[i] := pm[i - 1] - a[i - m] + a[i];
  for i := m to k do
    pm[i] := pm[i] / m;

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

  closefile(input);
  closefile(output);
end.
