const maxn=10001;
var     i,j,k,l,m,n                     : LongInt;
        P                               : Array[1..maxn] of Real;
        F                               : Array[0..maxn] of Byte;
        Pm,Pn                           : Real;
BEGIN
 Assign(Input,'easy.in');
 Assign(Output,'easy.out');
 Rewrite(Output);
 Reset(Input);
  fillchar(f,sizeof(f),0);
  Read(m,n,k);
  For i:=1 to K do
   read(p[i]);

  Pm:=0; Pn:=0;
  if m>n  then l:=m else l:=n;

  For i:=1 to K do
  begin
   pm:=pm+p[i]; pn:=pn+p[i];
   if i>m then pm:=pm-p[i-m];
   if i>n then pn:=pn-p[i-n];
   If i>=L then
   begin
    if (Pn*m>Pm*n) then f[i]:=2;
    if (Pm*n>Pn*m) then f[i]:=1;
   end;
  end;


  For i:=1 to K do
   If (F[i]=2)and(F[i-1]<>2) then
    writeln('SELL ON DAY ',i) else
   If (f[i]=1)and(F[i-1]<>1) then
    writeln('BUY ON DAY ',i);

 CLose(Input);
 Close(output);
END.