program Project2;
{$APPTYPE CONSOLE}

var
  b,a:array[1..10000]of real;
  start,n,m,k:integer;
  q:integer;

procedure init;
var
  i:integer;
begin
        assignfile(input,'easy.in');
        reset(input);
                readln(m,n,k);
                for i:=1 to k do begin
                  readln(a[i]);
                end;
        closefile(input);
end;

procedure vivi;
var
  i:integer;
begin
        assignfile(output,'easy.out');
        rewrite(output);
                for i:=start-1 to k-1 do begin
                  if b[i]<>b[i+1] then begin
                    if b[i+1]=1 then begin
                      writeln('BUY ON DAY ',i+1);
                    end
                    else if b[i+1]=2 then begin
                       writeln('SELL ON DAY ',i+1);
                    end;
                  end;
                end;
        closefile(output);
end;

procedure proc;
var
  j,i:integer;
  sum1,sum2:real;
begin
q:=0;
  if n>m then begin
    start:=n;
  end
  else start:=m;
  for i:=start to k do begin
    sum1:=0;
    sum2:=0;
    for j:=1 to m do begin
      sum1:=sum1+a[i+j-m];
    end;
    for j:=1 to n do begin
      sum2:=sum2+a[i+j-n];
    end;
    sum1:=sum1/m;
    sum2:=sum2/n;
    if sum1>sum2 then begin
      q:=1;
    end
    else if sum1<sum2 then begin
      q:=2;
    end;
    b[i]:=q;
  end;
end;

begin
        init;
        proc;
        vivi;
end.
