#include <bits/stdc++.h>
using namespace std;
bool u[10][11];
string s[11];
bool ok;
int d[22][22][2];
queue<pair<int, int> > q;
int curx, cury;
int id;
void check(int x, int y) {
  if (x < 0 || y < 0 || x > 7 || y > 7 || d[x][y][id] != -1) return;
  q.push(make_pair(x, y));
  d[x][y][id] = d[curx][cury][id] + 1;
}
void bfs(int x, int y) {
  d[x][y][id] = 0;
  q.push(make_pair(x, y));
  while (!q.empty()) {
    curx = q.front().first;
    cury = q.front().second;
    check(curx + 2, cury + 2);
    check(curx + 2, cury - 2);
    check(curx - 2, cury + 2);
    check(curx - 2, cury - 2);
    q.pop();
  }
}
bool good(int x, int y) {
  if (x < 0 || y < 0 || x > 7 || y > 7 || s[x][y] == '#') return 0;
  return 1;
}
bool solve() {
  memset(d, -1, sizeof(d));
  memset(u, 0, sizeof(u));
  for (int i = 0; i < 8; i++) cin >> s[i];
  ok = 0;
  int x, y, x1, y1;
  x = -1;
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 8; j++)
      if (s[i][j] == 'K') {
        if (x == -1)
          x = i, y = j;
        else
          x1 = i, y1 = j;
      }
  if ((x % 2) != (x1 % 2) || (y % 2) != (y1 % 2)) return 0;
  id = 0;
  bfs(x, y);
  id = 1;
  bfs(x1, y1);
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 8; j++)
      if (s[i][j] != -1 && d[i][j][0] != -1 && d[i][j][1] != -1) {
        if ((d[i][j][0] % 2) == (d[i][j][1] % 2)) {
          return 1;
        }
      }
  return 0;
}
int main() {
  int t;
  cin >> t;
  while (t--) puts(solve() ? "YES" : "NO");
  return 0;
}
