#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-2, -2, 2, 2};
const int dy[] = {2, -2, 2, -2};
char g[8][9];
bool used[2][2][8][8];
void dfs(int i, int j, int k, bool par) {
  if (used[k][par][i][j]) return;
  used[k][par][i][j] = true;
  for (int it = 0, _n = (4); it < _n; ++it) {
    int i2 = i + dx[it];
    int j2 = j + dy[it];
    if (i2 < 0 || i2 >= 8 || j2 < 0 || j2 >= 8) continue;
    dfs(i2, j2, k, !par);
  }
}
void solveCase() {
  for (int i = 0, _n = (8); i < _n; ++i) gets(g[i]);
  memset((used), (0), sizeof((used)));
  int k = 0;
  for (int i = 0, _n = (8); i < _n; ++i)
    for (int j = 0, _n = (8); j < _n; ++j)
      if (g[i][j] == 'K') {
        dfs(i, j, k, 0);
        k++;
      }
  if (k != 2) throw 1;
  for (int i = 0, _n = (8); i < _n; ++i)
    for (int j = 0, _n = (8); j < _n; ++j)
      for (int z = 0, _n = (2); z < _n; ++z)
        if (g[i][j] != '#' && used[0][z][i][j] && used[1][z][i][j]) {
          puts("YES");
          gets(g[0]);
          return;
        }
  puts("NO");
  gets(g[0]);
}
void solution() {
  int tc;
  scanf("%d\n", &tc);
  for (int i = 0, _n = (tc); i < _n; ++i) solveCase();
}
int main() {
  solution();
  return 0;
}
