#include <bits/stdc++.h>
using namespace std;
char s[10][10];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    for (int i = 1; i <= 8; i++) {
      for (int j = 1; j <= 8; j++) scanf(" %c", &s[i][j]);
    }
    int r = 0, ss = 0, x = 0, y = 0;
    for (int i = 1; i <= 8; i++) {
      for (int j = 1; j <= 8; j++) {
        if (s[i][j] == 'K') {
          if (r == 0) {
            r = i;
            ss = j;
          }
          if (r != 0) {
            x = i;
            y = j;
          }
        }
      }
    }
    if ((r - x) % 4 == 0 && (ss - y) % 4 == 0)
      printf("%s\n", "YES");
    else
      printf("%s\n", "NO");
  }
  return 0;
}
