#include <bits/stdc++.h>
using namespace std;
int abs(int x) {
  if (x > 0)
    return x;
  else
    return -x;
}
char a[8][8];
int ans, i, j, t, x1, asdasd, x2, adadsa, flag;
int main() {
  cin >> t;
  for (int tt = 0; tt < t; tt++) {
    x1 = -1;
    for (i = 0; i < 8; i++)
      for (j = 0; j < 8; j++) {
        cin >> a[i][j];
        if (a[i][j] == 'K') {
          if (x1 == -1) {
            x1 = i;
            asdasd = j;
          } else {
            x2 = i;
            adadsa = j;
          }
        }
      }
    ans = 0;
    for (i = 0; i < 8; i++)
      for (j = 0; j < 8; j++) {
        int q1 = abs(x1 - i), w1 = abs(asdasd - j), q2 = abs(x2 - i),
            w2 = abs(adadsa - j);
        if ((q1 % 4 == 0) && (q2 % 4 == 0) && (w1 % 4 == 0) && (w2 % 4 == 0))
          ans = 1;
        if ((q1 % 4 == 2) && (q2 % 4 == 2) && (w1 % 4 == 2) && (w2 % 4 == 2))
          ans = 1;
      }
    if (ans == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
