program adsasdf;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  i,k,n,m:longint;
  newpn,newpm,pn,pm:real;
  a:array [1..10000] of real;

procedure analize(k:longint; pn,pm:real);
begin
  if pn*m>pm*n then writeln('SELL ON DAY ',k);
  if pn*m<pm*n then writeln('BUY ON DAY ',k);
end;

procedure sink(pn,pm,newpn,newpm:real;k:longint);
begin
  if (pn*m>pm*n) and (newpn*m<newpm*n) then analize(k,newpn,newpm);
  if (pn*m<pm*n) and (newpn*m>newpm*n) then analize(k,newpn,newpm);
end;


begin
  assign(input,'easy.in');reset(input);
  assign(output,'easy.out');rewrite(output);
  readln(m,n,k) ;
  for i :=1 to k do readln(a[i]);
  pn:=0; for i:=1 to n do pn:=pn+a[i];
  pm:=0; for i:=n-m+1 to n do pm:=pm+a[i];
  analize(n,pn,pm);
  for i:=n+1 to k do
  begin
    newpm:=pm;newpn:=pn;
    newpn:=newpn + a[i]-a[i-n];
    newpm:=newpm + a[i]-a[i-m];
    sink(pn,pm,newpn,newpm,i);
    pn:=newpn;pm:=newpm;
  end;
  close(input);
  close(output);
end.
