#include <bits/stdc++.h>
using namespace std;
const int N = 111111;
const int INF = 1000000000, mod = 1000000007;
const long long LLINF = 1000000000000000000ll;
char s[8][8];
int can1[8][8], can2[8][8];
void bfs(int x, int y, int used[8][8]) {
  queue<int> qx, qy, dist;
  qx.push(x), qy.push(y);
  dist.push(0);
  while (!qx.empty()) {
    x = qx.front(), y = qy.front();
    int d = dist.front();
    qx.pop();
    qy.pop();
    dist.pop();
    if (x < 0 || x > 7 || y < 0 || y > 7) continue;
    if (used[x][y] != -1) continue;
    used[x][y] = d;
    qx.push(x - 2);
    qy.push(y - 2);
    dist.push(d ^ 1);
    qx.push(x - 2);
    qy.push(y + 2);
    dist.push(d ^ 1);
    qx.push(x + 2);
    qy.push(y - 2);
    dist.push(d ^ 1);
    qx.push(x + 2);
    qy.push(y + 2);
    dist.push(d ^ 1);
  }
}
void solve() {
  for (int i = 0; i < 8; ++i) {
    gets(s[i]);
    for (int j = 0; j < 8; ++j) {
      can1[i][j] = can2[i][j] = -1;
    }
  }
  int x1, x2, y1, y2;
  x1 = x2 = y1 = y2 = -1;
  for (int i = 0; i < 8; ++i) {
    for (int j = 0; j < 8; ++j) {
      if (s[i][j] == 'K') {
        if (x1 == -1) {
          x1 = i;
          y1 = j;
        } else {
          x2 = i;
          y2 = j;
        }
      }
    }
  }
  bfs(x1, y1, can1);
  bfs(x2, y2, can2);
  bool flag = 0;
  for (int i = 0; i < 8; ++i) {
    for (int j = 0; j < 8; ++j) {
      if (can1[i][j] == can2[i][j] && can1[i][j] != -1) {
        flag = 1;
      }
    }
  }
  puts(flag ? "YES" : "NO");
  gets(s[0]);
}
int main() {
  int t;
  scanf("%d\n", &t);
  while (t-- > 0) {
    solve();
  }
  return 0;
}
