const
 fin='easy.in';
 fout='easy.out';

Var
 N, M, I, K : LongInt;
 C1,C2:LongInt;
 A:array[1..10000] of Extended;

 Sum1,Sum2,F1,F2:Extended;

begin
 assign(Input,fin); reset(input);
 assign(Output,fout); rewrite(output);
 readLn(M,N,K); For I:=1 to K do Read(A[I]);
 F1:=0; C1:=0; C2:=0; Sum1:=0; Sum2:=0;
 FOR I:=1 To K do
 Begin
  Sum1:=Sum1+A[I]; Sum2:=Sum2+A[I];
  if (I>N) then Sum1:=Sum1-A[I-N] else Inc(C1);
  if (I>M) then Sum2:=Sum2-A[I-M] else Inc(C2);
  F2:=(Sum1*C2-Sum2*C1);
  if (I>=N)and(((I=N)and(F2<>0))or(F1*F2<0)) then
  Begin
    if (F2>0) then WriteLn('SELL ON DAY ',I);
    if (F2<0) then WriteLn('BUY ON DAY ',I);
  End;
  if (F2<>0) then F1:=F2;
 End;
 close(input); close(output);
end.