program easy;
const
 maxn=100002;
type
 tmas=array[1..maxn] of real;
var
 n,m,k,x,i,j:longint;
 summ,sumn,srn,srm:double;
 a:tmas;
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]);

  summ:=0;
  sumn:=0;
  for i:=1 to n do
  begin
    sumn:=sumn+a[i];
    if i>=n-m+1 then summ:=summ+a[i];
  end;

  srn:=sumn/n;
  srm:=summ/m;

  if srn<srm then
  begin
    writeln('BUY ON DAY ',n);
    x:=1;
  end else
  begin
    writeln('SELL ON DAY ',n);
    x:=2;
  end;

  for i:=n+1 to k do
  begin
    summ:=summ-a[i-m]+a[i];
    sumn:=sumn-a[i-n]+a[i];
    srm:=summ/m;
    srn:=sumn/n;
    if (srm>srn) and (x=2) then
    begin
      writeln('BUY ON DAY ',i);
      x:=1;
    end else
    if (srm<srn) and (x=1) then
    begin
      writeln('SELL ON DAY ',i);
      x:=2;
    end;
  end;

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