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