#include <bits/stdc++.h>
using namespace std;
struct xy {
  int x, y;
} fk, sk, ha[] = {{2, 2}, {2, -2}, {-2, 2}, {-2, -2}};
bool check(int x, int y) { return x >= 0 && y >= 0 && x < 8 && y < 8; }
int main() {
  int t, f;
  char visit[10][10];
  int mp1[10][10], mp2[10][10];
  string line;
  cin >> t;
  while (t--) {
    f = 1;
    memset(visit, '.', sizeof visit);
    memset(mp1, -1, sizeof mp1);
    memset(mp2, -1, sizeof mp2);
    for (int i = 0; i < 8; i++) {
      cin >> line;
      for (int j = 0; j < line.size(); j++) {
        if (line[j] == 'K' && f == 1)
          fk.x = i, fk.y = j, f++;
        else if (line[j] == 'K' && f == 2)
          sk.x = i, sk.y = j;
        else
          visit[i][j] = line[j];
      }
    }
    xy u, v;
    queue<xy> q;
    q.push(fk);
    mp1[fk.x][fk.y] = 0;
    while (!q.empty()) {
      u = q.front();
      q.pop();
      for (int i = 0; i < 4; i++) {
        v.x = u.x + ha[i].x, v.y = u.y + ha[i].y;
        if (check(v.x, v.y) && mp1[v.x][v.y] == -1) {
          mp1[v.x][v.y] = mp1[u.x][u.y] + 1;
          q.push(v);
        }
      }
    }
    queue<xy> qq;
    qq.push(sk);
    mp2[sk.x][sk.y] = 0;
    while (!qq.empty()) {
      u = qq.front();
      qq.pop();
      for (int i = 0; i < 4; i++) {
        v.x = u.x + ha[i].x, v.y = u.y + ha[i].y;
        if (check(v.x, v.y) && mp2[v.x][v.y] == -1) {
          mp2[v.x][v.y] = mp2[u.x][u.y] + 1;
          qq.push(v);
        }
      }
    }
    bool flag = 0;
    for (int i = 0; i < 8 && !flag; i++) {
      for (int j = 0; j < 8 && !flag; j++) {
        if (mp1[i][j] == mp2[i][j] && mp1[i][j] != -1) {
          cout << "YES" << endl;
          flag = 1;
          break;
        }
      }
    }
    if (!flag) cout << "NO" << endl;
  }
  return 0;
}
