#include #include using namespace std; void printseparator() { cout << "+---+---+---+---+---+---+---+---+" << endl; } void printwhitecell(char c) { cout << "|." << ((c==0)?'.':c) << "."; } void printblackcell(char c) { cout << "|:" << ((c==0)?':':c) << ":"; } void printendl() { cout << "|" << endl; } char pole[8][8]; int main(void) { string line; cin >> line; cin >> line; unsigned int pos = 0; while (pos < line.length()) { char t; int c; int n; char x = line[pos]; if (x < 'a') { t = x; c = line[pos+1] - 'a'; n = line[pos+2] - '1'; pos = pos + 4; } else { t = 'P'; c = x - 'a'; n = line[pos+1] - '1'; pos = pos + 3; } pole[c][n] = t; } cin >> line; cin >> line; pos = 0; while (pos < line.length()) { char t; int c; int n; char x = line[pos]; if (x < 'a') { t = x-'A'+'a'; c = line[pos+1] - 'a'; n = line[pos+2] - '1'; pos = pos + 4; } else { t = 'p'; c = x - 'a'; n = line[pos+1] - '1'; pos = pos + 3; } pole[c][n] = t; } for (signed int i = 7; i >= 0; i--) { printseparator(); for (int j = 0; j < 8; j++) { if ((j+i)%2 == 0) { printblackcell(pole[j][i]); } else { printwhitecell(pole[j][i]); } } printendl(); } printseparator(); }