#include <bits/stdc++.h>
char board[8][8];
int target[2];
int start[2];
int found;
void test() {
  if ((target[0] - start[0]) % 4) {
    found = 0;
    return;
  }
  if ((target[1] - start[1]) % 4) {
    found = 0;
    return;
  }
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 8; j++) {
      if ((i - target[0]) % 4) continue;
      if ((j - target[1]) % 4) continue;
      if (board[i][j] != '#') {
        found = 1;
        break;
      }
    }
}
int main() {
  int already;
  int q;
  scanf("%d\n", &q);
  char temp;
  while (q-- > 0) {
    already = 0;
    memset(board, 0, sizeof(board));
    for (int i = 0; i < 8; i++)
      for (int j = 0; j < 8; j++) {
        scanf("%1c", &temp);
        while (temp == '\n') {
          scanf("%1c", &temp);
        }
        board[i][j] = temp;
        if (!already && board[i][j] == 'K') {
          start[0] = i;
          start[1] = j;
          already = 1;
        }
        if (already && board[i][j] == 'K') {
          target[0] = i;
          target[1] = j;
        }
      }
    found = 0;
    test();
    if (found)
      printf("YES\n", found);
    else
      printf("NO\n", found);
  }
  return 0;
}
