#include <bits/stdc++.h>
using namespace std;
template <class T>
T sq(T x) {
  return x * x;
}
const long long inf = 2147383647;
const double pi = 2 * acos(0.0);
const double eps = 1e-9;
const long long maxint = 2147483647;
const long long minint = -2147483648;
char grid[100][100];
int board[2][10][10];
int dir[4][2] = {{-2, 2}, {2, 2}, {2, -2}, {-2, -2}};
void dfs(int si, int sj, int k) {
  int i;
  for (i = 0; i < 4; i++) {
    int ti = si + dir[i][0];
    int tj = sj + dir[i][1];
    if (ti < 0 || ti >= 8 || tj < 0 || tj >= 8) continue;
    if (board[k][ti][tj] == -1) {
      board[k][ti][tj] = board[k][si][sj] + 1;
      dfs(ti, tj, k);
    }
  }
}
int main() {
  int kase;
  scanf("%d", &kase);
  while (kase--) {
    int i, j;
    for (i = 0; i < 8; i++) {
      scanf("%s", &grid[i][0]);
    }
    memset(board, -1, sizeof board);
    int k = 0;
    for (i = 0; i < 8; i++) {
      for (j = 0; j < 8; j++) {
        if (grid[i][j] == 'K') {
          board[k][i][j] = 0;
          dfs(i, j, k);
          k++;
        }
      }
    }
    for (i = 0; i < 8; i++) {
      for (j = 0; j < 8; j++) {
        if (board[0][i][j] == -1 || board[1][i][j] == -1) continue;
        board[0][i][j] %= 2;
        board[1][i][j] %= 2;
      }
    }
    bool pos = false;
    for (i = 0; i < 8; i++) {
      for (j = 0; j < 8; j++) {
        if (board[0][i][j] == -1 || board[1][i][j] == -1) continue;
        if (grid[i][j] == '#') continue;
        if (board[0][i][j] == board[1][i][j]) pos = true;
      }
    }
    if (pos)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
