#include <bits/stdc++.h>
using namespace std;
char board[8][8];
int visited[8][8][2];
int dist[8][8][2];
vector<pair<int, int> > diff;
vector<pair<int, int> > q;
int q_place;
void bfs(int f) {
  if (q_place == q.size()) return;
  int a = q[q_place].first / 8;
  int b = q[q_place].first % 8;
  int d = q[q_place].second;
  q_place++;
  visited[a][b][f] = 1;
  dist[a][b][f] = d;
  for (int i = 0; i < (4); i++) {
    if (0 <= a + diff[i].first && a + diff[i].first < 8 &&
        0 <= b + diff[i].second && b + diff[i].second < 8 &&
        !visited[a + diff[i].first][b + diff[i].second][f])
      q.push_back(
          make_pair((a + diff[i].first) * 8 + b + diff[i].second, d + 1));
  }
  bfs(f);
}
int main(void) {
  int n, ki, kj, kki, kkj;
  diff.push_back(make_pair(2, 2));
  diff.push_back(make_pair(2, -2));
  diff.push_back(make_pair(-2, 2));
  diff.push_back(make_pair(-2, -2));
  cin >> n;
  while (n--) {
    ki = kj = -1;
    kki = kkj = -1;
    for (int i = 0; i < (8); i++)
      for (int j = 0; j < (8); j++) {
        cin >> board[i][j];
        visited[i][j][0] = visited[i][j][1] = 0;
        dist[i][j][0] = dist[i][j][1] = -1;
        if (board[i][j] == 'K' && ki == -1) {
          ki = i;
          kj = j;
        } else if (board[i][j] == 'K') {
          kki = i;
          kkj = j;
        }
      }
    q.clear();
    q.push_back(make_pair(ki * 8 + kj, 0));
    q_place = 0;
    bfs(0);
    q.clear();
    q.push_back(make_pair(kki * 8 + kkj, 0));
    q_place = 0;
    bfs(1);
    int f = 0;
    for (int i = 0; i < (8); i++)
      for (int j = 0; j < (8); j++)
        if ((visited[i][j][0] && visited[i][j][1]) && (board[i][j] != '#') &&
            ((dist[i][j][0] + dist[i][j][1]) % 2 == 0))
          f = 1;
    cout << (f ? "YES\n" : "NO\n");
  }
  return 0;
}
