#include <bits/stdc++.h>
using namespace std;
int dx[] = {2, 2, -2, -2};
int dy[] = {2, -2, 2, -2};
bool hefa(int x, int y) {
  if (x < 0 || x >= 8 || y < 0 || y >= 8) return false;
  return true;
}
struct node {
  int x, y;
  int bu;
};
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    char cheat[100];
    gets(cheat);
    char a[8][100];
    int i;
    for (i = 0; i < 8; i++) gets(a[i]);
    int flag = 0;
    int j;
    int x, y;
    for (i = 0; i < 8; i++) {
      if (flag) break;
      for (j = 0; j < 8; j++) {
        if (a[i][j] == 'K') {
          x = i;
          y = j;
          flag = 1;
          a[i][j] = '.';
          break;
        }
      }
    }
    int newx, newy;
    flag = 0;
    int vis[8][8];
    memset(vis, 0, sizeof(vis));
    queue<node> q;
    node temp;
    temp.x = x;
    temp.y = y;
    temp.bu = 0;
    q.push(temp);
    vis[x][y] = 1;
    while (!q.empty()) {
      temp = q.front();
      q.pop();
      if (a[temp.x][temp.y] == 'K') {
        flag = 1;
        break;
      }
      int ii;
      for (ii = 0; ii < 4; ii++) {
        newx = temp.x + dx[ii];
        newy = temp.y + dy[ii];
        if (hefa(newx, newy) && vis[newx][newy] == 0) {
          node tt;
          tt.x = newx;
          tt.y = newy;
          tt.bu = temp.bu + 1;
          q.push(tt);
          vis[newx][newy] = 1;
        }
      }
    }
    if (flag && temp.bu % 2 == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
