#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
void upmin(T& a, const U& b) {
  a = min<T>(a, b);
}
template <typename T, typename U>
void upmax(T& a, const U& b) {
  a = max<T>(a, b);
}
template <typename T>
void uniq(T& a) {
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
}
void fast_io() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
bool in_rect(int x, int y, int w, int h) {
  return 0 <= x && x < w && 0 <= y && y < h;
}
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
void mark(vector<vector<int>>& b, int x, int y, int turn) {
  if (!in_rect(x, y, 8, 8) || b[y][x] != -1) return;
  b[y][x] = turn;
  int d[] = {-2, 2};
  for (int i = 0; i < (int)(2); i++)
    for (int j = 0; j < (int)(2); j++) {
      int nx = x + d[i], ny = y + d[j];
      mark(b, nx, ny, turn ^ 1);
    }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    char c[11][11];
    for (int y = 0; y < (int)(8); y++) cin >> c[y];
    vector<vector<int>> a[2];
    a[0] = a[1] = vector<vector<int>>(8, vector<int>(8, -1));
    int k = 0;
    for (int y = 0; y < (int)(8); y++)
      for (int x = 0; x < (int)(8); x++) {
        if (c[y][x] == 'K') mark(a[k++], x, y, 0);
      }
    string res = "NO";
    for (int y = 0; y < (int)(8); y++)
      for (int x = 0; x < (int)(8); x++)
        if (c[y][x] != '#' && a[0][y][x] != -1 && a[0][y][x] == a[1][y][x])
          res = "YES";
    cout << res << endl;
  }
}
