program Project1;

uses
  SysUtils;

var
  mas: array [1..10000] of real;
  i,k,n,m: integer;
  pm,pn:real;
  sell:boolean;

begin
	assignfile(input, 'easy.in');
  assignfile(output, 'easy.out');
  reset(input);
  rewrite(output);

  readln(m,n,k);
  for i:=1 to k do readln(mas[i]);
  pm:=0;
  pn:=0;
	for i:=n downto 1 do pn:=pn+mas[i];
  for i:=n downto n-m+1 do pm:=pm+mas[i];
	if pm/m > pn/n then writeln('BUY ON DAY ',n);
	if pn/n > pm/m then writeln('SELL ON DAY ',n);
	if pm/m > pn/n then sell:=true else sell:=false;
  for i:=n+1 to k do begin
		pm:=pm-mas[i-m]+mas[i];
		pn:=pn-mas[i-n]+mas[i];
    if (pm/m > pn/n) and (not sell) then writeln('BUY ON DAY ',i);
    if (pn/n > pm/m) and (sell) then writeln('SELL ON DAY ',i);
    sell:=(pm/m > pn/n);
  end;
end.

