#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const double pi = 2 * asin(1.0);
int n;
int m;
int a[8][8];
int b[8][8];
void bfs(int a[8][8], int i1, int j1) {
  pair<int, int> b[1000];
  int c[1000];
  int was[8][8];
  int l = -1, r = 0;
  b[0] = make_pair(i1, j1);
  memset(was, 0, sizeof(was));
  memset(c, 0, sizeof(c));
  while (l < r) {
    l++;
    if (!(b[l].first > -1 && b[l].second > -1 && b[l].first < 8 &&
          b[l].second < 8))
      continue;
    if (was[b[l].first][b[l].second] == 1) continue;
    a[b[l].first][b[l].second] = c[l];
    was[b[l].first][b[l].second] = 1;
    r++;
    b[r].first = b[l].first + 2;
    b[r].second = b[l].second + 2;
    c[r] = c[l] + 1;
    r++;
    b[r].first = b[l].first + 2;
    b[r].second = b[l].second - 2;
    c[r] = c[l] + 1;
    r++;
    b[r].first = b[l].first - 2;
    b[r].second = b[l].second + 2;
    c[r] = c[l] + 1;
    r++;
    b[r].first = b[l].first - 2;
    b[r].second = b[l].second - 2;
    c[r] = c[l] + 1;
  }
}
int main() {
  int t, j1, k1, j2, k2;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    int f = 0;
    j1 = 0;
    j2 = 0;
    k1 = 0;
    k2 = 0;
    for (int j = 0; j < 8; j++) {
      string s;
      cin >> s;
      for (int k = 0; k < 8; k++) {
        int ch = s[k];
        if (ch == '#')
          a[j][k] = 2;
        else
          a[j][k] = 0;
        if (ch == 'K' && f == 1) {
          j1 = j;
          k1 = k;
          f = 2;
        }
        if (ch == 'K' && f == 0) {
          j2 = j;
          k2 = k;
          f = 1;
        }
      }
    }
    f = 0;
    memcpy(b, a, sizeof(a));
    bfs(a, j1, k1);
    bfs(b, j2, k2);
    for (int j = 0; j < 8; j++) {
      for (int k = 0; k < 8; k++) {
        if (a[j][k] == 1 && a[j][k] == b[j][k]) {
          f = 1;
        }
      }
    }
    if (f == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
