#include <bits/stdc++.h>
using namespace std;
short k[8][8], k1[8][8], k2[8][8], t;
short l1, c1;
short l2, c2;
short dx[] = {2, 2, -2, -2};
short dy[] = {2, -2, 2, -2};
struct nod {
  short x, y;
  nod *nxt;
};
nod *p, *q;
inline void Init(short b[8][8]) {
  short i, j;
  for (i = 0; i < 8; ++i)
    for (j = 0; j < 8; ++j) b[i][j] = 65;
}
void Adaug(short lin, short col) {
  nod *z = new nod;
  z->x = lin;
  z->y = col;
  z->nxt = NULL;
  if (!p)
    p = q = z;
  else {
    q->nxt = z;
    q = q->nxt;
  }
}
void Elimin() {
  nod *k = p;
  p = p->nxt;
  delete k;
}
inline bool OK(int x, int y) { return x >= 0 && x <= 7 && y >= 0 && y <= 7; }
void Lee(short b[8][8], short lin, short col) {
  Adaug(lin, col);
  b[lin][col] = 0;
  while (p) {
    lin = p->x;
    col = p->y;
    for (short i = 0; i < 4; ++i)
      if (OK(lin + dx[i], col + dy[i]) &&
          b[lin][col] + 1 < b[lin + dx[i]][col + dy[i]]) {
        b[lin + dx[i]][col + dy[i]] = b[lin][col] + 1;
        Adaug(lin + dx[i], col + dy[i]);
      }
    Elimin();
  }
}
inline void OneB() {
  char x;
  short i, j;
  bool km = false;
  for (i = 0; i < 8; ++i) {
    for (j = 0; j < 8; ++j) {
      x = cin.get();
      switch (x) {
        case '.':
          k[i][j] = 1;
          break;
        case '#':
          k[i][j] = 0;
          break;
        case 'K':
          if (!km) {
            l1 = i;
            c1 = j;
            km = true;
          } else {
            l2 = i;
            c2 = j;
          }
          k[i][j] = -1;
          break;
      }
    }
    cin.get();
  }
  cin.get();
}
bool Meet() {
  short i, j;
  for (i = 0; i < 8; ++i)
    for (j = 0; j < 8; ++j)
      if (k1[i][j] == k2[i][j] && k1[i][j] != 65 && k[i][j] == 1) return true;
  return false;
}
void Rezolv() {
  bool ok = false;
  cin >> t;
  cin.get();
  for (short x = 1; x <= t; ++x) {
    Init(k1);
    Init(k2);
    OneB();
    Lee(k1, l1, c1);
    Lee(k2, l2, c2);
    ok = Meet();
    if (!ok && k1[l2][c2] == k2[l1][c1] && k1[l2][c2] != 65 &&
        k1[l2][c2] % 2 == 0)
      ok = true;
    if (ok)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
int main() {
  Rezolv();
  return 0;
}
