#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  char c;
  vector<pair<int, int> > v;
  cin >> t;
  while (t--) {
    v.clear();
    for (int i = 0; i < 8; i++) {
      for (int j = 0; j < 8; j++) {
        cin >> c;
        if (c == 'K') v.push_back(make_pair(i, j));
      }
    }
    if (!((int)abs(v[0].first - v[1].first) % 4) &&
        !((int)abs(v[0].second - v[1].second) % 4))
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
