#include <bits/stdc++.h>
using namespace std;
char mp[20][20];
vector<int> vx, vy;
bool mark[20][20];
int dir[20][20];
int dist[20][20];
bool check(int r, int c) {
  if (r < 1 || c < 1 || r > 8 || c > 8) return false;
  return true;
}
void BFS(int r, int c) {
  mark[r][c] = true;
  dist[r][c] = 0;
  queue<int> qr, qc;
  qr.push(r);
  qc.push(c);
  int ur, uc, vr, vc;
  while (!qr.empty()) {
    ur = qr.front();
    uc = qc.front();
    qr.pop();
    qc.pop();
    dir[0][0] = ur - 2;
    dir[0][1] = uc + 2;
    dir[1][0] = ur - 2;
    dir[1][1] = uc - 2;
    dir[2][0] = ur + 2;
    dir[2][1] = uc + 2;
    dir[3][0] = ur + 2;
    dir[3][1] = uc - 2;
    for (int i = 0; i < 4; i++) {
      bool st = check(dir[i][0], dir[i][1]);
      if (st) {
        vr = dir[i][0], vc = dir[i][1];
        if (mark[vr][vc] == false) {
          mark[vr][vc] = true;
          dist[vr][vc] = dist[ur][uc] + 1;
          qr.push(vr);
          qc.push(vc);
        }
      }
    }
  }
}
int main() {
  int T, m;
  cin >> T;
  for (int k = 1; k <= T; k++) {
    vx.clear();
    vy.clear();
    memset(mp, '.', sizeof mp);
    memset(mark, false, sizeof mark);
    for (int i = 1; i < 9; i++) {
      for (int j = 1; j < 9; j++) {
        cin >> mp[i][j];
        if (mp[i][j] == 'K') {
          vx.push_back(i);
          vy.push_back(j);
        }
      }
    }
    bool st = false;
    for (int i = 1; i < 9; i++) {
      if (st) continue;
      for (int j = 1; j < 9; j++) {
        if (mp[i][j] != '#') {
          memset(mark, false, sizeof mark);
          memset(dist, 0, sizeof dist);
          BFS(i, j);
          if (mark[vx[0]][vy[0]] == true && mark[vx[1]][vy[1]] == true) {
            if (dist[vx[0]][vy[0]] % 2 == dist[vx[1]][vy[1]] % 2) st = true;
          }
        }
      }
    }
    if (st)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
