program prE;

var
  n, m, k, i: Integer;
  a: array[0..10000] of Extended;
  sm, sn, pm, pn: Extended;
  Prev, Cur: Boolean;

begin
  Assign(Input, 'easy.in');
  Reset(Input);
  Assign(Output, 'easy.out');
  Rewrite(Output);

  ReadLn(m, n, k);
  for i := 0 to k - 1 do Read(a[i]);

  sn := 0;
  for i := 0 to n - 1 do sn := sn + a[i];
  sm := 0;
  for i := n - m to n - 1 do sm := sm + a[i];

  Prev := False;
  for i := n to k do
  begin
    pm := sm / m;
    pn := sn / n;
    if pm > pn then Cur := True
    else Cur := False;
    if i = n then
    begin
      if Cur then WriteLn('BUY ON DAY ', i)
      else WriteLn('SELL ON DAY ', i);
    end
    else begin
      if not Prev and Cur then WriteLn('BUY ON DAY ', i);
      if Prev and not Cur then WriteLn('SELL ON DAY ', i);
    end;
    Prev := Cur;
    if i < k then
    begin
      sn := sn + a[i];
      sn := sn - a[i - n];
      sm := sm + a[i];
      sm := sm - a[i - m];
    end;
  end;
end.
