program emag;
var
  chess: array[1..8,1..8] of char;
  S: string;
  N,I,j: integer;
  col: string;

procedure draw(s:string; col: string);
var
  empty: char;
  i: integer;
  pc: char;
  x,y: byte;
begin
  if (col='White') then empty:='.' else empty:=':';
  i:=1;
  while (i<=length(s)) do
    begin
      if (s[i]>='A') and (s[i]<='Z') then
        begin
	  if (col='White') then pc:=s[i] else pc:=chr(ord(s[i])+32);
	  x:=ord(s[i+1])-ord('a')+1;
 	  y:=ord(s[i+2])-ord('0');
	  i:=i+4;
	end else 
	    begin
	     if (Col='White') then pc:='P' else pc:='p';
	     x:=ord(s[i])-ord('a')+1;
	     y:=ord(s[i+1])-ord('0');
	     i:=i+3;
	    end;
      chess[x,y]:=pc;
      { writeln('adding [',x,',',y,'] as ', pc); }
    end; 
end;

procedure view;
var
  i,j: integer;
  e: char;
begin
  Writeln('+---+---+---+---+---+---+---+---+');
  for i:=1 to 8 do 
    begin
     Write('|');
     for j:=1 to 8 do 
       begin
         if (i+j) mod 2 = 0 then e:='.' else e:=':';
	 write(e); 
	 if (chess[j,9-i]='.') then chess[j,9-i]:=e;
	 write(chess[j,9-i]); 
	 write(e); 
	 write('|');
       end;
     writeln;
     Writeln('+---+---+---+---+---+---+---+---+');
    end;
end;

begin
  { white }
  for i:=1 to 8 do for j:=1 to 8 do chess[i,j]:='.';
  
  for i:=1 to 2 do 
    begin
      readln(S);
      col:=copy(s,1,5);
      S:=copy(s, 8, length(s)-6);
      draw(s, col);
    end;
   view;
end.      