program e;

{$APPTYPE CONSOLE}
{$R+,Q+,S+,H+}

uses
  Math,
  SysUtils;

Type
  Integer=LongInt;
  Real=Extended;

Const
  TaskID='easy';
  InFile=TaskID+'.in';
  OutFile=TaskID+'.out';
  MaxK=10002;

Var
  M,N,K:Integer;
  P:Array[1..MaxK]Of Real;

Procedure Load;
Var
  I:Integer;
Begin
  ReSet(Input,InFile);
  Read(M,N,K);
  For I:=1 To K Do Read(P[I]);
  Close(Input);
End;

Procedure Solve;
Var
  S1,S2:Real;
  I:Integer;
  OBull,Bull:Boolean;
Begin
  ReWrite(Output,OutFile);
  S1:=0;
  S2:=0;
  For I:=1 To N Do S1:=S1+P[I];
  For I:=N-M+1 To N Do S2:=S2+P[I];
  Bull:=False;
  For I:=N To K Do Begin
    If I>N Then Begin
      S1:=S1-P[I-N]+P[I];
      S2:=S2-P[I-M]+P[I];
    End;
    OBull:=Bull;
    If S2/M>S1/N Then Bull:=True Else Bull:=False;
    If Bull Then Begin
      If (I=N) Or (Not OBull) Then WriteLn('BUY ON DAY ',I);
    End Else Begin
      If (I=N) Or OBull Then WriteLn('SELL ON DAY ',I);
    End;
  End;
End;

Procedure Save;
Begin
  Close(Output);
End;

begin
  Load;
  Solve;
  Save;
end.
 