program h;

var
	r, c: integer;
	buf:array[0..1, 'A'..'Z', 1..8] of string;
	s: string;
	ch: char;
	charset: integer;

procedure writeplayer(num: integer);
var
	s: string;
	bufx: array['A'..'Z'] of string;
	r: integer;
	ch: char;
begin
for ch:='A' to 'Z' do begin
	bufx[ch]:='';
	if (num=0) then for r:=1 to 8 do begin
		bufx[ch]:=bufx[ch]+buf[num, ch, r];
	end else for r:=8 downto 1 do begin
		bufx[ch]:=bufx[ch]+buf[num, ch, r];
	end;
end;
s := bufx['K'] + bufx['Q'] + bufx['R'] + bufx['B'] + bufx['N'] + bufx['P'];
if (s<>'') then s[1] := ' ';
writeln(s);
end;

begin
	readln(s);
	for r:=8 downto 1 do begin
		readln(s);
		for c:=1 to 8 do begin
			ch := s[c*4-1];
			if ((ch<>':') and (ch<>'.')) then begin
				if ch in ['a'..'z'] then begin
					charset := 1;
					ch := upcase(ch);
				end else begin
					charset := 0;
				end;
				buf[charset, ch, r]:=buf[charset, ch, r]+',';
				if ch<>'P' then buf[charset, ch, r]:=buf[charset, ch, r]+ch;
				buf[charset, ch, r]:=buf[charset, ch, r]+chr(ord('a')-1+c);
				buf[charset, ch, r]:=buf[charset, ch, r]+chr(ord('0')+r);
			end;
		end;
		readln(s);
	end;
	write('White:');
	writeplayer(0);
	write('Black:');
	writeplayer(1);
end.
