#include <bits/stdc++.h>
char s[10][10];
bool judge(int a, int b) {
  int c[10] = {0, -2, -4, -6, -8, 2, 4, 6, 8};
  for (int x = 0; x < 9; x++)
    for (int y = 0; y < 9; y++) {
      if (s[a + c[x]][b + c[y]] != '#') return true;
    }
  return false;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int i, j;
    for (i = 0; i < 8; i++) scanf("%s", s[i]);
    int a[3], b[3];
    int k = 1;
    for (i = 0; i < 8; i++) {
      for (j = 0; j < 8; j++)
        if (s[i][j] == 'K') a[k] = i + 1, b[k++] = j + 1;
    }
    int c = -1, d = -1;
    if (a[1] == a[2] ||
        (a[1] + a[2]) % 2 == 0 && (abs(a[1] - a[2])) / 2 % 2 == 0)
      c = (a[1] + a[2]) / 2;
    if (b[1] == b[2] ||
        (b[1] + b[2]) % 2 == 0 && (abs(b[1] - b[2]) / 2) % 2 == 0)
      d = (b[1] + b[2]) / 2;
    bool flag = true;
    if (c != -1 && d != -1) {
      if (!judge(c, d)) flag = false;
    } else
      flag = false;
    if (flag)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
