#include <bits/stdc++.h>
using namespace std;
int abs(int x) { return x >= 0 ? x : -x; }
int main() {
  int n;
  cin >> n;
  while (n--) {
    vector<int> x;
    vector<int> y;
    char tmp;
    for (int i = 0; i < 8; i++) {
      for (int j = 0; j < 8; j++) {
        cin >> tmp;
        if (tmp == 'K') {
          x.push_back(i);
          y.push_back(j);
        }
      }
    }
    int tx, ty;
    tx = abs(x[0] - x[1]);
    ty = abs(y[0] - y[1]);
    if ((tx % 4 == 0) && (ty % 4 == 0) && ((tx + ty) % 4 == 0))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
