program pe;

{$APPTYPE CONSOLE}

var  f :text;
        i,j,n,m :byte;
        k :word;
        mas :array of real;
        pim,pin :real;
        buy :boolean;

begin
buy:=false;
assignfile(f,'easy.in');
reset(f);
readln(f,m,n,k);
setlength(mas,k);
for i:=1 to k do readln(f,mas[i]);
closefile(f);
assignfile(f,'easy.out');
rewrite(f);
for i:=n to k do
begin
        pim:=0;
        for j:=(i-m+1) to i do pim:=pim+mas[j];
        pim:=pim/m;
        pin:=0;
        for j:=(i-n+1) to i do pin:=pin+mas[j];
        pin:=pin/n;
        if (pim>pin) and (not buy) then
        begin
                buy:=true;
                writeln(f,'BUY ON DAY ',i);
        end;
        if pim<pin then
        begin
                writeln(f,'SELL ON DAY ',i);
                break;
        end;
end;
closefile(f);
end.
