#include <bits/stdc++.h>
using namespace std;
int main() {
  char board[8][8];
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    int x1 = -1, x2 = -1, y1 = -1, y2 = -1;
    for (int j = 0; j < 8; ++j) {
      string str;
      cin >> str;
      for (int k = 0; k < 8; ++k) {
        board[j][k] = str[k];
        if (board[j][k] == 'K') {
          if (x1 == -1) {
            x1 = j;
            y1 = k;
          } else {
            x2 = j;
            y2 = k;
          }
        }
      }
    }
    bool good = false;
    for (int k1 = 0; k1 < 4; ++k1) {
      for (int k2 = 0; k2 < 4; ++k2) {
        if ((k1 + k2) % 2 == 0 && x2 + 2 * k1 - 2 * k2 == x1) {
          for (int k3 = 0; k3 < 4; ++k3) {
            for (int k4 = 0; k4 < 4; ++k4) {
              if ((k1 + k2) == (k3 + k4) && (y2 + 2 * k3 - 2 * k4) == y1) {
                good = true;
              }
            }
          }
        }
      }
    }
    if (good)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
