Minesweeper is played on an $n \times n$ grid. $m$ mines are hidden, one per cell, on distinct cells.
The player repeatedly picks a cell and opens it.
The player wins by opening every safe cell until only the $m$ mined cells remain unopened. Those remaining $m$ cells must all be mines.
Your task is to read the state of a partially played game and print the corresponding current state of the grid.
The first line contains a positive integer $n$, the size of the grid ($1 \le n \le 10$).
The next $n$ lines describe the mine layout. Each line represents one row using $n$ characters: a period (.) is a cell with no mine, and an asterisk (*) is a cell with a mine.
The following $n$ lines each contain a string of length $n$ describing which cells have been opened. A lowercase x marks an already-opened cell, and a period (.) marks a cell that has not been opened.
Print the current state of the grid on $n$ lines.
*)..).