program e;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var i,k,m,n:integer;
    a:array [1..10000] of real;
    sn,sm,snlast,smlast:real;
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]);
  sm:=0;
  sn:=0;
  for i:=1 to k do begin
    snlast:=sn;
    smlast:=sm;
    sm:=sm+a[i];
    sn:=sn+a[i];
    if i>m then begin
      sm:=sm-a[i-m];
      if i>=n then begin
        if i>n then sn:=sn-a[i-n];
        if (i=n) then begin
          if sn/n>sm/m then writeln('SELL ON DAY ',i);
          if sn/n<sm/m then writeln('BUY ON DAY ',i);
        end else if (snlast/n - smlast/m)*(sn/n - sm/m)<0 then begin
           if sn/n>sm/m then writeln('SELL ON DAY ',i);
           if sn/n<sm/m then writeln('BUY ON DAY ',i);
        end;
      end;
    end;
  end;
  close(input);
  close(output);
end.
