program E;

{$APPTYPE CONSOLE}
var
 m, n, k, Cyc1, Cyc2, Cyc3 : Integer;
 res : boolean;
 a : array[1..10000] of Single;
 Sn, Sm : Single;
 LastBull, LastBear, ch : Boolean;
 begin
 FillChar(a, Sizeof(a), $00);
 res := true;
  Assign(Input, 'easy.in');
  Reset(Input);
  Assign(Output, 'easy.out');
  Rewrite(Output);

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


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

	if (Cyc1 = n) then
	begin
		Sn := 0;
		for Cyc2 := 1 to n do
			Sn := Sn + a[Cyc2]
	end
	else
		if (Cyc1 > n) then
			Sn := Sn + a[Cyc1] - a[Cyc1 - n];
	ch := false;
	if (Cyc1 >= m) and (Cyc1 >= n) then
	begin
		if (Sm / m > Sn/n) then
			if (Cyc1 = n) or LastBear then
			begin
				WriteLn('BUY ON DAY ', Cyc1);
				ch := true;
			end;

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


 end;




						  


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

