eolymp
bolt
Try our new interface for solving problems
Problems

The task of the employer

The task of the employer

\includegraphics{https://static.e-olymp.com/content/9c/9c54abb8597ce3e58948f39fa7e11f6601955e7e.jpg} Every boss wants to have at his disposal only the best people. Therefore, to give a job he personally evaluates intelligence of each, not trusting the content of the diploma. Here is one of the classical problems in these interviews: "\textit{The} \textbf{8}×\textbf{8} \textit{checkerboard cut two cells in opposite corners (lower left and upper right or upper left and lower right). Is it possible to tile completely the rest of the board by dominoes, with size of} \textbf{1}×\textbf{2} \textit{cells?}". At first glance it seems that it is \textit{possible}, since the number of remaining cells even (\textbf{64-2 = 62}), but if you look closely, you will notice that each dominoes covers one white and one black cell (regardless of how we placed it on the board). And in opposite corners of the cells are always the same colors, so that some dominoes were not enough, then the correct answer - it is \textit{impossible}. Now the bosses are smarter. They cut all, they like the cells, leaving the same question: "\textit{Is it possible to completely cover the rest of the board by dominoes?}". \InputFile The first line contains the number of test cases (\textbf{1} ≤ \textbf{t} ≤ \textbf{10}). Each test case contains a map board \textbf{8}×\textbf{8} characters. If the cell is cut, it is denoted by a cross "\textbf{X}", if free, - the point. "\textbf{.}". Adjacent maps are separated by a blank line. \OutputFile For each test case on a separate line, output "\textbf{YES}", if this board can be tiled by dominoes, and "\textbf{NO}" otherwise.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1
.......X
........
........
........
........
........
........
X.......
Output example #1
NO