#include <bits/stdc++.h>
using namespace std;
int t;
char a[9][9];
int dx[4] = {2, 2, -2, -2}, dy[4] = {2, -2, 2, -2};
int b[9][9];
int c[9][9];
int dem1, dem2;
int kt;
void ktrak1(int x, int y) {
  int h, k;
  dem1++;
  for (int i = 0; i <= 3; i++) {
    h = x + dx[i];
    k = y + dy[i];
    if (h >= 1 && h <= 8 && k >= 1 && k <= 8 && b[h][k] == 1) {
      b[h][k] = 0;
      ktrak1(h, k);
    }
  }
}
void ktrak2(int x, int y) {
  int h, k;
  dem2++;
  for (int i = 0; i <= 3; i++) {
    h = x + dx[i];
    k = y + dy[i];
    if (h >= 1 && h <= 8 && k >= 1 && k <= 8 && c[h][k] == 1) {
      c[h][k] = 0;
      ktrak2(h, k);
    }
  }
}
int main() {
  cin >> t;
  while (t) {
    t--;
    kt = 0;
    dem1 = dem2 = 0;
    int x1 = 0, y1 = 0;
    int x2 = 0, y2 = 0;
    for (int i = 1; i <= 8; i++) {
      for (int j = 1; j <= 8; j++) {
        cin >> a[i][j];
        c[i][j] = b[i][j] = 1;
        if (a[i][j] == 'K') {
          if (x1 == 0) {
            x1 = i;
            y1 = j;
          } else {
            x2 = i;
            y2 = j;
          }
        }
      }
    }
    b[x1][y1] = 0;
    ktrak1(x1, y1);
    c[x2][y2] = 0;
    ktrak2(x2, y2);
    for (int i = 1; i <= 8; i++) {
      for (int j = 1; j <= 8; j++) {
        if (b[i][j] == c[i][j] && c[i][j] == 0 && a[i][j] != '#') {
          kt = 1;
          break;
        }
      }
      if (kt == 1) break;
    }
    if ((abs(x1 - x2) % 4) != 0 || (abs(y1 - y2) % 4) != 0) {
      kt = 0;
    }
    if (kt == 0)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
