#include <bits/stdc++.h>
int x[4] = {-2, 2, -2, 2};
int y[4] = {-2, -2, 2, 2};
int t;
char s[10][10];
int v[10][10], b[10][10];
void visit(int xx, int yy) {
  for (int i = 0; i <= 3; i++) {
    if (xx + x[i] >= 1 && yy + y[i] >= 1 && xx + x[i] <= 8 && yy + y[i] <= 8 &&
        !b[xx + x[i]][yy + y[i]]) {
      v[xx + x[i]][yy + y[i]] = v[xx][yy] + 1;
      b[xx + x[i]][yy + y[i]] = 1;
      visit(xx + x[i], yy + y[i]);
    }
  }
}
int main() {
  scanf("%d", &t);
  while (t--) {
    int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
    memset(v, 0, sizeof(v));
    memset(b, 0, sizeof(b));
    for (int i = 1; i <= 8; i++) {
      scanf("%s", s[i]);
      for (int j = 8; j >= 1; j--) s[i][j] = s[i][j - 1];
      for (int j = 1; j <= 8; j++) {
        if (s[i][j] == 'K') {
          if (x1 == 0 && y1 == 0) {
            x1 = i;
            y1 = j;
            b[i][j] = 1;
          } else {
            x2 = i;
            y2 = j;
          }
        }
      }
    }
    visit(x1, y1);
    if (v[x2][y2] % 2 == 0 && v[x2][y2])
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
