#include <bits/stdc++.h>
using namespace std;
const int dr[] = {2, 2, -2, -2, 1, 1, -1, -1};
const int dc[] = {2, -2, 2, -2, 1, -1, -1, 1};
const double eps = 1e-9;
const int INF = 0x7FFFFFFF;
const long long INFLL = 0x7FFFFFFFFFFFFFFFLL;
const double pi = acos(-1);
template <class T>
T take(queue<T> &O) {
  T tmp = O.front();
  O.pop();
  return tmp;
}
template <class T>
T take(stack<T> &O) {
  T tmp = O.top();
  O.pop();
  return tmp;
}
template <class T>
T take(priority_queue<T> &O) {
  T tmp = O.top();
  O.pop();
  return tmp;
}
template <class T>
inline void getint(T &num) {
  bool neg = 0;
  num = 0;
  char c;
  while ((c = getchar_unlocked()) && (!isdigit(c) && c != '-'))
    ;
  if (c == '-') {
    neg = 1;
    c = getchar_unlocked();
  }
  do num = num * 10 + c - '0';
  while ((c = getchar_unlocked()) && isdigit(c));
  num *= (neg) ? -1 : 1;
}
void OPEN(string in = "input.txt", string out = "output.txt") {
  freopen(in.c_str(), "r", stdin);
  freopen(out.c_str(), "w", stdout);
  return;
}
char area[20][20];
int zz[20][20], n;
bool safe(int x, int y) { return x >= 0 && y >= 0 && x < 8 && y < 8; }
int main() {
  getint(n);
  for (int(tc) = (0), _t = (n); tc < (_t); ++(tc)) {
    memset(area, 0, sizeof(area));
    memset(zz, 0, sizeof(zz));
    for (int(i) = (0), _t = (8); i < (_t); ++(i)) scanf("%s", area[i]);
    for (int(i) = (0), _t = (8); i < (_t); ++(i)) fill(zz[i], zz[i] + 8, INF);
    int mask = 1, ada = 0;
    for (int(i) = (0), _t = (8); i < (_t); ++(i))
      for (int(j) = (0), _t = (8); j < (_t); ++(j))
        if (area[i][j] == 'K' && !ada) {
          if (mask-- == 1) {
            zz[i][j] = 0;
            queue<pair<int, int> > Q;
            Q.push(make_pair(i, j));
            zz[i][j] |= mask;
            while (!Q.empty()) {
              pair<int, int> now = take(Q);
              for (int(i) = (0), _t = (4); i < (_t); ++(i)) {
                int xx = now.first + dr[i];
                int yy = now.second + dc[i];
                if (safe(xx, yy) &&
                    zz[now.first][now.second] + 1 < zz[xx][yy]) {
                  zz[xx][yy] = zz[now.first][now.second] + 1;
                  Q.push(make_pair(xx, yy));
                }
              }
            }
          } else {
            if (zz[i][j] < INF && zz[i][j] % 2 == 0) {
              puts("YES");
              ada = 1;
            } else {
              puts("NO");
              ada = 1;
            }
          }
        }
    for (int(i) = (0), _t = (8); i < (_t); ++(i)) {
      for (int(j) = (0), _t = (8); j < (_t); ++(j)) {
      }
      {};
    }
  }
  return 0;
}
