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.
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.
3 X.X .O. ... O.X .O. X.. X.X .X. ...
YES X.X OOO ... YES O.X .O. XOO NO
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.