#include <bits/stdc++.h>
char board[8][8 + 1];
int main() {
  int n, i, j;
  int k1r, k1c, k2r, k2c;
  scanf("%d", &n);
  while (n--) {
    for (i = 0; i < 8; i++) {
      scanf("%s", board[i]);
    }
    k1r = -1;
    for (i = 0; i < 8; i++) {
      for (j = 0; j < 8; j++) {
        if (board[i][j] == 'K') {
          if (k1r == -1) {
            k1r = i, k1c = j;
          } else {
            k2r = i, k2c = j;
          }
        }
      }
    }
    if ((k1r - k2r) % 4 == 0 && (k1c - k2c) % 4 == 0) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
