human
A boy Petya loves chess very much. He even came up with a chess piece of his own, a semiknight. The semiknight can move in any of these four directions: 2 squares forward and 2 squares to the right, 2 squares forward and 2 squares to the left, 2 squares backward and 2 to the right and 2 squares backward and 2 to the left. Naturally, the semiknight cannot move beyond the limits of the chessboard.

Petya put two semiknights on a standard chessboard. Petya simultaneously moves with both semiknights. The squares are rather large, so after some move the semiknights can meet, that is, they can end up in the same square. After the meeting the semiknights can move on, so it is possible that they meet again. Petya wonders if there is such sequence of moves when the semiknights meet. Petya considers some squares bad. That is, they do not suit for the meeting. The semiknights can move through these squares but their meetings in these squares don't count.

Petya prepared multiple chess boards. Help Petya find out whether the semiknights can meet on some good square for each board.

Please see the test case analysis.

Input

The first line contains number t (1 ≤ t ≤ 50) — the number of boards. Each board is described by a matrix of characters, consisting of 8 rows and 8 columns. The matrix consists of characters ".", "#", "K", representing an empty good square, a bad square and the semiknight's position, correspondingly. It is guaranteed that matrix contains exactly 2 semiknights. The semiknight's squares are considered good for the meeting. The tests are separated by empty line.

Output

For each test, print on a single line the answer to the problem: "YES", if the semiknights can meet and "NO" otherwise.

Examples

Input

2
........
........
......#.
K..##..#
.......#
...##..#
......#.
K.......

........
........
..#.....
..#..#..
..####..
...##...
........
....K#K#

Output

YES
NO

Note

Consider the first board from the sample. We will assume the rows and columns of the matrix to be numbered 1 through 8 from top to...

=====
Write me a Python program to find out whether the semiknights can meet on some good square for each board?
assistant
#Here is Python program to find out whether the semiknights can meet on some good square for each board.

import sys, math
def rs():
    return sys.stdin.readline().strip()
def ri():
    return int(sys.stdin.readline().strip())
def ras():
    return list(sys.stdin.readline().strip())
def rai():
    return map(int,sys.stdin.readline().strip().split())

def solve():
    arr = []
    horses = []
    for x in xrange(8):
        ss = ras()
        arr.append(ss)
        for y in xrange(8):
            if ss[y] is "K":
                horses.append((x,y))

    def points(p, arr):
        mas = lambda x,y: [(x,y), (x-4,y), (x+4,y),(x,y-4), (x-4,y-4), (x+4,y-4),(x,y+4), (x-4,y+4), (x+4,y+4)]
        x,y = p
        res = []

        for t in mas(x,y):
            x1,y1 = t
            while x1 < 8:
                x1 += 2
                while y1 < 8:
                    y1 += 2
                    res = res + mas(x1,y1)
                while y1 >= 0:
                    y1 -= 2
                    res = res + mas(x1,y1)
            while x1 >= 0:
                x1 -= 2
                while y1 < 8:
                    y1 += 2
                    res = res + mas(x1,y1)
                while y1 >= 0:
                    y1 -= 2
                    res = res + mas(x1,y1)

        result = []

        for x in res:
            if x[0] >= 0 and x[0] < 8 and x[1] >= 0 and x[1] < 8 and arr[x[0]][x[1]] is not "#":
                result.append(x)
        return result

    if abs(horses[0][0] - horses[1][0]) % 4 is 0 and  abs(horses[0][1] - horses[1][1]) % 4 is 0 and len(points(horses[0], arr)) > 0:
#    if abs(horses[0][0] - horses[1][0]) % 4 is 0 and  abs(horses[0][1] - horses[1][1]) % 4 is 0:
        return "YES"
    
    return "NO"



def main():
    t = ri()

    for x in xrange(t):
        print solve()
        rs()


main()