import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public static final int[] dx = {2, 2, -2, -2};
    public static final int[] dy = {-2, 2, -2, 2};

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int t = in.nextInt();
        while (t-- > 0) {
            boolean[][] used1 = new boolean[8][8];
            boolean[][] used2 = new boolean[8][8];
            char[][] map = new char[8][8];
            for (int i = 0; i < 8; ++i)
                map[i] = in.next().toCharArray();

            int first_i = -1;
            int first_j = -1;
            for (int i = 0; i < 8; ++i)
                for (int j = 0; j < 8; ++j)
                    if (map[i][j] == 'K') {
                        first_i = i;
                        first_j = j;
                        break;
                    }

            int second_i = -1;
            int second_j = -1;
            for (int i = 7; i >= 0; --i)
                for (int j = 7; j >= 0; --j)
                    if (map[i][j] == 'K') {
                        second_i = i;
                        second_j = j;
                        break;
                    }

            doSteps(used1, first_i, first_j);
            doSteps(used2, second_i, second_j);

            boolean ans = false;
            for (int i = 0; i < 8; ++i)
                for (int j = 0; j < 8; ++j)
                    if (used1[i][j] && used2[i][j] && map[i][j] == '.') {
                        ans = true;
                        break;
                    }

            if (ans) out.println("YES");
            else out.println("NO");
        }
    }

    private void doSteps(boolean[][] used, int x, int y) {
        used[x][y] = true;
        for (int i = 0; i < 4; ++i) {
            int newX = x + dx[i];
            int newY = y + dy[i];
            if (goodCeil(newX, newY) && !used[newX][newY])
                doSteps(used, newX, newY);
        }
    }

    private boolean goodCeil(int x, int y) {
        return x >= 0 && x < 8 && y >= 0 && y < 8;
    }
}

class InputReader {
    BufferedReader in;
    StringTokenizer st;

    public InputReader(InputStream stream) {
        in = new BufferedReader(new InputStreamReader(stream));
        eat("");
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public String next() {
        while (!st.hasMoreTokens())
            eat(nextLine());
        return st.nextToken();
    }

    public String nextLine() {
        try {
            return in.readLine();
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public void eat(String str) {
        if (str == null) throw new InputMismatchException();
        st = new StringTokenizer(str);
    }
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public static final int[] dx = {2, 2, -2, -2};
    public static final int[] dy = {-2, 2, -2, 2};

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int t = in.nextInt();
        while (t-- > 0) {
            boolean[][] used1 = new boolean[8][8];
            boolean[][] used2 = new boolean[8][8];
            char[][] map = new char[8][8];
            for (int i = 0; i < 8; ++i)
                map[i] = in.next().toCharArray();

            int first_x = -1;
            int first_y = -1;
            for (int i = 0; i < 8; ++i)
                for (int j = 0; j < 8; ++j)
                    if (map[i][j] == 'K') {
                        first_x = i;
                        first_y = j;
                        break;
                    }
            int second_x = -1;
            int second_y = -1;
            for (int i = 7; i >= 0; --i)
                for (int j = 7; j >= 0; --j)
                    if (map[i][j] == 'K') {
                        second_x = i;
                        second_y = j;
                        break;
                    }

            doSteps(used1, first_x, first_y);
            doSteps(used2, second_x, second_y);

            boolean ans = false;
            for (int i = 0; i < 4; ++i) {
                int nX = first_x + dx[i];
                int nY = first_y + dy[i];
                if (goodCeil(nX, nY)) {
                    for (int j = 0; j < 4; ++j) {
                        int nX1 = second_x + dx[j];
                        int nY1 = second_y + dy[j];
                        if (goodCeil(nX1, nY1) && nX == nX1 && nY == nY1)
                            ans = true;
                    }
                }
            }

            if (ans) {
                ans = false;
                for (int i = 0; i < 8; ++i)
                    for (int j = 0; j < 8; ++j)
                        if (used1[i][j] && map[i][j] == '.') {
                            ans = true;
                            break;
                        }
            }

            if (ans) out.println("YES");
            else out.println("NO");
        }
    }

    private void doSteps(boolean[][] used, int x, int y) {
        used[x][y] = true;
        for (int i = 0; i < 4; ++i) {
            int newX = x + dx[i];
            int newY = y + dy[i];
            if (goodCeil(newX, newY) && !used[newX][newY])
                doSteps(used, newX, newY);
        }
    }

    private boolean goodCeil(int x, int y) {
        return x >= 0 && x < 8 && y >= 0 && y < 8;
    }
}

class InputReader {
    BufferedReader in;
    StringTokenizer st;

    public InputReader(InputStream stream) {
        in = new BufferedReader(new InputStreamReader(stream));
        eat("");
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public String next() {
        while (!st.hasMoreTokens())
            eat(nextLine());
        return st.nextToken();
    }

    public String nextLine() {
        try {
            return in.readLine();
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public void eat(String str) {
        if (str == null) throw new InputMismatchException();
        st = new StringTokenizer(str);
    }
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public static final int[] dx = {2, 2, -2, -2};
    public static final int[] dy = {-2, 2, -2, 2};

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int t = in.nextInt();
        while (t-- > 0) {
            boolean[][] used1 = new boolean[8][8];
            boolean[][] used2 = new boolean[8][8];
            char[][] map = new char[8][8];
            for (int i = 0; i < 8; ++i)
                map[i] = in.next().toCharArray();

            int first_x = -1;
            int first_y = -1;
            for (int i = 0; i < 8; ++i)
                for (int j = 0; j < 8; ++j)
                    if (map[i][j] == 'K') {
                        first_x = i;
                        first_y = j;
                        break;
                    }
            int second_x = -1;
            int second_y = -1;
            for (int i = 7; i >= 0; --i)
                for (int j = 7; j >= 0; --j)
                    if (map[i][j] == 'K') {
                        second_x = i;
                        second_y = j;
                        break;
                    }

            boolean ans = false;
            for (int i = 0; i < 4; ++i) {
                int nX = first_x + dx[i];
                int nY = first_y + dy[i];
                if (goodCeil(nX, nY)) {
                    for (int j = 0; j < 4; ++j) {
                        int nX1 = second_x + dx[j];
                        int nY1 = second_y + dy[j];
                        if (goodCeil(nX1, nY1) && nX == nX1 && nY == nY1)
                            ans = true;
                    }
                }
            }

            if (ans) out.println("YES");
            else out.println("NO");
        }
    }

    private boolean goodCeil(int x, int y) {
        return x >= 0 && x < 8 && y >= 0 && y < 8;
    }
}

class InputReader {
    BufferedReader in;
    StringTokenizer st;

    public InputReader(InputStream stream) {
        in = new BufferedReader(new InputStreamReader(stream));
        eat("");
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public String next() {
        while (!st.hasMoreTokens())
            eat(nextLine());
        return st.nextToken();
    }

    public String nextLine() {
        try {
            return in.readLine();
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public void eat(String str) {
        if (str == null) throw new InputMismatchException();
        st = new StringTokenizer(str);
    }
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public static final int[] dx = {2, 2, -2, -2};
    public static final int[] dy = {-2, 2, -2, 2};

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int t = in.nextInt();
        while (t-- > 0) {
            boolean[][] used1 = new boolean[8][8];
            boolean[][] used2 = new boolean[8][8];
            char[][] map = new char[8][8];
            for (int i = 0; i < 8; ++i)
                map[i] = in.next().toCharArray();

            int first_i = -1;
            int first_j = -1;
            for (int i = 0; i < 8; ++i)
                for (int j = 0; j < 8; ++j)
                    if (map[i][j] == 'K') {
                        first_i = i;
                        first_j = j;
                        break;
                    }

            int second_i = -1;
            int second_j = -1;
            for (int i = 7; i >= 0; --i)
                for (int j = 7; j >= 0; --j)
                    if (map[i][j] == 'K') {
                        second_i = i;
                        second_j = j;
                        break;
                    }

            doSteps(used1, first_i, first_j);
            doSteps(used2, second_i, second_j);

//            for (int i = 0; i < 8; ++i)  {
//                for (int j = 0; j < 8; ++j)
//                    out.print(used1[i][j] ? 1 : 0);
//                out.println();
//            }
//            for (int i = 0; i < 8; ++i)  {
//                for (int j = 0; j < 8; ++j)
//                 out.print(used2[i][j] ? 1 : 0);
//                out.println();
//            }

            boolean ans = false;
            for (int i = 0; i < 8; ++i)
                for (int j = 0; j < 8; ++j)
                    if (used1[i][j] && used2[i][j] && map[i][j] == '.') {
                        ans = true;
                        break;
                    }

            if (ans) {
                ans = false;
                for (int i = 0; i < 4; ++i) {
                    int nX = first_i + dx[i];
                    int nY = first_j + dy[i];
                    if (goodCeil(nX, nY)) {
                        for (int j = 0; j < 4; ++j) {
                            int nX1 = second_i + dx[j];
                            int nY1 = second_j + dy[j];
                            if (goodCeil(nX1, nY1) && nX == nX1 && nY == nY1)
                                ans = true;
                        }
                    }
                }
            }

            if (ans) out.println("YES");
            else out.println("NO");
        }
    }

    private void doSteps(boolean[][] used, int x, int y) {
        used[x][y] = true;
        for (int i = 0; i < 4; ++i) {
            int newX = x + dx[i];
            int newY = y + dy[i];
            if (goodCeil(newX, newY) && !used[newX][newY])
                doSteps(used, newX, newY);
        }
    }

    private boolean goodCeil(int x, int y) {
        return x >= 0 && x < 8 && y >= 0 && y < 8;
    }
}

class InputReader {
    BufferedReader in;
    StringTokenizer st;

    public InputReader(InputStream stream) {
        in = new BufferedReader(new InputStreamReader(stream));
        eat("");
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public String next() {
        while (!st.hasMoreTokens())
            eat(nextLine());
        return st.nextToken();
    }

    public String nextLine() {
        try {
            return in.readLine();
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public void eat(String str) {
        if (str == null) throw new InputMismatchException();
        st = new StringTokenizer(str);
    }
}


import java.util.*;
public class CFA_212 {
	static boolean[][] board = new boolean[8][8];
	static int[][] ke1 = new int[8][8];
	static int index=0;
	static int[][] kk = new int[2][2];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t  = sc.nextInt();
		for (int i = 0; i < t; i++) {

			for (int j = 0; j < 8; j++) {
				char[] in = sc.next().toCharArray();
				for (int k = 0; k < 8; k++) {
					if(in[k]=='K')
					{
						if(index==0)
						{
							kk[0][0] = j;
							kk[0][1] = k;
						}
						else
						{

							kk[1][0] = j;
							kk[1][1] = k;
						}
						index++;
					}
					else if(in[k]=='#')
					{
						board[j][k]=true;
					}
				}
			}
			check(kk[0][0],kk[0][1]);
			if(sol())
				System.out.println("YES");
			else
				System.out.println("NO");
			ke1 = new int[8][8];
			board = new boolean[8][8];
		}
	}

	public static void check(int x,int y)
	{
		if(x>7||x<0||y<0||y>7) return ;
		if(ke1[x][y]!=0) return ;
		ke1[x][y]=1;
		check(x+2,y+2);
		check(x+2,y-2);
		check(x-2,y+2);
		check(x-2,y-2);
	}

	public static boolean sol()
	{
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				if(ke1[i][j]!=0&&!board[i][j]&&i==kk[1][0]&&j==kk[1][1]) return true;
			}
		}

		return false;
	}

	public int GCD(int a, int b)
	{
	   if (b==0) return a;
	   return GCD(b,a%b);
	}

	public int LCM(int a, int b)
	{
	   return b*a/GCD(a,b);
	}
}


import java.util.*;
public class CFA_212 {
	static boolean[][] board = new boolean[8][8];
	static boolean[][][][] ex = new boolean[8][8][8][8];
	static int[][] ke1 = new int[8][8];
	static int[][] ke2 = new int[8][8];
	static int index=0;
	static int[][] kk = new int[2][2];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t  = sc.nextInt();
		for (int i = 0; i < t; i++) {
			index =0;
			for (int j = 0; j < 8; j++) {
				char[] in = sc.next().toCharArray();
				for (int k = 0; k < 8; k++) {
					if(in[k]=='K')
					{
						if(index==0)
						{
							kk[0][0] = j;
							kk[0][1] = k;
						}
						else if(index==1)
						{

							kk[1][0] = j;
							kk[1][1] = k;
						}
						index++;
					}
					else if(in[k]=='#')
					{
						board[j][k]=true;
					}
				}
			}

			if(check(kk[0][0],kk[0][1],kk[1][0],kk[1][1],0))
				System.out.println("YES");
			else
				System.out.println("NO");
			ke1 = new int[8][8];
			ke2 = new int[8][8];
			board = new boolean[8][8];
			ex = new boolean[8][8][8][8];
		}
	}
	public static boolean check(int x,int y,int x1,int y1, int z)
	{
		if(x>7||x<0||y<0||y>7||x1<0||x1>7||y1<0||y1>7) return false;
		if(ex[x][y][x1][y1]) return false;
		ex[x][y][x1][y1]=true;
		if(z==0)
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;

			if(check(x+2,y+2,x1,y1,1)) return true;
			if(check(x+2,y-2,x1,y1,1)) return true;
			if(check(x-2,y+2,x1,y1,1)) return true;
			if(check(x-2,y-2,x1,y1,1)) return true;
			return false;
		}
		else
		{
//			if(x==x1&&y==y1&&!board[x][y]) return true;
			if(check(x,y,x1+2,y1+2,0)) return true;
			if(check(x,y,x1+2,y1-2,0)) return true;
			if(check(x,y,x1-2,y1+2,0)) return true;
			if(check(x,y,x1-2,y1-2,0)) return true;
		}
		return false;
	}

}


import java.util.*;
public class CFA_212 {
	static boolean[][] board = new boolean[8][8];
	static boolean[][][][] ex = new boolean[8][8][8][8];
	static int[][] ke1 = new int[8][8];
	static int[][] ke2 = new int[8][8];
	static int index=0;
	static int[][] kk = new int[2][2];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t  = sc.nextInt();
		for (int i = 0; i < t; i++) {
			index =0;
			for (int j = 0; j < 8; j++) {
				char[] in = sc.next().toCharArray();
				for (int k = 0; k < 8; k++) {
					if(in[k]=='K')
					{
						if(index==0)
						{
							kk[0][0] = j;
							kk[0][1] = k;
						}
						else if(index==1)
						{

							kk[1][0] = j;
							kk[1][1] = k;
						}
						index++;
					}
					else if(in[k]=='#')
					{
						board[j][k]=true;
					}
				}
			}
			int kz =Math.abs(kk[0][0]-kk[1][0]);
			int kzz = Math.abs(kk[0][1]-kk[1][1]);

			if(!(kz==kzz|(kzz==4&&kz==0)|(kz==4&&kzz==0)))
			{
					System.out.println("NO");
					continue;
			}

			if(check(kk[0][0],kk[0][1],kk[1][0],kk[1][1],0))
				System.out.println("YES");
			else
				System.out.println("NO");

			ke1 = new int[8][8];
			ke2 = new int[8][8];
			board = new boolean[8][8];
			ex = new boolean[8][8][8][8];
		}
	}

	public static boolean check(int x,int y,int x1,int y1, int z)
	{
		if(x>7||x<0||y<0||y>7||x1<0||x1>7||y1<0||y1>7) return false;
		if(ex[x][y][x1][y1]) return false;
		ex[x][y][x1][y1]=true;
		if(z==0)
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;

			if(check(x+2,y+2,x1,y1,1)) return true;
			if(check(x+2,y-2,x1,y1,1)) return true;
			if(check(x-2,y+2,x1,y1,1)) return true;
			if(check(x-2,y-2,x1,y1,1)) return true;
			return false;
		}
		else
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;
			if(check(x,y,x1+2,y1+2,0)) return true;
			if(check(x,y,x1+2,y1-2,0)) return true;
			if(check(x,y,x1-2,y1+2,0)) return true;
			if(check(x,y,x1-2,y1-2,0)) return true;
		}
		return false;
	}

}


import java.util.*;
public class CFA_212 {
	static boolean[][] board = new boolean[8][8];
	static int[][] ke1 = new int[8][8];
	static int[][] ke2 = new int[8][8];
	static int index=0;
	static int[][] kk = new int[2][2];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t  = sc.nextInt();
		for (int i = 0; i < t; i++) {
			index =0;
			for (int j = 0; j < 8; j++) {
				char[] in = sc.next().toCharArray();
				for (int k = 0; k < 8; k++) {
					if(in[k]=='K')
					{
						if(index==0)
						{
							kk[0][0] = j;
							kk[0][1] = k;
						}
						else if(index==1)
						{

							kk[1][0] = j;
							kk[1][1] = k;
						}
						index++;
					}
					else if(in[k]=='#')
					{
						board[j][k]=true;
					}
				}
			}

//			check(kk[0][0],kk[0][1]);
//			check2(kk[1][0],kk[1][1]);
//			System.out.println(kk[1][0]+" "+kk[1][1]);
//			System.out.println(kk[0][0]+" "+kk[0][1]);
			int kz =Math.abs(kk[0][0]-kk[1][0]);
			int kzz = Math.abs(kk[1][1]-kk[1][1]);

			if(((kz%2==0&&kzz%2==0)))
			{
				if((kz==0&&kzz<4)|(kzz==0&&kz<4))
				{
					System.out.println("NO");
					continue;
				}
			}

			if(check(kk[0][0],kk[0][1],kk[1][0],kk[1][1],0))
				System.out.println("YES");
			else
				System.out.println("NO");

//			for (int j = 0; j < 8; j++) {
//				for (int j2 = 0; j2 < 8; j2++) {
//					System.out.print(ke1[j][j2]);
//				}
//				System.out.println();
//			}
//			System.out.println();
//			for (int j = 0; j < 8; j++) {
//				for (int j2 = 0; j2 < 8; j2++) {
//					System.out.print(ke2[j][j2]);
//				}
//				System.out.println();
//			}
			ke1 = new int[8][8];
			ke2 = new int[8][8];
			board = new boolean[8][8];
		}
	}

