{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE CONSOLE}

var qc,he,he1,he2:array[0..1000]of extended;
    q,m,n,k,i,j,d:longint;
begin
assign(input,'easy.in');
assign(output,'easy.out');
reset(input);
rewrite(output);
readln(m,n,k);
for i:=1 to k do
        readln(qc[i]);
fillchar(he,sizeof(he),0);
fillchar(he1,sizeof(he),0);
fillchar(he2,sizeof(he),0);
he[0]:=0;
for i:=1 to k do
        begin
        for j:=1 to i do
                he[i]:=he[i]+qc[j];
        he[i]:=he[i]/i;
        end;
for i:=m to k do
        begin
        for j:=0 to m-1 do
                he1[i]:=he1[i]+qc[i-j];
        he1[i]:=he1[i]/m;
        end;
for i:=n to k do
        begin
        for j:=0 to n-1 do
                he2[i]:=he2[i]+qc[i-j];
        he2[i]:=he2[i]/n;
        end;
q:=n-m;
d:=0;
for i:=n to k do
        begin
        if ((he1[i]>he2[i])and(d<>1)) then
                begin
                writeln('BUY ON DAY ',i);
                d:=1;
                end;
        if ((he1[i]<he2[i])and(d<>2)) then
                begin
                writeln('SELL ON DAY ',i);
                d:=2;
                end;
        end;
end.
