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