#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  vector<bool> ans(t, false);
  for (int q = 0; q < t; q++) {
    char b[9][9];
    vector<pair<int, int> > k(2);
    int ki = 0;
    for (int i = 0; i < 8; i++) {
      cin >> b[i];
      for (int j = 0; j < 8; j++)
        if (b[i][j] == 'K') k[ki++] = make_pair(i, j);
    }
    for (int i = k[0].first % 2; i < 8; i += 2)
      for (int j = k[0].second % 2; j < 8; j += 2) {
        int dx1 = abs(i - k[0].first), dy1 = abs(j - k[0].second),
            dx2 = abs(i - k[1].first), dy2 = abs(j - k[1].second);
        if (b[i][j] != '#' && (dx1 + dy1) % 4 == 0 && (dx2 + dy2) % 4 == 0 &&
            max(dx1, dy1) % 4 == max(dx2, dy2) % 4) {
          ans[q] = true;
          goto con;
        }
      }
  con:;
  }
  for (int q = 0; q < t; q++)
    if (ans[q])
      cout << "YES\n";
    else
      cout << "NO\n";
}
