2013
11-12

# Emag eht htiw Em Pleh

This problem is a reverse case of the problem 2996. You are given the output of the problem H and your task is to find the corresponding input.

according to output of problem 2996.

according to input of problem 2996.

White: Ke1,Qd1,Ra1,Rh1,Bc1,Bf1,Nb1,a2,c2,d2,f2,g2,h2,a3,e4
Black: Ke8,Qd8,Ra8,Rh8,Bc8,Ng8,Nc6,a7,b7,c7,d7,e7,f7,h7,h6

+---+---+---+---+---+---+---+---+
|.r.|:::|.b.|:q:|.k.|:::|.n.|:r:|
+---+---+---+---+---+---+---+---+
|:p:|.p.|:p:|.p.|:p:|.p.|:::|.p.|
+---+---+---+---+---+---+---+---+
|...|:::|.n.|:::|...|:::|...|:p:|
+---+---+---+---+---+---+---+---+
|:::|...|:::|...|:::|...|:::|...|
+---+---+---+---+---+---+---+---+
|...|:::|...|:::|.P.|:::|...|:::|
+---+---+---+---+---+---+---+---+
|:P:|...|:::|...|:::|...|:::|...|
+---+---+---+---+---+---+---+---+
|.P.|:::|.P.|:P:|...|:P:|.P.|:P:|
+---+---+---+---+---+---+---+---+
|:R:|.N.|:B:|.Q.|:K:|.B.|:::|.R.|
+---+---+---+---+---+---+---+---+

//* @author: [email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-cfhash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-cfemail')){for(e='',r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2)e+='%'+('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner in=new Scanner(System.in);
char[][] arr=new char[8][8];
String s1=in.nextLine();
s1=s1.substring(7);
String[] ws=s1.split(",");
for(int i=0;i< ws.length;i++)
{
if(ws[i].length()==3)
{
int x=8-ws[i].charAt(2)+'0';
int y=ws[i].charAt(1)-'a';
arr[x][y]=ws[i].charAt(0);
}
else if(ws[i].length()==2)
{
int x=8-ws[i].charAt(1)+'0';
int y=ws[i].charAt(0)-'a';
arr[x][y]='P';
}
}
String s2=in.nextLine();
s2=s2.substring(7);
String[] bs=s2.split(",");
for(int i=0;i< bs.length;i++)
{
if(bs[i].length()==3)
{
int x=8-bs[i].charAt(2)+'0';
int y=bs[i].charAt(1)-'a';
arr[x][y]=(char)(bs[i].charAt(0)+32);
}
else if(bs[i].length()==2)
{
int x=8-bs[i].charAt(1)+'0';
int y=bs[i].charAt(0)-'a';
arr[x][y]='p';
}
}
for(int i=0;i< 8;i++)
{
System.out.println("+---+---+---+---+---+---+---+---+");
for(int j=0;j< 8;j++)
{
if(arr[i][j]==0)
{
if((i+j)%2==0)System.out.print("|...");
else System.out.print("|:::");
}
else
{
if((i+j)%2==0)System.out.print("|."+arr[i][j]+".");
else System.out.print("|:"+arr[i][j]+":");
}
}
System.out.println("|");
}
System.out.println("+---+---+---+---+---+---+---+---+");
}
}