#include <bits/stdc++.h>
using namespace std;
int mas[10][10];
int bad[10][10];
int on1[10][10];
int on2[10][10];
int di[4] = {2, 2, -2, -2};
int dj[4] = {2, -2, 2, -2};
bool res;
void go(int i, int j, int me, int odd) {
  if (mas[i][j] != 0) {
    if ((mas[i][j] != me) && (!bad[i][j]) && (on2[i][j] == odd)) res = true;
    if (mas[i][j] == me) return;
  }
  mas[i][j] = me;
  on1[i][j] = odd;
  for (int h = 0; h < 4; h++) {
    int ni = i + di[h];
    int nj = j + dj[h];
    if ((ni < 0) || (nj < 0)) continue;
    if ((ni > 7) || (nj > 7)) continue;
    go(ni, nj, me, ((odd + 1) % 2));
  }
}
void go2(int i, int j, int me, int odd) {
  if (mas[i][j] != 0) {
    if ((mas[i][j] != me) && (!bad[i][j]) && (on1[i][j] == odd)) res = true;
    if (mas[i][j] == me) return;
  }
  mas[i][j] = me;
  on2[i][j] = odd;
  for (int h = 0; h < 4; h++) {
    int ni = i + di[h];
    int nj = j + dj[h];
    if ((ni < 0) || (nj < 0)) continue;
    if ((ni > 7) || (nj > 7)) continue;
    go(ni, nj, me, ((odd + 1) % 2));
  }
}
int main() {
  int t;
  scanf("%d ", &t);
  for (int s = 0; s < t; s++) {
    res = false;
    memset(mas, 0, sizeof mas);
    memset(bad, 0, sizeof bad);
    memset(on1, -1, sizeof on1);
    memset(on2, -1, sizeof on2);
    vector<pair<int, int> > vec;
    for (int i = 0; i < 8; i++)
      for (int j = 0; j < 8; j++) {
        char ff;
        scanf("%c ", &ff);
        if (ff == '#') bad[i][j] = 1;
        if (ff == 'K') {
          vec.push_back(make_pair(i, j));
        }
      }
    bool f = false;
    go(vec[0].first, vec[0].second, 1, 0);
    go2(vec[1].first, vec[1].second, 2, 0);
    if (res)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
