#include <bits/stdc++.h>
using namespace std;
int f[4][2] = {{-2, -2}, {-2, 2}, {2, -2}, {2, 2}};
char A[10][10];
int M[2][10][10];
void dfs(int tp, int r, int c, int step) {
  if (r < 1 || c < 1 || r > 8 || c > 8) return;
  if (M[tp][r][c] != -1) return;
  M[tp][r][c] = step;
  for (int p = 0; p < 4; p++) dfs(tp, r + f[p][0], c + f[p][1], step + 1);
}
bool ok() {
  int r, c;
  for (r = 1; r <= 8; r++)
    for (c = 1; c <= 8; c++)
      if (A[r][c] == '.')
        if (M[0][r][c] != -1 && M[1][r][c] != -1)
          if ((M[0][r][c] + M[1][r][c]) % 2 == 0) return true;
  return false;
}
int main() {
  int C, r, c;
  scanf("%d", &C);
  while (C--) {
    for (r = 1; r <= 8; r++) scanf("%s", A[r] + 1);
    for (r = 1; r <= 8; r++)
      for (c = 1; c <= 8; c++)
        if (A[r][c] == 'K') goto A;
  A:;
    memset(M, -1, sizeof(M));
    A[r][c] = '.';
    dfs(0, r, c, 0);
    for (r = 1; r <= 8; r++)
      for (c = 1; c <= 8; c++)
        if (A[r][c] == 'K') goto B;
  B:;
    A[r][c] = '.';
    dfs(1, r, c, 0);
    if (ok())
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
