#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int main() {
  int T;
  cin >> T;
  while (T--) {
    char c;
    int x1 = -1, y1 = -1, x2 = -1, y2 = -1;
    for (int i = (0), _n = (8); i < _n; i++) {
      for (int j = (0), _n = (8); j < _n; j++) {
        cin >> c;
        if (c == 'K' && (x1 == -1 && y1 == -1)) {
          x1 = i;
          y1 = j;
        } else if (c == 'K' && (x2 == -1 && y2 == -1)) {
          x2 = i;
          y2 = j;
        }
      }
    }
    int a = abs(x2 - x1);
    int b = abs(y2 - y1);
    if (a % 4 == 0 && b % 4 == 0)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
