#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
void CI(int &_x) { scanf("%d", &_x); }
void CO(int &_x) { cout << _x; }
template <typename T>
void getarray(T a[], int n) {
  for (int i = 0; i < n; i++) cin >> a[i];
}
template <typename T>
void printarray(T a[], int n) {
  for (int i = 0; i < n - 1; i++) cout << a[i] << " ";
  cout << a[n - 1] << endl;
}
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
int dr8[8] = {1, -1, 0, 0, 1, -1, -1, 1};
int dc8[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dr4[4] = {0, 0, 1, -1};
int dc4[4] = {-1, 1, 0, 0};
int kn8r[8] = {1, 2, 2, 1, -1, -2, -2, -1};
int kn8c[8] = {2, 1, -1, -2, -2, -1, 1, 2};
char grid[12][12];
bool visit[12][12];
vector<int> G[100];
int dir_r[] = {2, -2, 2, -2};
int dir_c[] = {2, -2, -2, 2};
int dis[12][12];
bool bfs(int src_r, int src_c, int des_r, int des_c) {
  queue<int> Q;
  Q.push(src_r);
  Q.push(src_c);
  memset(dis, -1, sizeof dis);
  visit[src_r][src_c] = 1;
  dis[src_r][src_c] = 0;
  while (!Q.empty()) {
    int u_r = Q.front();
    Q.pop();
    int u_c = Q.front();
    Q.pop();
    for (int i = 0; i < 4; i++) {
      int v_r = u_r + dir_r[i];
      int v_c = u_c + dir_c[i];
      if (v_r < 1 || v_c < 1 || v_r > 8 || v_c > 8) continue;
      if (visit[v_r][v_c] == 0) {
        dis[v_r][v_c] = 1 + dis[u_r][u_c];
        visit[v_r][v_c] = 1;
        if (v_r == des_r && v_c == des_c) {
          return 1;
        }
        Q.push(v_r);
        Q.push(v_c);
      }
    }
  }
  return 0;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    memset(visit, 0, sizeof visit);
    vector<int> k_r, k_c;
    for (int i = 1; i <= 8; i++)
      for (int j = 1; j <= 8; j++) {
        cin >> grid[i][j];
        if (grid[i][j] == 'K') k_r.push_back(i), k_c.push_back(j);
      }
    bool ans = bfs(k_r[0], k_c[0], k_r[1], k_c[1]);
    if (dis[k_r[1]][k_c[1]] == -1 || dis[k_r[1]][k_c[1]] % 2 == 1) {
      puts("NO");
    } else
      puts("YES");
  }
  return 0;
}
