var a:array[0..11000] of real;
    i,j,k,n,m:longint;
    rn,rm,pn,pm:real;
    f: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(a[i]);
      f:=true;
      pn:=0;
      for i:=n downto 1 do
        pn:=pn+a[i];
      rn:=pn/n;
      pm:=0;
      for i:=n downto n-m+1 do
        pm:=pm+a[i];
      rm:=pm/m;
      if rn>rm then
        begin
          writeln('SELL ON DAY ',n);
          f:=true;
        end else
        begin
          writeln('BUY ON DAY ',n);
          f:=false;
        end;
      for i:=n+1 to k do
        begin
          rn:=rn+(a[i]-a[i-n])/n;
          rm:=rm+(a[i]-a[i-m])/m;
          if (rn>rm) and (f=false) then
            begin
              writeln('SELL ON DAY ',i);
              f:=true;
            end;
          if (rn<rm) and (f=true) then
            begin
              writeln('BUY ON DAY ',i);
              f:=false;
            end;
        end;
        close(input);
        close(output);
    end.