#include <bits/stdc++.h>
using namespace std;
template <typename T0, typename T1>
std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) {
  for (typename map<T0, T1>::const_iterator p = v.begin(); p != v.end(); p++) {
    os << p->first << ": " << p->second << " ";
  }
  return os;
}
template <typename T0, typename T1>
std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) {
  os << v.first << ": " << v.second << " ";
  return os;
}
template <typename T>
std::ostream& operator<<(std::ostream& os, const vector<T>& v) {
  for (int i = 0; i < (int)v.size(); i++) {
    os << v[i] << " ";
  }
  return os;
}
template <typename T>
std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) {
  for (int i = 0; i < (int)v.size(); i++) {
    os << v[i] << endl;
  }
  return os;
}
template <typename T>
std::ostream& operator<<(std::ostream& os, const set<T>& v) {
  vector<T> tmp(v.begin(), v.end());
  os << tmp;
  return os;
}
template <typename T>
std::ostream& operator<<(std::ostream& os, const deque<T>& v) {
  vector<T> tmp(v.begin(), v.end());
  os << tmp;
  return os;
}
int main() {
  long long N;
  while (cin >> N) {
    for (int tt = 0, _n = (N); (tt) < (int)_n; ++tt) {
      vector<string> w(8);
      vector<vector<long long> > ww(8, vector<long long>(8));
      for (int i = 0, _n = (8); (i) < (int)_n; ++i) cin >> w[i];
      vector<long long> kx;
      for (int y = 0, _n = (8); (y) < (int)_n; ++y)
        for (int x = 0, _n = (8); (x) < (int)_n; ++x)
          if (w[y][x] == 'K') {
            kx.push_back(x);
            for (int yy = -8; yy <= 8; yy += 2)
              for (int xx = -8; xx <= 8; xx += 2) {
                int X = x + xx;
                int Y = y + yy;
                if (0 <= X && X < 8 && 0 <= Y && Y < 8 &&
                    (xx + yy) / 2 % 2 == 0)
                  ww[Y][X]++;
              }
          }
      bool ok = false;
      for (int y = 0, _n = (8); (y) < (int)_n; ++y)
        for (int x = 0, _n = (8); (x) < (int)_n; ++x)
          if (w[y][x] != '#' && ww[y][x] == 2) ok = true;
      if (abs(kx[0] - kx[1]) % 4 == 2) ok = false;
      cout << (ok ? "YES" : "NO") << endl;
    }
  }
  return 0;
}
