{$APPTYPE CONSOLE}
var p:array[0..20000] of extended;
    m,n,k,i:longint;
    pn,pm:extended;
    sell:boolean;
begin
    assign(input,'easy.in');reset(input);
    assign(output,'easy.out');rewrite(output);
    read(m,n,k);
    for i:=1 to k do read(p[i]);
    pm:=0; for i:=n-m+1 to n do pm:=pm+p[i]/m;
    pn:=0; for i:=1 to n do pn:=pn+p[i]/n;
    if pn<pm then begin
            writeln('BUY ON DAY ',n);
            sell:=false;
    end
    else begin
            writeln('SELL ON DAY ',n);
            sell:=true;
    end;

    for i:=n+1 to k do begin
        pn:=pn+(p[i]-p[i-n])/n;
        pm:=pm+(p[i]-p[i-m])/m;
        if (pn<pm) and sell then begin
            writeln('BUY ON DAY ',i);
            sell:=false;
        end
        else if (pn>pm) and not sell then begin
            writeln('SELL ON DAY ',i);
            sell:=true;
        end;
    end;

end.