	public static boolean check(int x,int y,int x1,int y1, int z)
	{
//		System.out.println(x+" "+y+" "+x1+" "+y1+" "+z);
		if(x>7||x<0||y<0||y>7||x1<0||x1>7||y1<0||y1>7) return false;
		if(z==0)
		{
//			if(ke2[x][y]==1&&!board[x][y]) return true;
			if(x==x1&&y==y1&&!board[x][y]) return true;
//			ke1[x][y]=1;

			if(check(x+2,y+2,x1,y1,1)) return true;
			if(check(x+2,y-2,x1,y1,1)) return true;
			if(check(x-2,y+2,x1,y1,1)) return true;
			if(check(x-2,y-2,x1,y1,1)) return true;

			ke1[x][y]=0;

		}
		else
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;
//			if(ke1[x][y]==1&&!board[x][y]) return true;
			ke2[x1][y1]=1;
			if(check(x,y,x1+2,y1+2,0)) return true;
			if(check(x,y,x1+2,y1-2,0)) return true;
			if(check(x,y,x1-2,y1+2,0)) return true;
			if(check(x,y,x1-2,y1-2,0)) return true;
//			check(x+2,y-2,x1,y1,0);
//			check(x-2,y+2,x1,y1,0);
//			check(x-2,y-2,x1,y1,0);
		}
		return false;
	}

	public static void check2(int x,int y)
	{
		if(x>7||x<0||y<0||y>7) return ;
		if(ke2[x][y]!=0) return ;
		ke2[x][y]=1;
		check2(x+2,y+2);
		check2(x+2,y-2);
		check2(x-2,y+2);
		check2(x-2,y-2);
	}

	public static boolean sol()
	{
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				if(ke1[i][j]!=0&&ke2[i][j]!=0&&!board[i][j]) return true;
			}
		}
		return false;
	}

	public int GCD(int a, int b)
	{
	   if (b==0) return a;
	   return GCD(b,a%b);
	}

	public int LCM(int a, int b)
	{
	   return b*a/GCD(a,b);
	}
}


import java.util.*;
public class CFA_212 {
	static boolean[][] board = new boolean[8][8];
	static int[][] ke1 = new int[8][8];
	static int[][] ke2 = new int[8][8];
	static int index=0;
	static int[][] kk = new int[2][2];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t  = sc.nextInt();
		for (int i = 0; i < t; i++) {
			index =0;
			for (int j = 0; j < 8; j++) {
				char[] in = sc.next().toCharArray();
				for (int k = 0; k < 8; k++) {
					if(in[k]=='K')
					{
						if(index==0)
						{
							kk[0][0] = j;
							kk[0][1] = k;
						}
						else if(index==1)
						{

							kk[1][0] = j;
							kk[1][1] = k;
						}
						index++;
					}
					else if(in[k]=='#')
					{
						board[j][k]=true;
					}
				}
			}
			check(kk[0][0],kk[0][1]);
			check2(kk[1][0],kk[1][1]);
//			System.out.println(kk[1][0]+" "+kk[1][1]);
//			System.out.println(kk[0][0]+" "+kk[0][1]);

			if(sol())
				System.out.println("YES");
			else
				System.out.println("NO");

//			for (int j = 0; j < 8; j++) {
//				for (int j2 = 0; j2 < 8; j2++) {
//					System.out.print(ke1[j][j2]);
//				}
//				System.out.println();
//			}
//			System.out.println();
//			for (int j = 0; j < 8; j++) {
//				for (int j2 = 0; j2 < 8; j2++) {
//					System.out.print(ke2[j][j2]);
//				}
//				System.out.println();
//			}
			ke1 = new int[8][8];
			ke2 = new int[8][8];
			board = new boolean[8][8];
		}
	}

	public static void check(int x,int y)
	{
		if(x>7||x<0||y<0||y>7) return ;
		if(ke1[x][y]!=0) return ;
		ke1[x][y]=1;
		check(x+2,y+2);
		check(x+2,y-2);
		check(x-2,y+2);
		check(x-2,y-2);
	}

	public static void check2(int x,int y)
	{
		if(x>7||x<0||y<0||y>7) return ;
		if(ke2[x][y]!=0) return ;
		ke2[x][y]=1;
		check2(x+2,y+2);
		check2(x+2,y-2);
		check2(x-2,y+2);
		check2(x-2,y-2);
	}

	public static boolean sol()
	{
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				if(ke1[i][j]!=0&&ke2[i][j]!=0&&!board[i][j]) return true;
			}
		}
		return false;
	}

	public int GCD(int a, int b)
	{
	   if (b==0) return a;
	   return GCD(b,a%b);
	}

	public int LCM(int a, int b)
	{
	   return b*a/GCD(a,b);
	}
}


