#include <bits/stdc++.h>
using namespace std;
string a[8], k[2][8];
bool f;
int rec(int q, int i, int j, int hod) {
  k[q][i][j] = hod + '0';
  if (i - 2 >= 0 && j - 2 >= 0 && k[q][i - 2][j - 2] == '.')
    rec(q, i - 2, j - 2, hod + 1);
  if (i - 2 >= 0 && j + 2 <= 7 && k[q][i - 2][j + 2] == '.')
    rec(q, i - 2, j + 2, hod + 1);
  if (i + 2 <= 7 && j - 2 >= 0 && k[q][i + 2][j - 2] == '.')
    rec(q, i + 2, j - 2, hod + 1);
  if (i + 2 <= 7 && j + 2 <= 7 && k[q][i + 2][j + 2] == '.')
    rec(q, i + 2, j + 2, hod + 1);
  return 0;
}
int main() {
  int n;
  cin >> n;
  for (int ii = 0; ii < n; ii++) {
    for (int i = 0; i < 8; i++) {
      cin >> a[i];
      k[0][i] = "........";
      k[1][i] = "........";
    }
    int i = 0, j = 0, q = 0;
    bool f1 = true;
    for (i = 0; i < 8; i++)
      for (j = 0; j < 8; j++)
        if (a[i][j] == 'K') {
          rec(q, i, j, 0);
          q++;
        }
    f = false;
    for (i = 0; i < 8; i++)
      for (j = 0; j < 8; j++)
        if (k[0][i][j] != '.' && k[1][i][j] != '.' && a[i][j] != '.' &&
            (k[0][i][j] - k[1][i][j]) % 2 == 0)
          f = true;
    if (f)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
