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