#include <bits/stdc++.h>
using namespace std;
const int NMax = 60;
char A[NMax][NMax];
int F[NMax][NMax], can[NMax][NMax];
bool check(int first, int second) {
  if (first >= 0 && first < 8 && second >= 0 && second < 8 && !F[first][second])
    return 1;
  return 0;
}
void DFS(int first, int second, int d) {
  F[first][second] = d;
  if (check(first - 2, second - 2)) DFS(first - 2, second - 2, d + 1);
  if (check(first + 2, second + 2)) DFS(first + 2, second + 2, d + 1);
  if (check(first - 2, second + 2)) DFS(first - 2, second + 2, d + 1);
  if (check(first + 2, second - 2)) DFS(first + 2, second - 2, d + 1);
}
int main() {
  int T;
  scanf("%d", &T);
  for (int I = 1; I <= T; I++) {
    memset(F, 0, sizeof(F));
    for (int i = 0; i < 8; i++) scanf("%s", A[i]);
    int x1 = -1, y1, x2, y2;
    for (int i = 0; i < 8; i++)
      for (int j = 0; j < 8; j++)
        if (A[i][j] == 'K') {
          if (x1 == -1)
            x1 = i, y1 = j;
          else {
            x2 = i, y2 = j;
            break;
          }
        }
    DFS(x1, y1, 0);
    if (F[x2][y2] % 2 == 0 && F[x2][y2])
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
