#include <bits/stdc++.h>
using namespace std;
int visitedA[8][8];
int visitedB[8][8];
void dfsWalk(int i, int j, int (&visited)[8][8], int val) {
  if (visited[i][j]) return;
  if (i < 0) return;
  if (i >= 8) return;
  if (j < 0) return;
  if (j >= 8) return;
  visited[i][j] = val;
  int nextVal = 2;
  if (val == 2) nextVal = 1;
  dfsWalk(i - 2, j - 2, visited, nextVal);
  dfsWalk(i + 2, j - 2, visited, nextVal);
  dfsWalk(i + 2, j + 2, visited, nextVal);
  dfsWalk(i - 2, j + 2, visited, nextVal);
}
bool solve(int ai, int aj, int bi, int bj, const bool badpoints[8][8]) {
  for (size_t i = 0; i < (size_t)(8); i++)
    for (size_t j = 0; j < (size_t)(8); j++) visitedA[i][j] = 0;
  for (size_t i = 0; i < (size_t)(8); i++)
    for (size_t j = 0; j < (size_t)(8); j++) visitedB[i][j] = 0;
  dfsWalk(ai, aj, visitedA, 1);
  dfsWalk(bi, bj, visitedB, 1);
  for (size_t i = 0; i < (size_t)(8); i++)
    for (size_t j = 0; j < (size_t)(8); j++) {
      if (visitedA[i][j] != 0 && visitedA[i][j] == visitedB[i][j] &&
          !badpoints[i][j])
        return true;
    }
  return false;
}
int main() {
  int N;
  cin >> N;
  bool badPoints[8][8];
  for (size_t tt = 0; tt < (size_t)(N); tt++) {
    int ai, aj, bi, bj;
    ai = -1;
    for (size_t i = 0; i < (size_t)(8); i++)
      for (size_t j = 0; j < (size_t)(8); j++) {
        char c;
        cin >> c;
        if (c == 'K') {
          if (ai == -1) {
            ai = i;
            aj = j;
          } else {
            bi = i;
            bj = j;
          }
          badPoints[i][j] = false;
        }
        if (c == '.') badPoints[i][j] = false;
        if (c == '#') badPoints[i][j] = true;
      }
    bool answ = solve(ai, aj, bi, bj, badPoints);
    if (answ) cout << "YES" << endl;
    if (!answ) cout << "NO" << endl;
  }
}
