program taskE;
{$APPTYPE CONSOLE}
const
   MAX = 10001;
var
   fi,fo: TextFile;
   m,n,k,i1,i2: longint;
   Pm,Pn,a: array [1..MAX] of extended;

begin
   AssignFile(fi,'easy.in');
   AssignFile(fo,'easy.out');
   Rewrite(fo);
   Reset(fi);
   //input
   Read(fi,m,n,k);
   for i1:=1 to k do Read(fi,a[i1]);
   //solve - as trace
   for i1:=1 to k do
      begin
         Pn[i1]:=-1; Pm[i1]:=-1;
         //as m
         if i1>=m then
            begin
               Pm[i1]:=0;
               for i2:=i1-m+1 to i1 do Pm[i1]:=Pm[i1]+a[i2];
               Pm[i1]:=Pm[i1]/m;
            end;
         //as n
         if i1>=n then
            begin
               Pn[i1]:=0;
               for i2:=i1-n+1 to i1 do Pn[i1]:=Pn[i1]+a[i2];
               Pn[i1]:=Pn[i1]/n;
            end;
         //conditions
         if (i1>=n) then
            begin
               if i1=n then
                  begin
                     if Pm[i1]>Pn[i1] then Writeln(fo,'BUY ON DAY ',i1)
                                      else Writeln(fo,'SELL ON DAY ',i1)
                  end
               else
                  begin
                     if (Pm[i1]>Pn[i1]) AND (Pm[i1-1]<Pn[i1-1]) then Writeln(fo,'BUY ON DAY ',i1);
                     if (Pm[i1]<Pn[i1]) AND (Pm[i1-1]>Pn[i1-1]) then Writeln(fo,'SELL ON DAY ',i1);
                  end;
            end;
      end;
   //deinit
   Close(fo);
   Close(fi);
end.
