program e;

{$APPTYPE CONSOLE}

var
  M, N, K: Integer;
  A: array[1..10000] of Integer;

procedure Inp;
var
  I:Integer;
  V: Extended;
begin
  Read(M, N, K);
  for I:=1 to K do
    begin
      Read(V);
      A[I]:=Round(V*100);
    end;
end;

var
  Sm, Sn: Int64;

procedure Run;
var
  I, J: Integer;
  Prev: Integer;
  Cur: Integer;
begin
  I:=N;

  Sm:=0;
  for J:=I downto I-M+1 do
    Sm:=Sm + A[J];

  Sn:=0;
  for J:=I downto I-N+1 do
    Sn:=Sn + A[J];

  if (Sn*M < Sm*N) then
    begin
      WriteLn('BUY ON DAY ', N);
      Prev:=1;
    end
  else
    begin
      Prev:=2;
      WriteLn('SELL ON DAY ', N);
    end;

  for I:=N+1 to K do
    begin
      Sn:=Sn - A[I-N] + A[I];
      Sm:=Sm - A[I-M] + A[I];

      if (Sn*M < Sm*N) then Cur:=1
      else Cur:=2;

      if (Cur <> Prev) then
        if (Cur = 1) then
          WriteLn('BUY ON DAY ', I)
        else
          WriteLn('SELL ON DAY ', I);

      Prev:=Cur;

    end;
end;

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

  Inp;
  Run;
end.
