#include <bits/stdc++.h>
using namespace std;
int go[4][2] = {{-2, 2}, {-2, -2}, {2, 2}, {2, -2}};
char key[10][10];
int one[10][10], two[10][10];
int si, sj, ei, ej;
struct point {
  int x, y;
  point(int a, int b) {
    x = a;
    y = b;
  }
};
void bfs(int x, int y) {
  queue<point> Q;
  point temp(x, y);
  Q.push(temp);
  while (!Q.empty()) {
    point t = Q.front();
    Q.pop();
    for (int i = 0; i < 4; i++) {
      int nx = t.x + go[i][0];
      int ny = t.y + go[i][1];
      if (nx < 0 || nx >= 8) continue;
      if (ny < 0 || ny >= 8) continue;
      if (one[nx][ny] >= 0) continue;
      one[nx][ny] = one[t.x][t.y] + 1;
      point next(nx, ny);
      Q.push(next);
    }
  }
}
void bfs1(int x, int y) {
  queue<point> Q;
  point temp(x, y);
  Q.push(temp);
  while (!Q.empty()) {
    point t = Q.front();
    Q.pop();
    for (int i = 0; i < 4; i++) {
      int nx = t.x + go[i][0];
      int ny = t.y + go[i][1];
      if (nx < 0 || nx >= 8) continue;
      if (ny < 0 || ny >= 8) continue;
      if (two[nx][ny] >= 0) continue;
      two[nx][ny] = two[t.x][t.y] + 1;
      point next(nx, ny);
      Q.push(next);
    }
  }
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    memset(one, -1, sizeof(one));
    memset(two, -1, sizeof(two));
    bool flag = 0;
    for (int i = 0; i < 8; i++) {
      scanf("%s", key[i]);
      for (int j = 0; j < 8; j++) {
        if (key[i][j] == 'K') {
          if (!flag) {
            si = i;
            sj = j;
            flag = 1;
          } else {
            ei = i;
            ej = j;
          }
        }
      }
    }
    one[si][sj] = 0;
    bfs(si, sj);
    two[ei][ej] = 0;
    bfs1(ei, ej);
    bool done = 0;
    for (int i = 0; i < 8; i++) {
      for (int j = 0; j < 8; j++) {
        if (one[i][j] == -1) continue;
        if (two[i][j] == -1) continue;
        if ((one[i][j] % 2) == (two[i][j] % 2)) {
          done = 1;
          break;
        }
      }
    }
    if (done)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