import java.util.*;
public class CFA_212 {
	static boolean[][] board = new boolean[8][8];
	static boolean[][][][] ex = new boolean[8][8][8][8];
	static int[][] ke1 = new int[8][8];
	static int[][] ke2 = new int[8][8];
	static int index=0;
	static int[][] kk = new int[2][2];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t  = sc.nextInt();
		for (int i = 0; i < t; i++) {
			index =0;
			for (int j = 0; j < 8; j++) {
				char[] in = sc.next().toCharArray();
				for (int k = 0; k < 8; k++) {
					if(in[k]=='K')
					{
						if(index==0)
						{
							kk[0][0] = j;
							kk[0][1] = k;
						}
						else if(index==1)
						{

							kk[1][0] = j;
							kk[1][1] = k;
						}
						index++;
					}
					else if(in[k]=='#')
					{
						board[j][k]=true;
					}
				}
			}
			int kz =Math.abs(kk[0][0]-kk[1][0]);
			int kzz = Math.abs(kk[0][1]-kk[1][1]);

//			if(!(kz==kzz|(kzz==4&&kz==0)|(kz==4&&kzz==0)|(kzz==6&&kz==0)|(kz==6&&kzz==0)))
//			{
//					System.out.println("NO");
//					continue;
//			}

			if(check(kk[0][0],kk[0][1],kk[1][0],kk[1][1],0))
				System.out.println("YES");
			else
				System.out.println("NO");

			ke1 = new int[8][8];
			ke2 = new int[8][8];
			board = new boolean[8][8];
			ex = new boolean[8][8][8][8];
		}
	}
	public static boolean tet(int x,int y)
	{
		if(x==2&&y==2) return true;
		if(x==4&&y==0) return true;
		if(x==0&&y==4) return true;
		if(x==6&&y==6) return true;
		return true;
	}
	public static boolean check(int x,int y,int x1,int y1, int z)
	{
		if(x>7||x<0||y<0||y>7||x1<0||x1>7||y1<0||y1>7) return false;
		if(ex[x][y][x1][y1]) return false;
		ex[x][y][x1][y1]=true;
		if(z==0)
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;

			if(check(x+2,y+2,x1,y1,1)) return true;
			if(check(x+2,y-2,x1,y1,1)) return true;
			if(check(x-2,y+2,x1,y1,1)) return true;
			if(check(x-2,y-2,x1,y1,1)) return true;
			return false;
		}
		else
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;
			if(check(x,y,x1+2,y1+2,0)) return true;
			if(check(x,y,x1+2,y1-2,0)) return true;
			if(check(x,y,x1-2,y1+2,0)) return true;
			if(check(x,y,x1-2,y1-2,0)) return true;
		}
		return false;
	}

}


import java.util.*;
public class CFA_212 {
	static boolean[][] board = new boolean[8][8];
	static int[][] ke1 = new int[8][8];
	static int index=0;
	static int[][] kk = new int[2][2];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t  = sc.nextInt();
		for (int i = 0; i < t; i++) {

			for (int j = 0; j < 8; j++) {
				char[] in = sc.next().toCharArray();
				for (int k = 0; k < 8; k++) {
					if(in[k]=='K')
					{
						if(index==0)
						{
							kk[0][0] = j;
							kk[0][1] = k;
						}
						else
						{

							kk[1][0] = j;
							kk[1][1] = k;
						}
						index++;
					}
					else if(in[k]=='#')
					{
						board[j][k]=true;
					}
				}
			}
			check(kk[0][0],kk[0][1]);
			if(sol())
				System.out.println("YES");
			else
				System.out.println("NO");
			ke1 = new int[8][8];
			index=0;
			board = new boolean[8][8];
		}
	}

	public static void check(int x,int y)
	{
		if(x>7||x<0||y<0||y>7) return ;
		if(ke1[x][y]!=0) return ;
		ke1[x][y]=1;
		check(x+2,y+2);
		check(x+2,y-2);
		check(x-2,y+2);
		check(x-2,y-2);
	}

	public static boolean sol()
	{
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				if(ke1[i][j]!=0&&!board[i][j]&&i==kk[1][0]&&j==kk[1][1]) return true;
			}
		}
		return false;
	}

	public int GCD(int a, int b)
	{
	   if (b==0) return a;
	   return GCD(b,a%b);
	}

	public int LCM(int a, int b)
	{
	   return b*a/GCD(a,b);
	}
}


import java.util.*;
public class CFA_212 {
	static boolean[][] board = new boolean[8][8];
	static int[][] ke1 = new int[8][8];
	static int[][] ke2 = new int[8][8];
	static int index=0;
	static int[][] kk = new int[2][2];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t  = sc.nextInt();
		for (int i = 0; i < t; i++) {
			index =0;
			for (int j = 0; j < 8; j++) {
				char[] in = sc.next().toCharArray();
				for (int k = 0; k < 8; k++) {
					if(in[k]=='K')
					{
						if(index==0)
						{
							kk[0][0] = j;
							kk[0][1] = k;
						}
						else if(index==1)
						{

							kk[1][0] = j;
							kk[1][1] = k;
						}
						index++;
					}
					else if(in[k]=='#')
					{
						board[j][k]=true;
					}
				}
			}
			int kz =Math.abs(kk[0][0]-kk[1][0]);
			int kzz = Math.abs(kk[0][1]-kk[1][1]);

			if(!(kz==kzz|(kzz==4&&kz==0)|(kz==4&&kzz==0)))
			{
					System.out.println("NO");
					continue;
			}

			if(check(kk[0][0],kk[0][1],kk[1][0],kk[1][1],0))
				System.out.println("YES");
			else
				System.out.println("NO");

			ke1 = new int[8][8];
			ke2 = new int[8][8];
			board = new boolean[8][8];
		}
	}

	public static boolean check(int x,int y,int x1,int y1, int z)
	{
		if(x>7||x<0||y<0||y>7||x1<0||x1>7||y1<0||y1>7) return false;
		if(z==0)
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;

			if(check(x+2,y+2,x1,y1,1)) return true;
			if(check(x+2,y-2,x1,y1,1)) return true;
			if(check(x-2,y+2,x1,y1,1)) return true;
			if(check(x-2,y-2,x1,y1,1)) return true;

		}
		else
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;
			if(check(x,y,x1+2,y1+2,0)) return true;
			if(check(x,y,x1+2,y1-2,0)) return true;
			if(check(x,y,x1-2,y1+2,0)) return true;
			if(check(x,y,x1-2,y1-2,0)) return true;
		}
		return false;
	}

}


import java.util.*;
public class CFA_212 {
	static boolean[][] board = new boolean[8][8];
	static int[][] ke1 = new int[8][8];
	static int[][] ke2 = new int[8][8];
	static int index=0;
	static int[][] kk = new int[2][2];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t  = sc.nextInt();
		for (int i = 0; i < t; i++) {
			index =0;
			for (int j = 0; j < 8; j++) {
				char[] in = sc.next().toCharArray();
				for (int k = 0; k < 8; k++) {
					if(in[k]=='K')
					{
						if(index==0)
						{
							kk[0][0] = j;
							kk[0][1] = k;
						}
						else if(index==1)
						{

							kk[1][0] = j;
							kk[1][1] = k;
						}
						index++;
					}
					else if(in[k]=='#')
					{
						board[j][k]=true;
					}
				}
			}
			int kz =Math.abs(kk[0][0]-kk[1][0]);
			int kzz = Math.abs(kk[0][1]-kk[1][1]);

			if(kz==2||kz==6||kzz==2||kzz==6)
			{
					System.out.println("NO");
					continue;
			}

			if(check(kk[0][0],kk[0][1],kk[1][0],kk[1][1],0))
				System.out.println("YES");
			else
				System.out.println("NO");

			ke1 = new int[8][8];
			ke2 = new int[8][8];
			board = new boolean[8][8];
		}
	}

	public static boolean check(int x,int y,int x1,int y1, int z)
	{
		if(x>7||x<0||y<0||y>7||x1<0||x1>7||y1<0||y1>7) return false;
		if(z==0)
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;

			if(check(x+2,y+2,x1,y1,1)) return true;
			if(check(x+2,y-2,x1,y1,1)) return true;
			if(check(x-2,y+2,x1,y1,1)) return true;
			if(check(x-2,y-2,x1,y1,1)) return true;

		}
		else
		{
			if(x==x1&&y==y1&&!board[x][y]) return true;
			if(check(x,y,x1+2,y1+2,0)) return true;
			if(check(x,y,x1+2,y1-2,0)) return true;
			if(check(x,y,x1-2,y1+2,0)) return true;
			if(check(x,y,x1-2,y1-2,0)) return true;
		}
		return false;
	}

}


import java.io.*;
import java.util.*;

public class A {

    void run() throws IOException {
        int t = ni();
        while (--t >= 0) {
            char[][] map = new char[8][8];
            for (int i = 0; i < 8; i++) {
                map[i] = next().toCharArray();
            }

            int x = -1, y = -1;

            for (int i = 0; i < 8 && x == -1; i++) {
                for (int j = 0; j < 8 && y == -1; j++) {
                    if (map[i][j] == 'K') {
                        map[x = i][y = j] = '.';
                    }
                }
            }
            boolean f = false, s = false;
            for (int i = -16; i <= 16; i += 4) {
                for (int j = -16; j <= 16; j += 4) {
                    int tx = i + x;
                    int ty = j + y;
                    if (tx >= 0 && tx < 8 && ty >= 0 && ty < 8 && map[tx][ty] == 'K') {
                        f = true;
                    }
                    tx += 2;
                    ty += 2;
                    if (tx >= 0 && tx < 8 && ty >= 0 && ty < 8 && map[tx][ty] != '#') {
                        s = true;
                    }
                }
            }
            pw.println(f & s ? "YES" : "NO");
        }
    }

    int[][] nm(int a_len, int a_hei) throws IOException {
        int[][] _a = new int[a_len][a_hei];
        for (int i = 0; i < a_len; i++)
            for (int j = 0; j < a_hei; j++)
                _a[i][j] = ni();
        return _a;
    }

    String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    boolean hasNext() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return false;
            }
            st = new StringTokenizer(line);
        }
        return true;
    }

    int[] na(int a_len) throws IOException {
        int[] _a = new int[a_len];
        for (int i = 0; i < a_len; i++)
            _a[i] = ni();
        return _a;
    }

    int ni() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    String nl() throws IOException {
        return br.readLine();
    }

    void tr(String debug) {
        if (!OJ)
            pw.println(" " + debug);
    }

    static PrintWriter pw;
    static BufferedReader br;
    static StringTokenizer st;
    static boolean OJ;

    public static void main(String[] args) throws IOException {
        long timeout = System.currentTimeMillis();
        OJ = System.getProperty("ONLINE_JUDGE") != null;
        pw = new PrintWriter(System.out);
        br = new BufferedReader(OJ ? new InputStreamReader(System.in) : new FileReader(new File("A.txt")));
        while (br.ready())
            new A().run();
        if (!OJ) {
            pw.println();
            pw.println("----------------------------------");
            pw.println(System.currentTimeMillis() - timeout);
        }
        br.close();
        pw.close();
    }

}


import java.io.*;
import java.util.*;

public class A {

