Batman has defeated Hugo Strange and now he is getting bored as there is too much peace in Gotham City.
To pass his time he used to play 4 X 4 field Tick-Tac-Toe. One Day While playing, Commissioner Gordan Called Batman and he had to leave immediately so he didnt finish the game. It was Batman's turn in the game when they left it. Find Out whether Batman could have won the game by making a single turn or not.
The rules of tic-tac-toe are as follows.
Before the first turn all the field cells are empty. The two players take turns placing their signs into empty cells (the first player places Xs, the second player places Os). The player who places Xs goes first, the another one goes second. The winner is the player who first gets three of his signs in a row next to each other (horizontal, vertical or diagonal).
The first line of each test case defines the number of test cases t. then the next 4 line t times gives the tic-tac-toe positions Each of these lines contains four characters. Each character is '.' (empty cell), 'x' (lowercase English letter x), or 'o' (lowercase English letter o). It is guaranteed that the position is reachable playing tic-tac-toe, and it is Batman's turn now (in particular, it means that the game is not finished). It is possible that all the cells are empty, it means that the Both Batman and Robin left without making single turn.
Print single line: "YES" in case Batman could have won by making single turn, and "NO" otherwise.
In the first example of the 3 test cases Batman had two winning moves: to the empty cell in the left column and to the leftmost empty cell in the first row.
In the second It wasn't possible to win by making single turn
In the Third Batman could have won by placing X in the last row between two existing Xs.