program E;

{$APPTYPE CONSOLE}
var
 m, n, k, Cyc1, Cyc2, Cyc3 : LongInt;
 a : array[0..11000] of Extended;
 Sn, Sm : Extended;
 LastBull, LastBear : Boolean;
 begin
  Assign(Input, 'easy.in');
  Reset(Input);
  Assign(Output, 'easy.out');
  Rewrite(Output);

	LastBull := false;
	LastBear := false;
	Sm := 0;
	Sn := 0;


 ReadLn(m, n, k);
 for Cyc1 := 1 to k do
 begin
  ReadLn(a[Cyc1]);
	if (Cyc1 >= n) then
	begin
		if (Cyc1 = n) then
		begin
			Sm := 0;
			for Cyc2 := Cyc1 - m + 1 to Cyc1 do
				Sm := Sm + a[Cyc2];
			Sn := 0;
			for Cyc2 := Cyc1 - n + 1 to Cyc1 do
				Sn := Sn + a[Cyc2];
		end
		else
		begin
			Sm := Sm + a[Cyc1] - a[Cyc1 - m];
			Sn := Sn + a[Cyc1] - a[Cyc1 - n];
		end;

		if (Sm / m > Sn / n) then
		begin
			if (Cyc1 = n) or LastBear then
				WriteLn('BUY ON DAY ', Cyc1);
			LastBull := true;
			LastBear := false;
		end
		else
		begin
			if (Cyc1 = n) or LastBull then
				WriteLn('SELL ON DAY ', Cyc1);
			LastBull := false;
			LastBear := true;
		end
	end;
 end;


  Close(Input);
  Close(Output);
end.