    void run() throws IOException {
        int t = ni();
        while (--t >= 0) {
            char[][] map = new char[8][8];
            for (int i = 0; i < 8; i++) {
                map[i] = next().toCharArray();
            }

            int x = -1, y = -1;

            for (int i = 0; i < 8 && x == -1; i++) {
                for (int j = 0; j < 8 && y == -1; j++) {
                    if (map[i][j] == 'K') {
                        map[x = i][y = j] = '.';
                    }
                }
            }
            boolean f = false, s = false;
            for (int i = -16; i <= 16; i += 4) {
                for (int j = -16; j <= 16; j += 4) {
                    int tx = i + x;
                    int ty = j + y;
                    if (tx >= 0 && tx < 8 && ty >= 0 && ty < 8 && map[tx][ty] == 'K') {
                        f = true;
                    }
                }
            }
            for (int i = 0; i < 8; i++) {
                for (int j = 0; j < 8; j++) {
                    if ((Math.abs(x - i) + Math.abs(y - j)) % 4 == 0 && map[i][j] != '#') {
                        s = true;
                    }
                }
            }

            pw.println(f & s ? "YES" : "NO");
        }
    }

    int[][] nm(int a_len, int a_hei) throws IOException {
        int[][] _a = new int[a_len][a_hei];
        for (int i = 0; i < a_len; i++)
            for (int j = 0; j < a_hei; j++)
                _a[i][j] = ni();
        return _a;
    }

    String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    boolean hasNext() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return false;
            }
            st = new StringTokenizer(line);
        }
        return true;
    }

    int[] na(int a_len) throws IOException {
        int[] _a = new int[a_len];
        for (int i = 0; i < a_len; i++)
            _a[i] = ni();
        return _a;
    }

    int ni() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    String nl() throws IOException {
        return br.readLine();
    }

    void tr(String debug) {
        if (!OJ)
            pw.println(" " + debug);
    }

    static PrintWriter pw;
    static BufferedReader br;
    static StringTokenizer st;
    static boolean OJ;

    public static void main(String[] args) throws IOException {
        long timeout = System.currentTimeMillis();
        OJ = System.getProperty("ONLINE_JUDGE") != null;
        pw = new PrintWriter(System.out);
        br = new BufferedReader(OJ ? new InputStreamReader(System.in) : new FileReader(new File("A.txt")));
        while (br.ready())
            new A().run();
        if (!OJ) {
            pw.println();
            pw.println("----------------------------------");
            pw.println(System.currentTimeMillis() - timeout);
        }
        br.close();
        pw.close();
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		//InputReader in = new InputReader(new File("input.txt"));
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}
}

class Task {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int t = in.nextInt();
        String s[]=new String[10];
        for(int i=0; i<10;++i)s[i]=new String();
        while(t>0) {
            t--;

            int x1=-1, x2=-1, y1=-1, y2=-1;
            for(int i=0; i<8; ++i) s[i]=in.next();
            //for(int i=0; i<8;++i) out.println(s[i]);
            for(int i=0; i<8;++i)
                for(int j=0;j<8;++j)if(s[i].charAt(j)=='K') if(x1==-1) {
                    x1=i;
                    y1=j;
                }else{
                    x2=i;
                    y2=j;
                }

            boolean can=false;
            for(int i=0; i<8;++i)
                for(int j=0; j<8;++j)
                    if(s[i].charAt(j)!='#')
                        if(Math.abs(x1-i)%2==0 && Math.abs(x2-i)==0 && Math.abs(y1-j)%2==0 && Math.abs(y2-j)==0)
                            if((x1-i+y1-j)/2%2==0 && (x2-i+y2-j)/2%2==0)
                                can=true;
            if(can==true) out.println("YES");else
                out.println("NO");
            }
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(File f) {
        try{
            reader = new BufferedReader(new FileReader(f));
            tokenizer = null;
        } catch(FileNotFoundException e) {
                e.printStackTrace();
        }
    }

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		//InputReader in = new InputReader(new File("input.txt"));
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}
}

class Task {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int t = in.nextInt();

        String s[]=new String[10];
        for(int i=0; i<10;++i)s[i]=new String();
        while(t>0) {
            t--;
            int x1=-1, x2=-1, y1=-1, y2=-1;
            for(int i=0; i<8; ++i) s[i]=in.next();
            //for(int i=0; i<8;++i) out.println(s[i]);
            //if(t==0) return;
            for(int i=0; i<8;++i)
                for(int j=0;j<8;++j)if(s[i].charAt(j)=='K') if(x1==-1) {
                    x1=i;
                    y1=j;
                }else{
                    x2=i;
                    y2=j;
                }

            boolean can=false;
            for(int i=0; i<8; ++i)
                for(int j=0; j<8; ++j)
                    if(s[i].charAt(j)!='#')
                        if(Math.abs(x1-i)%2==0 && Math.abs(x2-i)==0 && Math.abs(y1-j)%2==0 && Math.abs(y2-j)==0)
                            if((x1-i+y1-j)%4==0 && (x2-i+y2-j)%4==0)
                                if((x1-i+x2-i)%4==0) {
                                        //out.println(i);
                                        can=true;

                                }

            if(can==true) out.println("YES");else
                out.println("NO");

            }
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(File f) {
        try{
            reader = new BufferedReader(new FileReader(f));
            tokenizer = null;
        } catch(FileNotFoundException e) {
                e.printStackTrace();
        }
    }

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		//InputReader in = new InputReader(new File("input.txt"));
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}
}

class Task {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int t = in.nextInt();
        String s[]=new String[10];
        for(int i=0; i<10;++i)s[i]=new String();
        while(t>0) {
            t--;

            int x1=-1, x2=-1, y1=-1, y2=-1;
            for(int i=0; i<8; ++i) s[i]=in.next();
            //for(int i=0; i<8;++i) out.println(s[i]);
            for(int i=0; i<8;++i)
                for(int j=0;j<8;++j)if(s[i].charAt(j)=='K') if(x1==-1) {
                    x1=i;
                    y1=j;
                }else{
                    x2=i;
                    y2=j;
                }

            boolean can=false;
            for(int i=0; i<8; ++i)
                for(int j=0; j<8; ++j)
                    if(s[i].charAt(j)!='#')
                        //if(Math.abs(x1-i)%2==0 && Math.abs(x2-i)==0 && Math.abs(y1-j)%2==0 && Math.abs(y2-j)==0)
                            if((x1-i+y1-j)%4==0 && (x2-i+y2-j)%4==0)
                                if((x1-i+x2-i)%4==0) can=true;

            if(can==true) out.println("YES");else
                out.println("NO");
            }
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(File f) {
        try{
            reader = new BufferedReader(new FileReader(f));
            tokenizer = null;
        } catch(FileNotFoundException e) {
                e.printStackTrace();
        }
    }

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int t = in.nextInt();
        while (t-- > 0) {
            boolean[][] map = new boolean[8][8];
            int x1 = -1;
            int y1 = -1;
            int x2 = -1;
            int y2 = -1;
            boolean f = true;
            for (int i = 0; i < 8; i++) {
                String st = in.next();
                for (int j = 0; j < 8; j++) {
                    if (st.charAt(j) == 'K') {
                        if (f) {
                            x1 = i;
                            y1 = j;
                            f = false;
                        } else {
                            x2 = i;
                            y2 = j;
                        }
                    }
                }
            }
            dfs(x1, y1, map);
            out.println(map[x2][y2] ? "YES" : "NO");
        }
        out.close();
    }

    static void dfs(int x1, int y1, boolean[][] map) {
        if (x1 < 0 || y1 < 0 || x1 >= 8 || y1 >= 8)
            return;
        if (map[x1][y1])
            return;
        map[x1][y1] = true;
        dfs(x1 + 2, y1 + 2, map);
        dfs(x1 + 2, y1 - 2, map);
        dfs(x1 - 2, y1 + 2, map);
        dfs(x1 - 2, y1 - 2, map);
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

public class A {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int t = in.nextInt();
        while (t-- > 0) {
            int[][] map = new int[8][8];
            int[][] map2 = new int[8][8];
            boolean[][] can = new boolean[8][8];
            int x1 = -1;
            int y1 = -1;
            int x2 = -1;
            int y2 = -1;
            boolean f = true;
            for (int i = 0; i < 8; i++) {
                String st = in.next();
                for (int j = 0; j < 8; j++) {
                    can[i][j] = st.charAt(j) != '#';
                    if (st.charAt(j) == 'K') {
                        if (f) {
                            x1 = i;
                            y1 = j;
                            f = false;
                        } else {
                            x2 = i;
                            y2 = j;
                        }
                    }
                    map2[i][j] = map[i][j] = -1;
                }
            }
            dfs(x1, y1, map, 0);
            dfs(x2, y2, map2, 0);
            boolean yes = false;
            for (int i = 0; i < 8; i++)
                for (int j = 0; j < 8; j++)
                    if (map[i][j] == map2[i][j] && map[i][j] >= 0 && can[i][j]) {
                        yes = true;
                        break;
                    }
            out.println(yes ? "YES" : "NO");
        }
        out.close();
    }

    static void dfs(int x1, int y1, int[][] map, int state) {
        if (x1 < 0 || y1 < 0 || x1 >= 8 || y1 >= 8)
            return;
        if (map[x1][y1] == 0 || map[x1][y1] == 1)
            return;
        map[x1][y1] = state % 2;
        dfs(x1 + 2, y1 + 2, map, state + 1);
        dfs(x1 + 2, y1 - 2, map, state + 1);
        dfs(x1 - 2, y1 + 2, map, state + 1);
        dfs(x1 - 2, y1 - 2, map, state + 1);
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.util.Scanner;

public class a {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int t = s.nextInt();

		for (int cn = 0; cn < t; ++cn) {

			boolean [][] table = new boolean[8][8];
			int [] x = new int[2];
			int [] y = new int[2];
			boolean first = true;
			for (int i = 0; i < 8; ++i) {
				String line = s.next();
				//System.out.println(line);
				for (int j = 0; j < 8; ++j) {
					if (line.charAt(j) == '.')
						table[i][j] = true;
					else if (line.charAt(j) == '#')
						table[i][j] = false;
					else if (line.charAt(j) == 'K') {
						table[i][j] = true;
						if (first) {
							x[0] = i;
							y[0] = j;
							first = false;
						}
						else {
							x[1] = i;
							y[1] = j;
						}
					}
				}
			}
			// solution
			//System.out.println(x[0] + " " + y[0]);
			//System.out.println(x[1] + " " + y[1]);
			for (int i = 0; i < 2; ++i) {
				if (x[i] >= 4)
					x[i]-=4;
				if (y[i] >= 4)
					y[i]-=4;
				if (y[i] >= 2) {
					y[i]-=2;
					x[i]+=2;
					if (x[i] >= 4)
						x[i]-=4;
				}
			}
			boolean can = false;
			//System.out.println(x[0] + " " + y[0]);
			//System.out.println(x[1] + " " + y[1]);
			if ((x[0] == x[1]) && (y[0] == y[1]))
				can = true;
			if (!can)
				System.out.println("NO");
			else {
				can = false;
				for (int j = 0; j < 2; ++j) {
					for (int i = 0; i < 2; ++i) {
						int xx = x[0]+4*i;
						int yy = y[0]+4*j;
						//System.out.println(xx + " " + yy);
						if (table[xx][yy])
							can = true;
						xx = xx+2;
						yy = yy+2;
						if (xx >= 4)
							xx-=4;
						//System.out.println(xx + " " + yy);
						if (table[xx][yy])
							can = true;
					}
				}
				if (can)
					System.out.println("YES");
				else
					System.out.println("NO");
			}
		}
	}

}

/*

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

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

*/


import java.util.Scanner;

public class a {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int t = s.nextInt();

		for (int cn = 0; cn < t; ++cn) {

			boolean [][] table = new boolean[8][8];
			int [] x = new int[2];
			int [] y = new int[2];
			boolean first = true;
			for (int i = 0; i < 8; ++i) {
				String line = s.next();
				//System.out.println(line);
				for (int j = 0; j < 8; ++j) {
					if (line.charAt(j) == '.')
						table[i][j] = true;
					else if (line.charAt(j) == '#')
						table[i][j] = false;
					else if (line.charAt(j) == 'K') {
						table[i][j] = true;
						if (first) {
							x[0] = i;
							y[0] = j;
							first = false;
						}
						else {
							x[1] = i;
							y[1] = j;
						}
					}
				}
			}
			// solution
			//System.out.println(x[0] + " " + y[0]);
			//System.out.println(x[1] + " " + y[1]);
			for (int i = 0; i < 2; ++i) {
				if (x[i] >= 4)
					x[i]-=4;
				if (y[i] >= 4)
					y[i]-=4;
				if (y[i] >= 2) {
					y[i]-=2;
					x[i]+=2;
					if (x[i] >= 4)
						x[i]-=4;
				}
			}
			boolean can = false;
			//System.out.println(x[0] + " " + y[0]);
			//System.out.println(x[1] + " " + y[1]);
			if ((x[0] == x[1]) && (y[0] == y[1]))
				can = true;
			/*
			if (!can)
				System.out.println("NO");
			else {
				can = false;
				for (int j = 0; j < 2; ++j) {
					for (int i = 0; i < 2; ++i) {
						int xx = x[0]+4*i;
						int yy = y[0]+4*j;
						//System.out.println(xx + " " + yy);
						if (table[xx][yy])
							can = true;
						xx = xx+2;
						yy = yy+2;
						if (xx >= 4)
							xx-=4;
						//System.out.println(xx + " " + yy);
						if (table[xx][yy])
							can = true;
					}
				}
				if (can)
					System.out.println("YES");
				else
					System.out.println("NO");
			}
			*/
			if (can)
				System.out.println("YES");
			else
				System.out.println("NO");
		}
	}

}

