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