program e;{$APPTYPE CONSOLE} {
3 5 17
8.45
9.10
9.40
10.15
10.40
11.08
11.52
12.12
12.51
12.15
11.90
11.25
11.73
10.77
10.80
10.01
9.14
}
{$R+,Q+,I+,O-,A+,B-}
var
i,n,j,m,k:longint;
	a: array [1..10000] of extended;
	last, last2: string;
	s, pm, pn: extended;

begin
assign(input,'easy.in');reset(input);
//assign(input,'e.dpr');reset(input); readln;
assign(output,'easy.out'); rewrite(output);
readln (m, n, k);
for i:=1 to k do readln (a[i]);
for i:=n to k do begin
	s:=0;
	for j:=i-n+1 to i do s:=s+a[j];
	pn:=s/n;
	s:=0;
	for j:=i-m+1 to i do s:=s+a[j];
	pm:=s/m;
	if pm>pn then begin
		last2:='bull'; if (last='bear') or (i=n) then writeln ('BUY ON DAY ', i);
		last:=last2;
	end;
	if pm<pn then begin
		last2:='bear'; if (last='bull') or (i=n) then writeln ('SELL ON DAY ', i);
		last:=last2;
	end;
end;

close(output);
end.