/*

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

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

1
##K#####
########
K#######
########
########
########
########
########

*/


import java.util.Scanner;

public class a {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int t = s.nextInt();

		for (int cn = 0; cn < t; ++cn) {

			boolean [][] table = new boolean[8][8];
			int [] x = new int[2];
			int [] y = new int[2];
			boolean first = true;
			for (int i = 0; i < 8; ++i) {
				String line = s.next();
				//System.out.println(line);
				for (int j = 0; j < 8; ++j) {
					if (line.charAt(j) == '.')
						table[i][j] = true;
					else if (line.charAt(j) == '#')
						table[i][j] = false;
					else if (line.charAt(j) == 'K') {
						table[i][j] = true;
						if (first) {
							x[0] = i;
							y[0] = j;
							first = false;
						}
						else {
							x[1] = i;
							y[1] = j;
						}
					}
				}
			}
			// solution
			//System.out.println((x[0]+1) + " " + (y[0]+1));
			//System.out.println((x[1]+1) + " " + (y[1]+1));
			for (int i = 0; i < 2; ++i) {
				if (x[i] >= 4)
					x[i]-=4;
				if (y[i] >= 4)
					y[i]-=4;
				/*
				if (y[i] >= 2) {
					y[i]-=2;
					x[i]+=2;
					if (x[i] >= 4)
						x[i]-=4;
				}
				*/
			}
			boolean can = false;
			//System.out.println((x[0]+1) + " " + (y[0]+1));
			//System.out.println((x[1]+1) + " " + (y[1]+1));
			if ((x[0] == x[1]) && (y[0] == y[1]))
				can = true;
			if (!can)
				System.out.println("NO");
			else {
				can = false;
				for (int j = 0; j < 2; ++j) {
					for (int i = 0; i < 2; ++i) {
						int xx = x[0]+4*i;
						int yy = y[0]+4*j;
						//System.out.println(xx + " " + yy);
						if (table[xx][yy])
							can = true;
						/*
						xx = xx+2;
						yy = yy+2;
						if (xx >= 4)
							xx-=4;
						//System.out.println(xx + " " + yy);
						if (table[xx][yy])
							can = true;
						*/
					}
				}
				if (can)
					System.out.println("YES");
				else
					System.out.println("NO");
			}
		}
	}

}

/*

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

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

1
##K#####
########
K#######
########
########
########
########
########

*/


import java.util.*;

import static java.lang.Math.*;

import java.awt.Point;
import java.io.*;

public class A {
	static Scanner sc = new Scanner(new BufferedInputStream(System.in));

	// static {
	// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
	// }

	public static void main(String[] args) {
		int t = ni();
		String[] a = new String[8];
		while (t-- > 0) {
			for (int i = 0; i < 8; i++) {
				a[i] = n();
			}
			Point start = null, end = null;
			for (int i = 0; i < a.length; i++) {
				for (int j = 0; j < a[i].length(); j++) {
					char c = a[i].charAt(j);
					if (c == 'K') {
						if (start == null)
							start = new Point(j, i);
						else
							end = new Point(j, i);
					}
				}
			}

			Queue<Point> b = new LinkedList<Point>();
			b.add(start);
			boolean works = false;
			boolean[][] vi = new boolean[8][8];
			while (!b.isEmpty()) {
				Point cur = b.remove();
				if (!(isgood(cur.x, cur.y)) || vi[cur.y][cur.x]
						) {
					continue;
				}
				if (cur.equals(end)) {
					works = true;
					break;
				}
				vi[cur.y][cur.x] = true;
				b.add(new Point(cur.x + 2, cur.y + 2));
				b.add(new Point(cur.x - 2, cur.y - 2));
				b.add(new Point(cur.x - 2, cur.y + 2));
				b.add(new Point(cur.x + 2, cur.y - 2));

			}
			if (works)
				System.out.println("YES");
			else
				System.out.println("NO");
		}

		sc.close();
	}

	static boolean isgood(int i, int j) {
		return ((i >= 0) && (i < 8)) && ((j >= 0) && (j < 8));
	}

	static int ni() {
		return sc.nextInt();
	}

	static String n() {
		return sc.next();
	}
}


import java.util.*;

import static java.lang.Math.*;

import java.awt.Point;
import java.io.*;

public class A {
	static Scanner sc = new Scanner(new BufferedInputStream(System.in));

	// static {
	// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
	// }

	public static void main(String[] args) {
		int t = ni();
		String[] a = new String[8];
		while (t-- > 0) {
			for (int i = 0; i < 8; i++) {
				a[i] = n();
			}
			Point start = null, end = null;
			for (int i = 0; i < a.length; i++) {
				for (int j = 0; j < a[i].length(); j++) {
					char c = a[i].charAt(j);
					if (c == 'K') {
						if (start == null)
							start = new Point(i, j);
						else
							end = new Point(i, j);
					}
				}
			}

			Queue<Point> b = new LinkedList<Point>();
			b.add(end);
			boolean[][] vi = new boolean[8][8];
			while (!b.isEmpty()) {
				Point cur = b.remove();
				if (!(isgood(cur.x, cur.y)) || vi[cur.x][cur.y]) {
					continue;
				}
				vi[cur.x][cur.y] = true;
				b.add(new Point(cur.x + 2, cur.y + 2));
				b.add(new Point(cur.x - 2, cur.y - 2));
				b.add(new Point(cur.x - 2, cur.y + 2));
				b.add(new Point(cur.x + 2, cur.y - 2));
			}

			if (vi[start.x][start.y])
				System.out.println("YES");
			else
				System.out.println("NO");
		}

		sc.close();
	}

	static boolean isgood(int i, int j) {
		return (i >= 0) && (i < 8) && (j >= 0) && (j < 8);
	}

	static int ni() {
		return sc.nextInt();
	}

	static String n() {
		return sc.next();
	}
}


import java.util.*;

import static java.lang.Math.*;

import java.awt.Point;
import java.io.*;

public class A {
	static Scanner sc = new Scanner(new BufferedInputStream(System.in));

	// static {
	// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
	// }

	public static void main(String[] args) {
		int t = ni();
		String[] a = new String[8];
		while (t-- > 0) {
			for (int i = 0; i < 8; i++) {
				a[i] = n();
			}
			Point start = null, end = null;
			for (int i = 0; i < a.length; i++) {
				for (int j = 0; j < a[i].length(); j++) {
					char c = a[i].charAt(j);
					if (c == 'K') {
						if (start == null)
							start = new Point(i, j);
						else
							end = new Point(i, j);
					}
				}
			}

			if (abs(start.x - end.x) % 4 == 0 && abs(start.y - end.y) % 4 == 0) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}

		sc.close();
	}

	static boolean isgood(int i, int j) {
		return (i >= 0) && (i < 8) && (j >= 0) && (j < 8);
	}

	static int ni() {
		return sc.nextInt();
	}

	static String n() {
		return sc.next();
	}
}


import java.util.*;

import static java.lang.Math.*;

import java.awt.Point;
import java.io.*;

public class A {
	static Scanner sc = new Scanner(new BufferedInputStream(System.in));

	// static {
	// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
	// }

	public static void main(String[] args) {
		int t = ni();
		String[] a = new String[8];
		while (t-- > 0) {
			for (int i = 0; i < 8; i++) {
				a[i] = n();
			}
			boolean[][] bad = new boolean[8][8];
			Point start = null, end = null;
			for (int i = 0; i < a.length; i++) {
				for (int j = 0; j < a[i].length(); j++) {
					char c = a[i].charAt(j);
					if (c == 'K') {
						if (start == null)
							start = new Point(j, i);
						else
							end = new Point(j, i);
					}
					if (c == '#')
						bad[i][j] = true;
				}
			}

			Queue<Point> b = new LinkedList<Point>();
			b.add(start);
			boolean works = false;
			boolean[][] vi = new boolean[8][8];
			while (!b.isEmpty()) {
				Point cur = b.remove();
				if (!(isgood(cur.x, cur.y)) || vi[cur.y][cur.x]
						|| bad[cur.y][cur.x]) {
					continue;
				}
				if (cur.equals(end)) {
					works = true;
					break;
				}
				vi[cur.y][cur.x] = true;
				b.add(new Point(cur.x + 2, cur.y + 2));
				b.add(new Point(cur.x - 2, cur.y - 2));
				b.add(new Point(cur.x - 2, cur.y + 2));
				b.add(new Point(cur.x + 2, cur.y - 2));

			}
			if (works)
				System.out.println("YES");
			else
				System.out.println("NO");
		}

		sc.close();
	}

	static boolean isgood(int i, int j) {
		return ((i >= 0) && (i < 8)) && ((j >= 0) && (j < 8));
	}

	static int ni() {
		return sc.nextInt();
	}

	static String n() {
		return sc.next();
	}
}


import java.util.*;

import static java.lang.Math.*;

import java.awt.Point;
import java.io.*;

public class A {
	static Scanner sc = new Scanner(new BufferedInputStream(System.in));
	static {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
	}

