{$APPTYPE CONSOLE}
program easy;
{$X+}
{$EXTENDEDSYNTAX ON}

const
        st1='easy.in';
        st2='easy.out';
var
        ok1:boolean;
        a:array[0..10000] of real;
        x,y,n,m,k,min:integer;
        s,t:extended;
{******************}
procedure look;
begin
        assign(input,st1); reset(input);
        assign(output,st2); rewrite(output);

        readln(m,n,k);
        for x:=1 to k do readln(a[x]);
end;
{******************}
procedure action;
begin
        min:=n; if m>n then min:=m;
        ok1:=true;

        for x:=min to k do begin s:=0; t:=0;
            for y:=x-m+1 to x do s:=s+a[y];
            for y:=x-n+1 to x do t:=t+a[y];

            if ((s/m)>(t/n))and(ok1) then begin
                ok1:=false;
                writeln('BUY ON DAY ',x);
            end;

            if ((s/m)<(t/n))and(not ok1) then begin
                ok1:=true;
                writeln('SELL ON DAY ',x);
            end;
        end;
end;
{******************}
procedure finish;
begin
        close(input); close(output);
end;
{******************}
begin
        look;
        action;
        finish;
end.
