#include <bits/stdc++.h>
using namespace std;
char mp[10][10];
bool vis[10][10];
int Aview[10][10];
int Aview2[10][10];
int t, cnt;
int dir_x[4] = {2, -2, 2, -2};
int dir_y[4] = {2, 2, -2, -2};
struct node {
  int x, y;
  int t;
} p[3];
int main() {
  scanf("%d", &t);
  while (t--) {
    cnt = 0;
    memset(vis, false, sizeof(vis));
    memset(Aview, 0, sizeof(Aview));
    memset(Aview2, 0, sizeof(Aview2));
    for (int i = 0; i < 8; i++) scanf("%s", mp[i]);
    for (int i = 0; i < 8; i++) {
      for (int j = 0; j < 8; j++) {
        if (mp[i][j] == 'K') {
          p[cnt].x = i;
          p[cnt].y = j;
          p[cnt].t = 0;
          cnt++;
        }
      }
    }
    if (p[0].x == p[1].x && p[0].y == p[1].y) {
      puts("YES");
      continue;
    }
    bool flag = false;
    queue<node> q;
    q.push(p[0]);
    vis[p[0].x][p[0].y] = true;
    Aview[p[0].x][p[0].y] = 1;
    while (!q.empty()) {
      node tt = q.front();
      q.pop();
      for (int i = 0; i < 4; i++) {
        int X = tt.x + dir_x[i];
        int Y = tt.y + dir_y[i];
        if (X >= 0 && X < 8 && Y >= 0 && Y < 8) {
          if (vis[X][Y] == false) {
            vis[X][Y] = true;
            node d;
            d.x = X;
            d.y = Y;
            d.t = tt.t + 1;
            q.push(d);
            Aview[X][Y] = d.t;
          }
        }
      }
    }
    memset(vis, 0, sizeof(vis));
    while (!q.empty()) q.pop();
    q.push(p[1]);
    vis[p[1].x][p[1].y] = true;
    Aview2[p[1].x][p[1].y] = 1;
    while (!q.empty()) {
      node tt = q.front();
      q.pop();
      for (int i = 0; i < 4; i++) {
        int X = tt.x + dir_x[i];
        int Y = tt.y + dir_y[i];
        if (X >= 0 && X < 8 && Y >= 0 && Y < 8) {
          if (vis[X][Y] == false) {
            vis[X][Y] = true;
            node d;
            d.x = X;
            d.y = Y;
            d.t = tt.t + 1;
            q.push(d);
            Aview2[X][Y] = d.t;
          }
        }
      }
    }
    int ans = 0;
    for (int i = 0; i < 8; i++) {
      for (int j = 0; j < 8; j++)
        if (Aview[i][j] && Aview2[i][j] && Aview[i][j] == 2 &&
            Aview2[i][j] == 2) {
          flag = true;
          break;
        }
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