	public static void main(String[] args) {
		int t = ni();
		String[] a = new String[8];
		while (t-- > 0) {
			for (int i = 0; i < 8; i++) {
				a[i] = n();
			}
			boolean[][] bad = new boolean[8][8];
			Point start = null, end = null;
			for (int i = 0; i < a.length; i++) {
				for (int j = 0; j < a[i].length(); j++) {
					char c = a[i].charAt(j);
					if (c == 'K') {
						if (start == null)
							start = new Point(i, j);
						else
							end = new Point(i, j);
					}
					if (c == '#')
						bad[i][j] = true;
				}
			}

			Queue<Point> b = new LinkedList<Point>();
			b.add(start);
			boolean works = false;
			boolean[][] vi = new boolean[8][8];
			while (!b.isEmpty()) {
				Point cur = b.remove();
				if (!(isgood(cur.x, cur.y)) || vi[cur.y][cur.x]
						|| bad[cur.y][cur.x]) {

					continue;
				}
				if (cur.equals(end)) {
					works = true;
					break;
				}
				vi[cur.y][cur.x] = true;
				b.add(new Point(cur.x + 2, cur.y + 2));
				b.add(new Point(cur.x - 2, cur.y - 2));
				b.add(new Point(cur.x - 2, cur.y + 2));
				b.add(new Point(cur.x + 2, cur.y - 2));

			}
			if (works)
				System.out.println("YES");
			else
				System.out.println("NO");
		}

		sc.close();
		System.out.flush();
		System.out.close();
	}

	static boolean isgood(int i, int j) {
		return ((i >= 0) && (i < 8)) && ((j >= 0) && (j < 8));
	}

	static int ni() {
		return sc.nextInt();
	}

	static long nl() {
		return sc.nextLong();
	}

	static String n() {
		return sc.next();
	}
}


import java.util.*;

import static java.lang.Math.*;

import java.awt.Point;
import java.io.*;

public class A {
	static Scanner sc = new Scanner(new BufferedInputStream(System.in));

	// static {
	// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
	// }

	public static void main(String[] args) {
		int t = ni();
		String[] a = new String[8];
		while (t-- > 0) {
			for (int i = 0; i < 8; i++) {
				a[i] = n();
			}
			Point start = null, end = null;
			for (int i = 0; i < a.length; i++) {
				for (int j = 0; j < a[i].length(); j++) {
					char c = a[i].charAt(j);
					if (c == 'K') {
						if (start == null)
							start = new Point(j, i);
						else
							end = new Point(j, i);
					}
				}
			}

			Queue<Point> b = new LinkedList<Point>();
			b.add(start);
			boolean works = ((start.x & 1) == (end.x & 1) && ((start.y & 1) == (end.y & 1)));
			boolean[][] vi = new boolean[8][8];
			if (works) {
				works = false;
				while (!b.isEmpty() && !works) {
					Point cur = b.remove();
					if (!(isgood(cur.x, cur.y)) || vi[cur.y][cur.x]) {
						continue;
					}
					if (cur.equals(end)) {
						works = true;
						break;
					}
					vi[cur.y][cur.x] = true;
					b.add(new Point(cur.x + 2, cur.y + 2));
					b.add(new Point(cur.x - 2, cur.y - 2));
					b.add(new Point(cur.x - 2, cur.y + 2));
					b.add(new Point(cur.x + 2, cur.y - 2));
				}
			}
			if (works)
				System.out.println("YES");
			else
				System.out.println("NO");
		}

		sc.close();
	}

	static boolean isgood(int i, int j) {
		return (i >= 0) && (i < 8) && (j >= 0) && (j < 8);
	}

	static int ni() {
		return sc.nextInt();
	}

	static String n() {
		return sc.next();
	}
}


import java.util.*;

import static java.lang.Math.*;

import java.awt.Point;
import java.io.*;

public class A {
	static Scanner sc = new Scanner(new BufferedInputStream(System.in));

	// static {
	// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
	// }

	public static void main(String[] args) {
		int t = ni();
		String[] a = new String[8];
		while (t-- > 0) {
			for (int i = 0; i < 8; i++) {
				a[i] = n();
			}
			Point start = null, end = null;
			for (int i = 0; i < a.length; i++) {
				for (int j = 0; j < a[i].length(); j++) {
					char c = a[i].charAt(j);
					if (c == 'K') {
						if (start == null)
							start = new Point(j, i);
						else
							end = new Point(j, i);
					}
				}
			}

			Queue<Point> b = new LinkedList<Point>();
			b.add(end);
			boolean works = ((start.x & 1) == (end.x & 1) && ((start.y & 1) == (end.y & 1)));
			boolean[][] vi = new boolean[8][8];
			if (works) {
				while (!b.isEmpty()) {
					Point cur = b.remove();
					if (!(isgood(cur.x, cur.y)) || vi[cur.y][cur.x]) {
						continue;
					}
					vi[cur.y][cur.x] = true;
					b.add(new Point(cur.x + 2, cur.y + 2));
					b.add(new Point(cur.x - 2, cur.y - 2));
					b.add(new Point(cur.x - 2, cur.y + 2));
					b.add(new Point(cur.x + 2, cur.y - 2));
				}
			}
			if (vi[start.y][start.x])
				System.out.println("YES");
			else
				System.out.println("NO");
		}

		sc.close();
	}

	static boolean isgood(int i, int j) {
		return (i >= 0) && (i < 8) && (j >= 0) && (j < 8);
	}

	static int ni() {
		return sc.nextInt();
	}

	static String n() {
		return sc.next();
	}
}


import java.util.*;

import static java.lang.Math.*;

import java.awt.Point;
import java.io.*;

public class A {
	static Scanner sc = new Scanner(new BufferedInputStream(System.in));

	// static {
	// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
	// }

	public static void main(String[] args) {
		int t = ni();
		String[] a = new String[8];
		while (t-- > 0) {
			for (int i = 0; i < 8; i++) {
				a[i] = n();
			}
			boolean[][] bad = new boolean[8][8];
			Point start = null, end = null;
			for (int i = 0; i < a.length; i++) {
				for (int j = 0; j < a[i].length(); j++) {
					char c = a[i].charAt(j);
					if (c == 'K') {
						if (start == null)
							start = new Point(i, j);
						else
							end = new Point(i, j);
					}
					if (c == '#')
						bad[i][j] = true;
				}
			}

			Queue<Point> b = new LinkedList<Point>();
			b.add(start);
			boolean works = false;
			boolean[][] vi = new boolean[8][8];
			while (!b.isEmpty()) {
				Point cur = b.remove();
				if (!(isgood(cur.x, cur.y)) || vi[cur.y][cur.x]
						|| bad[cur.y][cur.x]) {

					continue;
				}
				if (cur.equals(end)) {
					works = true;
					break;
				}
				vi[cur.y][cur.x] = true;
				b.add(new Point(cur.x + 2, cur.y + 2));
				b.add(new Point(cur.x - 2, cur.y - 2));
				b.add(new Point(cur.x - 2, cur.y + 2));
				b.add(new Point(cur.x + 2, cur.y - 2));

			}
			if (works)
				System.out.println("YES");
			else
				System.out.println("NO");
		}

		sc.close();
	}

	static boolean isgood(int i, int j) {
		return ((i >= 0) && (i < 8)) && ((j >= 0) && (j < 8));
	}

	static int ni() {
		return sc.nextInt();
	}

	static String n() {
		return sc.next();
	}
}


import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.sql.Struct;
import java.util.Scanner;

import java.io.*;
import java.math.*;
import java.util.*;

public class CodeForces {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		new CodeForces();
	}

	public CodeForces() throws NumberFormatException, IOException {
		Scanner sc = new Scanner(System.in);
		// BufferedReader rd = new BufferedReader(new
		// InputStreamReader(System.in));
		// PrintWriter out = new PrintWriter(System.out);
		int T = sc.nextInt();
		sc.nextLine();
		int[][] b = new int[8][8];
		for (int t = 0; t < T; t++) {
			for (int i = 0; i < 8; ++i) {
				String tmp = sc.nextLine();
				for (int j = 0; j < 8; ++j)
					if (tmp.charAt(j) == '.')
						b[i][j] = 0;
					else if (tmp.charAt(j) == '#')
						b[i][j] = -1;
					else
						b[i][j] = 1;
			}
			String wtf = sc.nextLine();
			System.out.println(solve(b));
		}
	}

	private String solve(int[][] b) {
		int i1=-1,j1=-1,i2=-1,j2=-1;
		for (int i=0; i<8; ++i)
			for (int j=0; j<8; ++j){
				if (b[i][j]==1){
					if (i1==-1){
						i1=i;
						j1=j;
					} else {
						i2=i;
						j2=j;
					}
				}
			}
		int di = Math.abs(i1-i2);
		int dj = Math.abs(j1-j2);
		if (di%4!=0 || dj%4!=0) return "NO";
		return "YES";
		//int t = (di+dj)/4;
		//return t%2==0 ? "YES" : "NO";
	}
}


import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.sql.Struct;
import java.util.Scanner;

import java.io.*;
import java.math.*;
import java.util.*;

public class CodeForces {

    public static void main(String[] args) throws NumberFormatException,
            IOException {
        new CodeForces();
    }

    public CodeForces() throws NumberFormatException, IOException {
        Scanner sc = new Scanner(System.in);
        // BufferedReader rd = new BufferedReader(new
        // InputStreamReader(System.in));
        // PrintWriter out = new PrintWriter(System.out);
        int T = sc.nextInt();
        sc.nextLine();
        int[][] b = new int[8][8];
        for (int t = 0; t < T; t++) {
            for (int i = 0; i < 8; ++i) {
                String tmp = sc.next();
                for (int j = 0; j < 8; ++j)
                    if (tmp.charAt(j) == '.')
                        b[i][j] = 0;
                    else if (tmp.charAt(j) == '#')
                        b[i][j] = -1;
                    else
                        b[i][j] = 1;
            }
            String wtf = sc.nextLine();
            System.out.println(solve(b));
        }
    }

    private String solve(int[][] b) {
        int i1=-1,j1=-1,i2=-1,j2=-1;
        for (int i=0; i<8; ++i)
            for (int j=0; j<8; ++j){
                if (b[i][j]==1){
                    if (i1==-1){
                        i1=i;
                        j1=j;
                    } else {
                        i2=i;
                        j2=j;
                    }
                }
            }
        int di = Math.abs(i1-i2);
        int dj = Math.abs(j1-j2);
        if (di%4!=0 || dj%4!=0) return "NO";
        return "YES";
        //int t = (di+dj)/4;
        //return t%2==0 ? "YES" : "NO";
    }
}


import java.awt.Point;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PipedWriter;
import java.io.PrintWriter;

import java.io.BufferedReader;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;

public class A {
    private static BufferedReader in;
    private static StringTokenizer st;
    private static PrintWriter out;
    private static int[][] a;

