program eas;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,m,k,i:integer;
    a,s:array[0..10000] of real;
    pm,pn,c,p:real;

begin
  assign(input, 'easy.in');
  reset(input);
  assign(output, 'easy.out');
  rewrite(output);

  readln(m,n,k);

  for i:=1 to k do
  begin
    readln(a[i]);
    s[i]:=s[i-1]+a[i];


    if(i>=n) then
    begin
      pn:=(s[i]-s[i-n])/n;
      pm:=(s[i]-s[i-m])/m;
      c:=pm-pn;

      if(p=0) then p:=-c;

      if(p*c<0) then
      begin
        if(c>0) then
          writeln('BUY ON DAY ',i)
        else
          writeln('SELL ON DAY ',i);
      end;
      
      p:=c;
    end;
  end;

  close(input);
  close(output);
end.
