#include <bits/stdc++.h>
using namespace std;
pair<int, int> k[1];
char symbol;
int t, q = 0, len, difx, dify;
void init() {
  q = 0;
  for (int i = 0; i < 8; i++)
    for (int j = 0; j < 8; j++) {
      scanf("%1s", &symbol);
      if ((char)symbol == (char)'K') {
        k[q].first = i;
        k[q].second = j;
        q++;
      }
    }
}
bool solve() {
  bool a = false;
  difx = k[0].first - k[1].first;
  dify = k[0].second - k[1].second;
  len = difx * difx + dify * dify;
  if (len % 16 == 0) a = true;
  return a;
}
int main() {
  scanf("%d", &t);
  for (int z = 0; z < t; z++) {
    init();
    if (solve())
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