    public static void main(String[] args) throws NumberFormatException, IOException {

        in = new BufferedReader(new InputStreamReader(System.in));
        st = new StringTokenizer("");
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        while(n --> 0){
            a = new int[9][9];
            int cnt = 0;
            Point k1 = new Point(),k2 = new Point();
            for (int i = 1; i <= 8; i++) {
                String s = in.readLine();
                for (int j = 1; j <=8; j++) {
                    if(s.charAt(j-1)=='#'){
                        a[i][j] = -1;
                    }
                    if(s.charAt(j-1)=='K'){
                        if(cnt==0)
                            k1 = new Point(i,j);
                        else
                            k2 = new Point(i,j);
                        cnt++;
                    }
                }
            }
            if(n > 0)
                in.readLine();
            int d1[][] = walk(k1);
            int d2[][] = walk(k2);
            boolean ok = false;
            for (int i = 1; i <=8; i++) {
                for (int j = 1; j <=8; j++) {
                    if(d1[i][j] % 2 == d2[i][j] % 2 && d1[i][j] !=0 && d2[i][j] != 0){
                        ok = true;
                        break;
                    }
                }
            }
            if(ok){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
        out.close();
    }

    private static int[][] walk(Point p) {
        Queue<Point> que = new LinkedList<Point>();
        que.add(p);
        boolean used[][] = new boolean[9][9];
        int d[][] = new int[9][9];
        d[p.x][p.y] = 2;
        int dx[] = {2, 2,-2,-2};
        int dy[] = {2,-2, 2,-2};
        used[p.x][p.y] = true;
        while(!que.isEmpty()){
            Point v = que.poll();
            for (int i = 0; i < 4; i++) {
                int xx = v.x + dx[i];
                int yy = v.y + dy[i];
                if(0<xx && xx<9 && 0 <yy && yy<9 && !used[xx][yy] && a[xx][yy]==0){
                    que.add(new Point(xx,yy));
                    used[xx][yy] = true;
                    d[xx][yy] = d[v.x][v.y] + 1;
                }
            }
        }
        return d;
    }

    private static int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(next());
    }

    private static String next() throws IOException {
        while(!st.hasMoreTokens())
            st = new StringTokenizer(in.readLine());
        return st.nextToken();
    }
}


import java.awt.Point;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PipedWriter;
import java.io.PrintWriter;

import java.io.BufferedReader;
import java.util.StringTokenizer;

public class A {
    private static BufferedReader in;
    private static StringTokenizer st;
    private static PrintWriter out;

    public static void main(String[] args) throws NumberFormatException, IOException {

        in = new BufferedReader(new InputStreamReader(System.in));
        st = new StringTokenizer("");
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        while(n --> 0){
            int a[][] = new int[9][9];
            int cnt = 0;
            Point k1 = new Point(),k2 = new Point();
            for (int i = 1; i <= 8; i++) {
                String s = in.readLine();
                for (int j = 1; j <=8; j++) {
                    if(s.charAt(j-1)=='#'){
                        a[i][j] = -1;
                    }
                    if(s.charAt(j-1)=='K'){
                        if(cnt==0)
                            k1 = new Point(i,j);
                        else
                            k2 = new Point(i,j);
                        cnt++;
                    }
                }
            }
            if(n > 0)
                in.readLine();
            int dx[] = {2, 2,-2,-2};
            int dy[] = {2,-2, 2,-2};
            for (int i = 0; i < 4; i++) {
                int xx = k1.x + dx[i];
                int yy = k1.y + dy[i];
                if(0<xx && xx<9 && 0 <yy && yy<9){
                    if(a[xx][yy]==0)
                        a[xx][yy] = 1;
                }
            }
            boolean ok = false;
            for (int i = 0; i < 4; i++) {
                int xx = k2.x + dx[i];
                int yy = k2.y + dy[i];
                if(0 < xx && xx < 9 && 0 <yy && yy<9){
                    if(a[xx][yy] == 1){
                        ok = true;
                        break;
                    }
                }
            }
            if(ok){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }

        out.close();
    }

    private static int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(next());
    }

    private static String next() throws IOException {
        while(!st.hasMoreTokens())
            st = new StringTokenizer(in.readLine());
        return st.nextToken();
    }
}


import java.awt.Point;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;

import java.io.BufferedReader;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;

public class A {
    private static BufferedReader in;
    private static StringTokenizer st;
    private static PrintWriter out;
    private static int[][] a;

    public static void main(String[] args) throws NumberFormatException, IOException {

        in = new BufferedReader(new InputStreamReader(System.in));
        st = new StringTokenizer("");
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        while(n --> 0){
            a = new int[9][9];
            int cnt = 0;
            Point k1 = new Point(),k2 = new Point();
            for (int i = 1; i <= 8; i++) {
                String s = in.readLine();
                for (int j = 1; j <=8; j++) {
                    if(s.charAt(j-1)=='#'){
                        a[i][j] = -1;
                    }
                    if(s.charAt(j-1)=='K'){
                        if(cnt==0)
                            k1 = new Point(i,j);
                        else
                            k2 = new Point(i,j);
                        cnt++;
                    }
                }
            }
            if(n > 0)
                in.readLine();
            int d[][] = walk(k1);

            if(d[k2.x][k2.y] !=0 && d[k2.x][k2.y] % 2 == 0){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
        out.close();
    }

    private static int[][] walk(Point p) {
        Queue<Point> que = new LinkedList<Point>();
        que.add(p);
        boolean used[][] = new boolean[9][9];
        int d[][] = new int[9][9];
        int dx[] = {2, 2,-2,-2};
        int dy[] = {2,-2, 2,-2};
        used[p.x][p.y] = true;
        while(!que.isEmpty()){
            Point v = que.poll();
            for (int i = 0; i < 4; i++) {
                int xx = v.x + dx[i];
                int yy = v.y + dy[i];
                if(0 < xx && xx<9 && 0 <yy && yy<9 && !used[xx][yy]){
                    que.add(new Point(xx,yy));
                    used[xx][yy] = true;
                    d[xx][yy] = d[v.x][v.y] + 1;
                }
            }
        }
        return d;
    }

    private static int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(next());
    }

    private static String next() throws IOException {
        while(!st.hasMoreTokens())
            st = new StringTokenizer(in.readLine());
        return st.nextToken();
    }
}


import java.awt.Point;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PipedWriter;
import java.io.PrintWriter;

import java.io.BufferedReader;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;

public class A {
    private static BufferedReader in;
    private static StringTokenizer st;
    private static PrintWriter out;
    private static int[][] a;

    public static void main(String[] args) throws NumberFormatException, IOException {

        in = new BufferedReader(new InputStreamReader(System.in));
        st = new StringTokenizer("");
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        while(n --> 0){
            a = new int[9][9];
            int cnt = 0;
            Point k1 = new Point(),k2 = new Point();
            for (int i = 1; i <= 8; i++) {
                String s = in.readLine();
                for (int j = 1; j <=8; j++) {
                    if(s.charAt(j-1)=='#'){
                        a[i][j] = -1;
                    }
                    if(s.charAt(j-1)=='K'){
                        if(cnt==0)
                            k1 = new Point(i,j);
                        else
                            k2 = new Point(i,j);
                        cnt++;
                    }
                }
            }
            if(n > 0)
                in.readLine();
            int d[][] = walk(k1);
            if(d[k2.x][k2.y] !=0 && d[k2.x][k2.y] % 2 == 0){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
        out.close();
    }

    private static int[][] walk(Point p) {
        Queue<Point> que = new LinkedList<Point>();
        que.add(p);
        boolean used[][] = new boolean[9][9];

        int d[][] = new int[9][9];
        int dx[] = {2, 2,-2,-2};
        int dy[] = {2,-2, 2,-2};
        used[p.x][p.y] = true;
        while(!que.isEmpty()){
            Point v = que.poll();
            for (int i = 0; i < 4; i++) {
                int xx = v.x + dx[i];
                int yy = v.y + dy[i];
                if(0<xx && xx<9 && 0 <yy && yy<9 && !used[xx][yy] && a[xx][yy]==0){
                    que.add(new Point(xx,yy));
                    used[xx][yy] = true;
                    d[xx][yy] = d[v.x][v.y] + 1;
                }
            }
        }
        return d;
    }

    private static int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(next());
    }

    private static String next() throws IOException {
        while(!st.hasMoreTokens())
            st = new StringTokenizer(in.readLine());
        return st.nextToken();
    }
}


/*
<title> IN THE NAME OF GOD </title>
<p1> I'm faraz azadi ;) <p1>
<account's in algorithm's contest site> frez & frez_95 </account's>
<Github> frez-95 </Github>
*/
// code compile and test in g++(5.2.1) in Ubuntu
/*
 * khe kheli delam tange khonast nemidonam che vagt barmigardam khone ;((((
 * emrooz emtehane system amel ro naraftam az ye taraf bad shod chon soal ha kheli rahat bodan mesle inke az ye taraf khob shod mesle inke taysir khob gozashte romm
 */
#define EPS 1e-7
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<math.h>
#include<queue>
#include<cmath>
#include<stack>
#include <cstdio>
#define ll long long
#define ld long double
#define LSone(n) ((n)&(-n))
using namespace std;
int did[8][8];
int che[8][8];
int che1[8][8];
bool javab;
string arr[8];
int x,y;
int xx,yy;
void tab(int a,int b,int p)
{
	if(a>=0 && b>=0 && a<=7 && b<=7 && !javab && !did[a][b])
	{
		did[a][b]=1;
		che[a][b]=p;
		//cout<<a<<" "<<b<<"\n";
		if(arr[a][b]=='K' && (a!=x || b!=y));
		else
		{
			tab(a-2,b-2,p+1);
			tab(a-2,b+2,p+1);
			tab(a+2,b-2,p+1);
			tab(a+2,b+2,p+1);
		}
	}
}

void tab1(int a,int b,int p)
{
	if(a>=0 && b>=0 && a<=7 && b<=7 && !javab && !did[a][b])
	{
		did[a][b]=1;
		if(che[a][b]>0 && (che[a][b]-p)%2==0 && arr[a][b]!='#')javab=true;
		che1[a][b]=p;
		//cout<<a<<" "<<b<<"\n";
		if(arr[a][b]=='K' && (a!=x || b!=y));
		else
		{
			tab1(a-2,b-2,p+1);
			tab1(a-2,b+2,p+1);
			tab1(a+2,b-2,p+1);
			tab1(a+2,b+2,p+1);
		}
	}
}
int main()
{
	int T;cin>>T;

	while(T--)
	{
		for(int i=0;i<8;i++)cin>>arr[i];
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				did[i][j]=0;
				che[i][j]=che1[i][j]=0;
				if(arr[i][j]=='K')
				{
					x=i;
					y=j;
				}
			}
		}
		javab=false;
		tab(x,y,1);
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				did[i][j]=0;
				if((i!=x || j!=y) && arr[i][j]=='K')
				{
					xx=i;
					yy=j;
				}
			}
		}
		tab1(xx,yy,1);
		if(javab)cout<<"YES";
		else cout<<"NO";
		cout<<"\n";
	}
	return 0;
}


/*
<title> IN THE NAME OF GOD </title>
<p1> I'm faraz azadi ;) <p1>
<account's in algorithm's contest site> frez & frez_95 </account's>
<Github> frez-95 </Github>
*/
// code compile and test in g++(5.2.1) in Ubuntu
/*
 * khe kheli delam tange khonast nemidonam che vagt barmigardam khone ;((((
 * emrooz emtehane system amel ro naraftam az ye taraf bad shod chon soal ha kheli rahat bodan mesle inke az ye taraf khob shod mesle inke taysir khob gozashte romm
 */
#define EPS 1e-7
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<math.h>
#include<queue>
#include<cmath>
#include<stack>
#include <cstdio>
#define ll long long
#define ld long double
#define LSone(n) ((n)&(-n))
using namespace std;
int did[8][8];
bool javab;
string arr[8];
int x,y;
void tab(int a,int b)
{
	if(a>=0 && b>=0 && a<=7 && b<=7 && !javab && !did[a][b] && arr[a][b]!='#')
	{
		did[a][b]=1;
		//cout<<a<<" "<<b<<"\n";
		if(arr[a][b]=='K' && (a!=x || b!=y))javab=true;
		else
		{
			tab(a-2,b-2);
			tab(a-2,b+2);
			tab(a+2,b-2);
			tab(a+2,b+2);
		}
	}
}

