#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;
          }
        }
      }
    }
    int dx = x2 - x1;
    int dy = y2 - y1;
    if (dx & 1 || dy & 1) {
      cout << "NO" << endl;
      continue;
    }
    if ((dx / 2) & 1 || (dy / 2) & 1) {
      cout << "NO" << endl;
      continue;
    } else {
      cout << "YES" << endl;
    }
  }
  return 0;
}
