#include <bits/stdc++.h>
using namespace std;
struct State {
  int x1, x2, y1, y2;
  State() {}
  State(int _x1, int _y1, int _x2, int _y2) {
    x1 = _x1;
    x2 = _x2;
    y1 = _y1;
    y2 = _y2;
  }
};
bool used[8][8][8][8];
int t;
int xs[] = {2, 2, -2, -2};
int ys[] = {2, -2, 2, -2};
char board[8][8];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    memset(used, false, sizeof used);
    pair<int, int> sk[2];
    int p = 0;
    for (int i = 0; i < 8; ++i) {
      for (int j = 0; j < 8; ++j) {
        char chr;
        cin >> chr;
        board[i][j] = chr;
        if (chr == 'K') sk[p++] = make_pair(i, j);
      }
    }
    State first(sk[0].first, sk[0].second, sk[1].first, sk[1].second);
    queue<State> Q;
    Q.push(first);
    bool foundAns = false;
    while (!foundAns && !Q.empty()) {
      State u = Q.front();
      Q.pop();
      used[u.x1][u.y1][u.x2][u.y2] = true;
      for (int i = 0; !foundAns && i < 4; ++i) {
        int x1 = u.x1 + xs[i];
        int y1 = u.y1 + ys[i];
        if (x1 < 0 || x1 >= 8 || y1 < 0 || y1 > 8) continue;
        for (int j = 0; j < 4; ++j) {
          int x2 = u.x2 + xs[j];
          int y2 = u.y2 + ys[j];
          if (x2 < 0 || x2 >= 8 || y2 < 0 || y2 > 8) continue;
          if (used[x1][y1][x2][y2]) continue;
          if (x1 == x2 && y1 == y2 && board[x1][y1] != '#') {
            foundAns = true;
            break;
          }
          State v(x1, y1, x2, y2);
          Q.push(v);
          used[x1][y1][x2][y2] = true;
        }
      }
    }
    if (foundAns) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