int main()
{
	int T;cin>>T;

	while(T--)
	{
		for(int i=0;i<8;i++)cin>>arr[i];
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				did[i][j]=0;
				if(arr[i][j]=='K')
				{
					x=i;
					y=j;
				}
			}
		}
		javab=false;
		tab(x,y);
		if(javab)cout<<"YES";
		else cout<<"NO";
		cout<<"\n";
	}
	return 0;
}


/*
<title> IN THE NAME OF GOD </title>
<p1> I'm faraz azadi ;) <p1>
<account's in algorithm's contest site> frez & frez_95 </account's>
<Github> frez-95 </Github>
*/
// code compile and test in g++(5.2.1) in Ubuntu
/*
 * khe kheli delam tange khonast nemidonam che vagt barmigardam khone ;((((
 * emrooz emtehane system amel ro naraftam az ye taraf bad shod chon soal ha kheli rahat bodan mesle inke az ye taraf khob shod mesle inke taysir khob gozashte romm
 */
#define EPS 1e-7
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<math.h>
#include<queue>
#include<cmath>
#include<stack>
#include <cstdio>
#define ll long long
#define ld long double
#define LSone(n) ((n)&(-n))
using namespace std;
int did[8][8];
bool javab;
string arr[8];
int x,y;
void tab(int a,int b)
{
	if(a>=0 && b>=0 && a<=7 && b<=7 && !javab && !did[a][b])
	{
		did[a][b]=1;
		//cout<<a<<" "<<b<<"\n";
		if(arr[a][b]=='K' && (a!=x || b!=y))javab=true;
		else
		{
			tab(a-2,b-2);
			tab(a-2,b+2);
			tab(a+2,b-2);
			tab(a+2,b+2);
		}
	}
}

int main()
{
	int T;cin>>T;

	while(T--)
	{
		for(int i=0;i<8;i++)cin>>arr[i];
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				did[i][j]=0;
				if(arr[i][j]=='#')did[i][j]=1;
				if(arr[i][j]=='K')
				{
					x=i;
					y=j;
				}
			}
		}
		javab=false;
		tab(x,y);
		if(javab)cout<<"YES";
		else cout<<"NO";
		cout<<"\n";
	}
	return 0;
}


/*
<title> IN THE NAME OF GOD </title>
<p1> I'm faraz azadi ;) <p1>
<account's in algorithm's contest site> frez & frez_95 </account's>
<Github> frez-95 </Github>
*/
// code compile and test in g++(5.2.1) in Ubuntu
/*
 * khe kheli delam tange khonast nemidonam che vagt barmigardam khone ;((((
 * emrooz emtehane system amel ro naraftam az ye taraf bad shod chon soal ha kheli rahat bodan mesle inke az ye taraf khob shod mesle inke taysir khob gozashte romm
 */
#define EPS 1e-7
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<math.h>
#include<queue>
#include<cmath>
#include<stack>
#include <cstdio>
#define ll long long
#define ld long double
#define LSone(n) ((n)&(-n))
using namespace std;
int did[8][8];
bool javab;
string arr[8];
int x,y;
int xx,yy;
void tab(int a,int b)
{
	if(a>=0 && b>=0 && a<=7 && b<=7 && !javab && !did[a][b] && arr[a][b]!='#')
	{
		did[a][b]=1;
		//cout<<a<<" "<<b<<"\n";
		if(arr[a][b]=='K' && (a!=x || b!=y))javab=true;
		else
		{
			tab(a-2,b-2);
			tab(a-2,b+2);
			tab(a+2,b-2);
			tab(a+2,b+2);
		}
	}
}

int main()
{
	int T;cin>>T;

	while(T--)
	{
		for(int i=0;i<8;i++)cin>>arr[i];
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				did[i][j]=0;
				if(arr[i][j]=='K')
				{
					x=i;
					y=j;
				}
			}
		}
		javab=false;
		tab(x,y);
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				did[i][j]=0;
				if(i!=x && j!=y && arr[i][j]=='K')
				{
					xx=i;
					yy=j;
				}
			}
		}
		tab(xx,yy);
		if(javab)cout<<"YES";
		else cout<<"NO";
		cout<<"\n";
	}
	return 0;
}


/*
<title> IN THE NAME OF GOD </title>
<p1> I'm faraz azadi ;) <p1>
<account's in algorithm's contest site> frez & frez_95 </account's>
<Github> frez-95 </Github>
*/
// code compile and test in g++(5.2.1) in Ubuntu
/*
 * khe kheli delam tange khonast nemidonam che vagt barmigardam khone ;((((
 * emrooz emtehane system amel ro naraftam az ye taraf bad shod chon soal ha kheli rahat bodan mesle inke az ye taraf khob shod mesle inke taysir khob gozashte romm
 */
#define EPS 1e-7
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<math.h>
#include<queue>
#include<cmath>
#include<stack>
#include <cstdio>
#define ll long long
#define ld long double
#define LSone(n) ((n)&(-n))
using namespace std;
int did[8][8];
int che[8][8];
int che1[8][8];
bool javab;
string arr[8];
int x,y;
int xx,yy;
void tab(int a,int b,int p)
{
	if(a>=0 && b>=0 && a<=7 && b<=7 && !javab && !did[a][b])
	{
		did[a][b]=1;
		che[a][b]=p;
		//cout<<a<<" "<<b<<"\n";
		if(arr[a][b]=='K' && (a!=x || b!=y));
		else
		{
			tab(a-2,b-2,p+1);
			tab(a-2,b+2,p+1);
			tab(a+2,b-2,p+1);
			tab(a+2,b+2,p+1);
		}
	}
}

void tab1(int a,int b,int p)
{
	if(a>=0 && b>=0 && a<=7 && b<=7 && !javab && !did[a][b])
	{
		did[a][b]=1;
		if(che[a][b]>0 && (che[a][b]-p)%2==0)javab=true;
		che1[a][b]=p;
		//cout<<a<<" "<<b<<"\n";
		if(arr[a][b]=='K' && (a!=x || b!=y));
		else
		{
			tab1(a-2,b-2,p+1);
			tab1(a-2,b+2,p+1);
			tab1(a+2,b-2,p+1);
			tab1(a+2,b+2,p+1);
		}
	}
}
int main()
{
	int T;cin>>T;

	while(T--)
	{
		for(int i=0;i<8;i++)cin>>arr[i];
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				did[i][j]=0;
				che[i][j]=che1[i][j]=0;
				if(arr[i][j]=='#')did[i][j]=1;
				if(arr[i][j]=='K')
				{
					x=i;
					y=j;
				}
			}
		}
		javab=false;
		tab(x,y,1);
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				did[i][j]=0;
				if(arr[i][j]=='#')did[i][j]=1;
				if((i!=x || j!=y) && arr[i][j]=='K')
				{
					xx=i;
					yy=j;
				}
			}
		}
		tab1(xx,yy,1);
		if(javab)cout<<"YES";
		else cout<<"NO";
		cout<<"\n";
	}
	return 0;
}


/*
<title> IN THE NAME OF GOD </title>
<p1> I'm faraz azadi ;) <p1>
<account's in algorithm's contest site> frez & frez_95 </account's>
<Github> frez-95 </Github>
*/
// code compile and test in g++(5.2.1) in Ubuntu
/*
 * khe kheli delam tange khonast nemidonam che vagt barmigardam khone ;((((
 * emrooz emtehane system amel ro naraftam az ye taraf bad shod chon soal ha kheli rahat bodan mesle inke az ye taraf khob shod mesle inke taysir khob gozashte romm
 */
#define EPS 1e-7
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<math.h>
#include<queue>
#include<cmath>
#include<stack>
#include <cstdio>
#define ll long long
#define ld long double
#define LSone(n) ((n)&(-n))
using namespace std;
int did[8][8];
bool javab;
string arr[8];
int x,y;
void tab(int a,int b)
{
	if(a>=0 && b>=0 && a<=7 && b<=7 && !javab && !did[a][b])
	{
		did[a][b]=1;
		//cout<<a<<" "<<b<<"\n";
		if(arr[a][b]=='K' && (a!=x || b!=y))javab=true;
		else
		{
			tab(a-2,b-2);
			tab(a-2,b+2);
			tab(a+2,b-2);
			tab(a+2,b+2);
		}
	}
}
int main()
{
	int T;cin>>T;

	while(T--)
	{
		for(int i=0;i<8;i++)cin>>arr[i];

		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				did[i][j]=0;
				if(arr[i][j]=='K')
				{
					x=i;
					y=j;
				}
			}
		}
		javab=false;
		tab(x,y);
		if(javab)cout<<"YES";
		else cout<<"NO";
		cout<<"\n";
	}
	return 0;
}


  /*
  ***************************************************************************************************************

                            Author : SUBHENDU SETHI
                            Codechef Handle: subhendu_sethi
                            SPOJ Handle: codekatte
                            Codeforces Handle: subhendu_sethi
                            UVA Handle: codekatte

  **************************************************************************************************************
  */
  #include <bits/stdc++.h>
  #define ll long long int
  #define LD long double
  #define si(x) scanf("%d",&x)
  #define sl(x) scanf("%lld",&x)
  #define sd(x) scanf("%lf",&x)
  #define sc(x) scanf("%c",&x)
  #define ss(x) scanf("%s",x)
  #define vl vector<ll>
  #define vi vector<int>
  #define vvl vector< vl >
  #define vvi vector< vi >
  #define pb push_back
  #define mp make_pair
  #define MOD 1000000007
  #define MOD1 1000000000
  #define mem(x,y) memset(x,y,sizeof(x))
  #define f(i,a,b) for(ll i=(a);i<(b);i++)
  #define max_int_value 2147483647
  #define max_long_value 9223372036854775807
  #define ub(X,v) upper_bound(X.begin(),X.end(),v)
  #define lb(X,v) lower_bound(X.begin(),X.end(),v)
  #define ii pair<ll,ll>
  #define F first
  #define S second
  #define cons 5000
  #define MAXN 100050
  #define gc getchar_unlocked
  using namespace std;
  ll n,m;
  ll a,b,c;
  ll test  =1;
  ll anss(ll a, ll b)
  {
    return b==1?a:a/b+anss(b,a%b);
  }
  void prec()
  {

  }
  inline void read(void)
  {

  }
  const int dx[] = {-2, -2, 2, 2};
  const int dy[] = {-2, 2, -2, 2};
  bool good(ll x, ll y)
  {

  }
  vector<pair<ll,ll> >V;
  char arr[10][10];
  inline void solve()
  {
    f(i,0,8)
    {
      gets(arr[i]);
    }
    f(i,0,8)
    {
      f(j,0,8)
      {
        if(arr[i][j] == 'K')
          V.pb(mp(i,j));
      }
    }
    cout<<( ((V[0].first-V[1].first)%4==0 && (V[0].second-V[1].second)%4==0) ?"YES":"NO")<<endl;
  }
  int main()
  {
      ///dfs(cons);
      string ts;
      cin>>test;
      while(test--)
      {

        read();
        solve();
      }
      return 0;
  }
  // A MAN MUST MATH