K. King of Tic-Tac-Toe
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Nobita is in trouble again! He made a bet with the neighborhood bully, Gian, that he could win a game of Tic-Tac-Toe. Of course, Gian didn't play fair, and the board is now in a very strange state. The number of marks for each player might not be what you'd expect from a normal game. With Gian about to claim victory, Nobita starts to cry for help.

From his pocket, Doraemon pulls out a futuristic gadget: the "Double-Step Stopwatch!" This incredible device can bend time, allowing Nobita a single, golden opportunity: he gets to make two consecutive moves for 'O'. After Nobita uses his special double-move, the game ends immediately. If there are three 'O's in the same row, column, or diagonal of the board, Nobita wins.

You are Nobita's trusted friend, here to help him analyze the board. Doraemon guarantees that the board has at least two empty cells and that neither side has already won.

Given a 3x3 Tic-Tac-Toe board, you must help Nobita determine if it is possible to win after using the Double-Step Stopwatch. If Nobita can make two moves that result in an immediate win, show him the winning board. This means he gets to enjoy a victory feast of dorayaki! Otherwise, report that it is impossible to win.

If multiple winning moves exist, any of them is an acceptable answer.

Input

The input will consist of an integer $$$t$$$ ($$$1 \le t \le 1,000$$$) on the first line, indicating the number of test cases. For each test case, there are 3 lines, each containing 3 characters, representing the Tic-Tac-Toe board.

  • 'X' represents a cell occupied by Gian.
  • 'O' represents a cell occupied by Nobita.
  • '.' represents an empty cell.
Output
  • If a win is possible for Nobita ('O'), print the word YES on the first line, followed by the 3x3 board state after the two winning moves on the next three lines.
  • If a win is not possible, print the single word NO.
Example
Input
3
X.X
.O.
...
O.X
.O.
X..
X.X
.X.
...
Output
YES
X.X
OOO
...
YES
O.X
.O.
XOO
NO
Note

In the first test case, Nobita places 'O' at cell (2,1) and (2,3), winning the game on the spot.

In the second test case, Nobita places 'O' at cell (3,2) and (3,3), winning the game on the spot.