#include <bits/stdc++.h>
using namespace std;
template <class T>
typename T::value_type arr_sum(const T& v, int n) {
  typename T::value_type sum = 0;
  for (int i = (0); i < (n); ++i) sum += v[i];
  return sum;
}
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
int main() {
  int n;
  cin >> n;
  vector<string> v(8);
  for (int i = (0); i < (n); ++i) {
    for (int i = 0; i < 8; ++i) cin >> v[i];
    ;
    vector<pair<int, int> > a;
    for (int j = (0); j < (8); ++j) {
      for (int k = (0); k < (8); ++k) {
        if (v[j][k] == 'K') {
          a.push_back({j, k});
        }
      }
    }
    if ((a[0].second - a[1].second) % 4 != 0) {
      cout << "NO"
           << "\n";
      continue;
    }
    if ((a[0].first - a[1].first) % 4 != 0) {
      cout << "NO"
           << "\n";
      continue;
    }
    cout << "YES"
         << "\n";
  }
}
