program E;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var m,n,k:integer;
    x:array[1..1000] of double;

procedure getData;
var i:integer;
begin
  read(m,n,k);
  for i:=1 to k do read(x[i]);
end;

procedure solve;
var i,j:integer;
    pn,pm:double;
    pp:integer;
    ch:boolean;
begin
  pp:=0;
  for i:=n to k do begin
    pm:=0;
    for j:=i-m+1 to i do pm:=pm+x[j];
    pn:=pm;
    for j:=i-n+1 to i-m do pn:=pn+x[j];
    pm:=pm/m;
    pn:=pn/n;
    inc(pp);
    if pp<>1 then begin
      if ch then begin
        if pn>pm then begin
          writeln('SELL ON DAY ',i);
          ch:=false;
        end;
      end
      else
      if pn<pm then begin
        writeln('BUY ON DAY ',i);
        ch:=true;
      end;
    end
    else
    begin
      if pn<pm then begin
        writeln('BUY ON DAY ',n);
        ch:=true;
      end
      else begin
        writeln('SELL ON DAY ',n);
        ch:=false;
      end;
    end
  end;
end;

begin
  assign(input,'easy.in'); reset(input);
  assign(output,'easy.out'); rewrite(output);
  getData;
  solve;
  close(input); close(output);
end.
