program E;

{$APPTYPE CONSOLE}

uses
  SysUtils;

Var A           : array [1..10000] of extended;
    K,N,M,i,j   : longint;
    Sm,Sn       : extended;

begin
  { TODO -oUser -cConsole Main : Insert code here }
  assignFile(input,'easy.in'); Reset(input);
  assignFile(output,'easy.out'); Rewrite(output);

  Readln(M,N,K);
  For i:=1 to K do Readln(A[i]);

  Sn:=0; Sm:=0;

  For i:=1 to N do Begin
    Sn:=Sn+A[i];
    If i>N-M then Sm:=Sm+A[i];
  End;

  If Sm*N>Sn*M then Writeln('BUY ON DAY ',N);
  If Sm*N<=Sn*M then Writeln('SELL ON DAY ',N);

  For i:=N+1 to K do Begin
    If Sm*N>Sn*M then Begin
      Sm:=Sm+A[i]-A[i-M];
      Sn:=Sn+A[i]-A[i-N];
      If Sm*N<=Sn*M then Writeln('SELL ON DAY ',i);
    End
    Else Begin
      Sm:=Sm+A[i]-A[i-M];
      Sn:=Sn+A[i]-A[i-N];
      If Sm*N>Sn*M then Writeln('BUY ON DAY ',i);
    End;
  End;

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