program Project1;

{$APPTYPE CONSOLE}
var
m,n,k,b,s:integer;
p: array [1..10000] of real;
pm,pn:real;
a:boolean;
i,j:integer;
fi,fo:text;
begin
 assign(fi,'easy.in');
       reset(fi);
       readln(fi,m,n,k);
    for i:=1 to k do readln(fi,p[i]);
       close(fi);
       a:=true;
       assign(fo,'easy.out');
       rewrite(fo);

       for i:=n to k do
       begin
         pm:=0;pn:=0;
         for j:=i-m+1 to i do
         pm:=pm+p[j];
         pm:=pm/m;
         for j:=i-n+1 to i do
         pn:=pn+p[j];
         pn:=pn/n;
        if(pm>pn)and((i=n)or(not(a)))then writeln(fo,'BUY ON DAY ',i);
        if(pm<pn)and((i=n)or(a))then writeln(fo,'SELL ON DAY ',i);
        a:=pm>pn;
       end;
 close(fo);



end.
