#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const int N = 10;
char str[N][N];
int n = 8, ans, way[4][2] = {2, 2, 2, -2, -2, 2, -2, -2};
int flag[N][N][N][N];
void dfs(int x, int y, int u, int v) {
  flag[x][y][u][v] = 1;
  if (x == u && v == y && str[x][y] != '#') {
    ans = 1;
    return;
  }
  if (ans) return;
  for (int i = 0; i < 4; i++) {
    int xx = x + way[i][0];
    int yy = y + way[i][1];
    if (xx >= 0 && xx < n && yy >= 0 && yy < n) {
      for (int j = 0; j < 4; j++) {
        int uu = u + way[j][0];
        int vv = v + way[j][1];
        if (uu >= 0 && uu < n && vv >= 0 && vv < n) {
          if (!flag[xx][yy][uu][vv]) {
            dfs(xx, yy, uu, vv);
          }
        }
      }
    }
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int x = -1, y = -1, u = -1, v = -1;
    for (int i = 0; i < n; i++) {
      cin >> str[i];
      for (int j = 0; j < n; j++) {
        if (str[i][j] == 'K') {
          if (x == -1) {
            x = i;
            y = j;
          } else
            u = i, v = j;
          str[i][j] = '.';
        }
      }
    }
    ans = 0;
    memset(flag, 0, sizeof(flag));
    dfs(x, y, u, v);
    puts(ans ? "YES" : "NO");
  }
  return 0;
}
