#include <bits/stdc++.h>
using namespace std;
struct aa {
  int ax, ay, bx, by;
};
int a[8][8];
bool u[8][8][8][8];
int main() {
  int t;
  cin >> t;
  for (int k = 0; k < t; ++k) {
    aa s;
    s.ax = -1;
    for (int i = 0; i < 8; ++i) {
      for (int j = 0; j < 8; ++j) {
        char ch;
        cin >> ch;
        if (ch == '#') {
          a[i][j] = 1;
        } else {
          a[i][j] = 0;
        }
        if (ch == 'K') {
          if (s.ax == -1) {
            s.ax = i;
            s.ay = j;
          } else {
            s.bx = i;
            s.by = j;
          }
        }
      }
    }
    queue<aa> q;
    q.push(s);
    memset(u, false, sizeof(u));
    u[s.ax][s.ay][s.bx][s.by] = true;
    while (!q.empty()) {
      aa v = q.front();
      q.pop();
      for (int i1 = 0; i1 < 2; ++i1) {
        for (int j1 = 0; j1 < 2; ++j1) {
          for (int i2 = 0; i2 < 2; ++i2) {
            for (int j2 = 0; j2 < 2; ++j2) {
              aa v2 = v;
              v2.ax = v.ax + 4 * i1 - 2;
              v2.ay = v.ay + 4 * j1 - 2;
              v2.bx = v.bx + 4 * i2 - 2;
              v2.by = v.by + 4 * j2 - 2;
              if (v2.ax >= 0 && v2.ax < 8 && v2.ay >= 0 && v2.ay < 8 &&
                  v2.bx >= 0 && v2.bx < 8 && v2.by >= 0 && v2.by < 8) {
                if (!u[v2.ax][v2.ay][v2.bx][v2.by]) {
                  u[v2.ax][v2.ay][v2.bx][v2.by] = true;
                  q.push(v2);
                }
              }
            }
          }
        }
      }
    }
    bool fl = false;
    for (int i = 0; i < 8; ++i) {
      for (int j = 0; j < 8; ++j) {
        if (u[i][j][i][j]) {
          fl = true;
        }
      }
    }
    if (fl) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
