#include <bits/stdc++.h>
using namespace std;
int f(int x1, int y1, int x2, int y2) {
  if ((!(abs(x1 - x2) % 4) && !(abs(y1 - y2) % 4)) ||
      (!(abs(x1 - x2) % 2) && (abs(x1 - x2) % 4) && !(abs(y1 - y2) % 2) &&
       (abs(y1 - y2) % 4)))
    return max(abs(x1 - x2) / 2, abs(y1 - y2) / 2);
  else
    return 1;
}
int main() {
  int t;
  cin >> t;
  char g[8][8];
  int x1, y1, x2, y2;
  for (int q = 0; q < t; q++) {
    bool second = 0;
    for (int i = 0; i < 8; i++)
      for (int j = 0; j < 8; j++) {
        cin >> g[i][j];
        if (g[i][j] == 'K') {
          if (second) {
            x2 = i;
            y2 = j;
          } else {
            x1 = i;
            y1 = j;
            second = 1;
          }
        }
      }
    if (f(x1, y1, x2, y2) % 2 == 0)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
