#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int k1_row = -1, k1_col = -1, k2_row = -1, k2_col = -1;
  cin >> t;
  cin.ignore(numeric_limits<streamsize>::max(), '\n');
  for (int i = 0; i < t; i++) {
    for (int row = 0; row < 8; row++) {
      string line;
      getline(cin, line);
      for (int col = 0; col < 8; col++) {
        char c = line[col];
        if (c == 'K') {
          if (k1_row == -1) {
            k1_row = row;
            k1_col = col;
          } else {
            k2_row = row;
            k2_col = col;
          }
        }
      }
    }
    cin.ignore(numeric_limits<streamsize>::max(), '\n');
    if (((k1_row - k2_row) % 4 == 0) && ((k1_col - k2_col) % 4 == 0)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
    k1_row = -1;
    k1_col = -1;
    k2_row = -1;
    k2_col = -1;
  }
}
