#include <bits/stdc++.h>
using namespace std;
int _abs(int a) {
  int m = a > 0 ? a : a * (-1);
  return m;
}
int main() {
  char a[8][8];
  int n, i, j, kx1, ky1, kx2, ky2, t;
  bool flag;
  cin >> n;
  while (n--) {
    t = 0;
    for (i = 0; i < 8; i++)
      for (j = 0; j < 8; j++) {
        cin >> a[i][j];
        if (a[i][j] == 'K')
          if (t == 0)
            kx1 = i, ky1 = j, t = 1;
          else
            kx2 = i, ky2 = j;
      }
    if ((kx1 - kx2) % 2 == 1 || (ky1 - ky2) % 2 == 1) {
      cout << "NO" << endl;
      continue;
    }
    if (!(kx1 == kx2 && _abs(ky1 - ky2) == 4) &&
        !(_abs(ky1 - ky2) == 4 && _abs(kx1 - kx2) == 4) &&
        !(ky1 == ky2 && _abs(kx1 - kx2) == 4)) {
      cout << "NO" << endl;
      continue;
    }
    flag = false;
    for (i = kx1 % 2; i < 8; i += 2) {
      for (j = ky1 % 2; j < 8; j += 2) {
        if (a[i][j] == '.' || a[i][j] == 'K') {
          cout << "YES" << endl;
          flag = true;
          break;
        }
      }
      if (flag == true) break;
    }
    if (flag == false) cout << "NO" << endl;
  }
  return 0;
}
