#include <bits/stdc++.h>
using namespace std;
template <typename T>
string tostr(const T& t) {
  ostringstream os;
  os << t;
  return os.str();
}
vector<string> G;
bool vis[15][15][15][15];
int dr[] = {2, -2, 2, -2};
int dc[] = {2, 2, -2, -2};
bool calc() {
  memset(vis, false, sizeof vis);
  int r1, c1, r2, c2;
  r1 = -1;
  for (int i = (int)(0); i <= (int)(8 - 1); ++i) {
    for (int j = (int)(0); j <= (int)(8 - 1); ++j) {
      if (G[i][j] == 'K') {
        if (r1 == -1) {
          r1 = i;
          c1 = j;
        } else {
          r2 = i;
          c2 = j;
        }
      }
    }
  }
  queue<int> q;
  q.push(r1);
  q.push(c1);
  q.push(r2);
  q.push(c2);
  while (!q.empty()) {
    r1 = q.front();
    q.pop();
    c1 = q.front();
    q.pop();
    r2 = q.front();
    q.pop();
    c2 = q.front();
    q.pop();
    if (r1 == r2 && c1 == c2 && G[r1][c1] != '#') return true;
    if (vis[r1][c1][r2][c2]) continue;
    vis[r1][c1][r2][c2] = true;
    for (int i = (int)(0); i <= (int)(4 - 1); ++i) {
      int nr1 = r1 + dr[i];
      int nc1 = c1 + dc[i];
      if (nr1 < 0 || nr1 >= 8 || nc1 < 0 || nc1 >= 8) continue;
      for (int j = (int)(0); j <= (int)(4 - 1); ++j) {
        int nr2 = r2 + dr[j];
        int nc2 = c2 + dc[j];
        if (nr2 < 0 || nr2 >= 8 || nc2 < 0 || nc2 >= 8) continue;
        q.push(nr1);
        q.push(nc1);
        q.push(nr2);
        q.push(nc2);
      }
    }
  }
  return false;
}
int main() {
  int ntests;
  cin >> ntests;
  for (int testnum = (int)(0); testnum <= (int)(ntests - 1); ++testnum) {
    G.clear();
    for (int i = (int)(0); i <= (int)(8 - 1); ++i) {
      string s;
      cin >> s;
      G.push_back(s);
    }
    bool ans = calc();
    if (ans)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
