#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void maximize(T& a, const T b) {
  if (b > a) a = b;
}
template <typename T>
inline void minimize(T& a, const T b) {
  if (b < a) a = b;
}
template <typename T>
inline T maximum(const T& a, const T& b) {
  return a > b ? a : b;
}
template <typename T>
inline T minimum(const T& a, const T& b) {
  return a < b ? a : b;
}
int scan() {
  char ch;
  bool neg = 0;
  while (!isdigit(ch = getchar())) neg |= (ch == '-');
  int x = ch - '0';
  while (isdigit(ch = getchar())) x = x * 10 + ch - '0';
  return neg ? -x : x;
}
int d[4][2] = {-2, -2, -2, 2, 2, -2, 2, 2};
int G[63][63], G0[63][63], G1[63][63], n, m;
struct node {
  int x, y, t;
  node(int x, int y, int t) : x(x), y(y), t(t) {}
  node() : node(0, 0, -1) {}
} k0, k1;
void handle(int x, int y, char ch) {
  if (ch == 'K') {
    if (k0.x == -1) {
      k0.x = x;
      k0.y = y;
    } else {
      k1.x = x;
      k1.y = y;
    }
  }
  G[x][y] = (ch == '#');
}
void init() {
  n = 2;
  char ch;
  memset(G, -1, sizeof(G));
  k0.x = -1;
  for (int i = 0; i < 8; ++i) {
    for (int j = 0; j < 8; ++j) handle(i + 2, j + 2, getchar());
    getchar();
  }
  getchar();
}
void do_work(node& x, int g[][63]) {
  memset(g, 0, sizeof(G0));
  queue<node> Q;
  Q.push(x);
  g[x.x][x.y] = -1;
  ;
  while (!Q.empty()) {
    node z = Q.front();
    ;
    Q.pop();
    for (int i = 0; i < 4; ++i) {
      int x = z.x + d[i][0];
      int y = z.y + d[i][1];
      if (G[x][y] == -1) continue;
      if (g[x][y]) continue;
      g[x][y] = -z.t;
      Q.push(node(x, y, -z.t));
    }
  }
}
bool work() {
  do_work(k0, G0);
  do_work(k1, G1);
  for (int i = 2; i <= 16; ++i)
    for (int j = 2; j <= 16; ++j)
      if (G[i][j] == 0 && G0[i][j] && (G0[i][j] == G1[i][j])) return 1;
  return 0;
}
int main() {
  int n = scan();
  while (n--) {
    ;
    init();
    puts(work() ? "YES" : "NO");
  }
}
