const
	maxK = 10000;
  eps=1e-11;

var
	m,n,k:	Integer;
  p,pma,pna: array[1..maxK] of Real;

Procedure Init;
var
	i:	Integer;
Begin
	read(m,n,k);
  for i := 1 to k do read(p[i]);
End;

function More(a,b: Real): Boolean;
begin
	More := a-b>eps;
end;

Procedure Solve;
var
	i:	Integer;
  pms,pns: Real;
  f1,f2:		array[1..maxK] of Boolean;
Begin
	pms := 0; pns := 0;
  for i := 1 to n do pns := pns + p[i];
  for i := 1 to m do pms := pms + p[i];
  pna[n] := pns/n;
  pma[n] := pms/m;

  for i := m+1 to k do begin
  	pms := pms + p[i]-p[i-m];
    pma[i] := pms / m;
  end;
  for i := n+1 to k do begin
  	pns := pns + p[i]-p[i-n];
    pna[i] := pns / n;
  end;

  fillchar(f1, sizeof(f1), False);
  fillchar(f2, sizeof(f2), False);
  for i := n to k do
  	if More(pma[i],pna[i]) then begin
     	f1[i] := True;
    	if (i=n)or(f2[i-1]) then begin
        writeln('BUY ON DAY ', i);
      end
    end
    else begin
     	f2[i] := True;
    	if (i=n)or(f1[i-1]) then begin
        writeln('SELL ON DAY ', i);
      end
    end
End;

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