F. Jenga Game
time limit per test
1 second
memory limit per test
1024 mebibytes
input
standard input
output
standard output

Yesyes and Nono are playing the Jenga game. Jenga has the following rules:

There is a tower consisting of $$$n$$$ layers of blocks. Each layer consists of three long blocks. The blocks in each layer lie parallel to each other. The blocks in two neighboring layers are perpendicular to each other. Some blocks might be missing at the start of the game. Two players make their moves alternately. During one move a player must choose a block and remove it from the tower if it remains stable afterward. The tower is stable if all the following conditions are met:

  • Each layer contains at least one block.
  • If a layer contains exactly one block, it's the middle one.
  • The top layer consists of three blocks.

A player who is unable to make any move loses. Given the starting state of the tower, possibly with some blocks already removed. It is always guaranteed that the initial state of the given Jenga tower is stable. Your task is to determine which player will win. Both players always use the best strategy to win against each other. Yesyes plays first. Yesyes and Nono are experts at Jenga, so they don't make any mistakes while removing a block.

Notice that in this version of Jenga, players do not put the blocks on the top of the tower.

Input

The first line of input contains the number of test cases $$$T$$$.

The first line of input for each test case contains the initial height of the Jenga tower $$$N$$$.

Each of the next $$$N$$$ lines contains the initial state of each layer as a string of length 3 consisting of $$$\texttt{0}$$$s and $$$\texttt{1}$$$s, starting from the top layer. $$$\texttt{0}$$$ means that there is no block at that position and $$$\texttt{1}$$$ means there is a block at that position. It is always guaranteed that the initial state of the given Jenga tower is stable.

Output

Print the winner in one line for each test case.

Scoring
  • $$$1 \le T \le 1\,000$$$
  • $$$2 \le N \le 400\,000$$$
  • The sum of $$$N$$$ across all test cases does not exceed $$$400\,000$$$.
Example
Input
2
6
111
101
010
111
110
111
2
111
101
Output
Yesyes
Nono