#include <bits/stdc++.h>
using namespace std;
ifstream fin;
ofstream fout;
FILE *outt, *inn;
int n;
string s;
char a[9][9];
int x[2], y[2];
bool is;
int main() {
  cin >> n;
  getline(cin, s);
  s.clear();
  for (int t = 1; t <= n; t++) {
    int tmp = 0;
    for (int i = 0; i < 8; i++) {
      getline(cin, s);
      for (int j = 0; j < 8; j++) {
        a[i][j] = s[j];
        if (a[i][j] == 'K') {
          x[tmp] = i;
          y[tmp] = j;
          a[i][j] = '.';
          tmp++;
        }
      }
      s.clear();
    }
    if (x[0] % 2 != x[1] % 2 || y[0] % 2 != y[1] % 2 ||
        ((x[0] + y[0]) % 4) != ((x[1] + y[1]) % 4)) {
      cout << "NO" << endl;
      goto here;
    }
    if ((x[0] / 2) % 2 != (x[1] / 2) % 2 || (y[0] / 2) % 2 != (y[1] / 2) % 2) {
      cout << "NO" << endl;
      goto here;
    }
    is = 0;
    for (int i = x[0] % 2; i < 8; i += 2) {
      for (int j = y[0] % 2; j < 8; j += 2) {
        if (((i + j) % 4) == ((x[0] + y[0]) % 4) && a[i][j] == '.') {
          cout << "YES" << endl;
          goto here;
        }
      }
    }
    cout << "NO" << endl;
  here:;
    getline(cin, s);
    s.clear();
  }
  return 0;
}
