#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[10];
  int T;
  scanf("%d", &T);
  while (T--) {
    int found = 0;
    int x1, x2, y1, y2;
    for (int j = 0; j < 8; j++) {
      scanf("%s", &str);
      for (int i = 0; i < 8; i++) {
        if (str[i] == 'K') {
          if (found) {
            x1 = j;
            y1 = i;
          } else {
            x2 = j;
            y2 = i;
            found = 1;
          }
        }
      }
    }
    printf(abs(x1 - x2) % 4 == 0 && abs(y1 - y2) % 4 == 0 ? "YES\n" : "NO\n");
  }
  return 0;
}
