#include <bits/stdc++.h>
using namespace std;
int dx[4] = {-2, +2, -2, +2};
int dy[4] = {-2, +2, +2, -2};
bool mark[10][10][2][201];
struct Tri {
  int first, second, T;
  Tri(int _X, int _Y, int _T) {
    first = _X;
    second = _Y;
    T = _T;
  }
};
void bfs(int x, int y, int num) {
  vector<Tri> q;
  q.push_back(Tri(x, y, 0));
  for (__typeof(((int)((q).size())) - 1) i = (0);
       i <= (((int)((q).size())) - 1); i++) {
    Tri v = q[i];
    mark[v.first][v.second][num][v.T] = true;
    for (__typeof(3) j = (0); j <= (3); j++) {
      Tri u = Tri(v.first + dx[j], v.second + dy[j], v.T + 1);
      if (u.first >= 1 && u.first <= 8 && u.second >= 1 && u.second <= 8 &&
          u.T <= 200)
        if (!mark[u.first][u.second][num][u.T]) {
          mark[u.first][u.second][num][u.T] = true;
          q.push_back(u);
        }
    }
  }
}
int t;
char a[10][10];
int main() {
  cin >> t;
  int cnt;
  bool ans;
  for (__typeof(t) i = (1); i <= (t); i++) {
    cnt = 0;
    memset(mark, 0, sizeof mark);
    for (__typeof(8) y = (1); y <= (8); y++)
      for (__typeof(8) x = (1); x <= (8); x++) {
        cin >> a[x][y];
        if (a[x][y] == 'K') {
          bfs(x, y, cnt);
          cnt++;
        }
      }
    ans = false;
    for (__typeof(8) y = (1); y <= (8); y++)
      if (!ans)
        for (__typeof(8) x = (1); x <= (8); x++)
          if (!ans && a[x][y] != '#')
            for (__typeof(200) tm = (0); tm <= (200); tm++)
              if (mark[x][y][0][tm] && mark[x][y][1][tm]) {
                ans = true;
                break;
              }
    if (cnt == 1) ans = true;
    if (ans)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
