#include #include #include using namespace std; map< int, map< int, char > > board; int main(void) { char tmp[100], c1, c2, c3; int i, j; bool b; for( i = 0; i < 2; i++ ) { cin >> tmp; while( 1 ) { c1 = cin.get(); if( c1 == '\n' ) break; if( c1 == ',' ) cin >> c1; if( c1 == ' ' ) cin >> c1; if( c1 >= 'a' && c1 <= 'z' ) { c2 = c1; cin >> c3; c1 = 'P'; } else { cin >> c2 >> c3; } if( strcmp( tmp, "White:" ) != 0 ) c1 = tolower( c1 ); board[c2 - 'a' + 1][c3 - '0'] = c1; } } b = true; for( i = 8; i >= 1; i-- ) { cout << "+---+---+---+---+---+---+---+---+" << endl; for( j = 1; j <= 8; j++ ) { cout << '|'; if( b ) cout << '.'; else cout << ':'; if( board[j][i] != 0 ) cout << board[j][i]; else if( b ) cout << '.'; else cout << ':'; if( b ) cout << '.'; else cout << ':'; b = !b; } cout << '|' << endl; b = !b; } cout << "+---+---+---+---+---+---+---+---+" << endl; return 0; }