program te;

{$APPTYPE CONSOLE}

const
    FILE_IN = 'easy.in';
    FILE_OUT = 'easy.out';
    MAX_N = 10000 + 10;


var
    a, sum : array [0..MAX_N] of extended;
    n, m, k, i : longint;

function p ( x, i : longint ) : extended;
begin
    Result := ( sum[i] - sum[i-x] ) / x;
end;

begin
    assign ( input, FILE_IN );
    assign ( output, FILE_OUT );
    reset ( input );
    readln ( m, n, k );
    for i:=1 to k do
        readln ( a[i] );
    close ( input );

    sum[0] := 0;
    for i:=1 to k do
        sum[i] := sum[i-1] + a[i];

    rewrite ( output );
    for i:=n to k do
    begin
        if  (  (i=n) and (p(m,i) > p(n,i))  ) or
            ( (p(m,i) > p(n,i)) and (p(m,i-1)<p(n,i-1)) ) then
            writeln ( 'BUY ON DAY ', i );
        if  (  (i=n) and (p(m,i) < p(n,i))  ) or
            ( (p(m,i) < p(n,i)) and (p(m,i-1)>p(n,i-1)) ) then
            writeln ( 'SELL ON DAY ', i );
    end;
    close ( output );
end.
 