#include <bits/stdc++.h>
using namespace std;
char mp[10][10];
int t;
struct node {
  int x, y;
};
node s[2], tmp, now;
int mov[4][2] = {2, 2, 2, -2, -2, 2, -2, -2};
void bfs() {
  queue<node> q;
  q.push(s[0]);
  while (!q.empty()) {
    now = q.front();
    q.pop();
    if (now.x == s[1].x && now.y == s[1].y) {
      puts("YES");
      return;
    }
    for (int i = 0; i < 4; i++) {
      int xx = now.x + mov[i][0];
      int yy = now.y + mov[i][1];
      if (xx < 1 || yy < 1 || xx > 8 || yy > 1) {
        continue;
      }
      if (mp[xx][yy] == '.') {
        puts("-");
        tmp.x = xx;
        tmp.y = yy;
        q.push(tmp);
        mp[xx][yy] = '#';
      }
    }
  }
  puts("NO");
}
int main() {
  scanf("%d", &t);
  while (t--) {
    memset(mp, 0, sizeof(mp));
    int k = 0;
    for (int i = 1; i <= 8; i++) {
      for (int j = 1; j <= 8; j++) {
        cin >> mp[i][j];
        if (mp[i][j] == 'K') {
          s[k].x = i;
          s[k].y = j;
          k++;
        }
      }
    }
    int xx = abs(s[0].x - s[1].x) % 4;
    int yy = abs(s[0].y - s[1].y) % 4;
    int ans = 1;
    if (yy % 4 == 0 && xx % 4 == 0) {
      puts("YES");
      continue;
    } else {
      puts("NO");
      continue;
    }
  }
  return 0;
}
