#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2")
#pragma GCC optimize("trapv")
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " : " << a << endl;
  err(++it, args...);
}
const int N = 10;
char board[N][N];
bool vis[N][N];
int dx[] = {2, 2, -2, -2};
int dy[] = {-2, 2, 2, -2};
void solve() {
  vector<pair<int, int> > knight;
  for (long long int i = 1; i < (9); ++i) {
    for (long long int j = 1; j < (9); ++j) {
      cin >> board[i][j];
      if (board[i][j] == 'K') knight.push_back({i, j});
    }
  }
  queue<pair<int, pair<int, int> > > q;
  bool chi = false;
  q.push({0, {knight[0].first, knight[0].second}});
  vis[knight[0].first][knight[0].second] = true;
  while ((q).size()) {
    int cy = q.front().second.first, cx = q.front().second.second,
        turno = q.front().first;
    q.pop();
    for (long long int i = 0; i < (4); ++i) {
      int ny = cy + dy[i], nx = cx + dx[i];
      if (ny > 8 or ny < 1 or nx > 8 or nx < 1) continue;
      if (vis[ny][nx]) continue;
      q.push({turno + 1, {ny, nx}});
      int val = (turno + 1) % 2;
      if (ny == knight[1].first and nx == knight[1].second and val == 0)
        chi = true;
      vis[ny][nx] = true;
    }
  }
  if (vis[knight[1].first][knight[1].second] and chi)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  for (long long int i = 0; i < (N); ++i)
    for (long long int j = 0; j < (N); ++j) vis[i][j] = false;
}
int main() {
  int cas;
  cin >> cas;
  while (cas--) solve();
  return 0;
}
