#include <bits/stdc++.h>
#pragma comment(linker, "/stack:30000000")
using namespace std;
const int mx[4] = {1, -1, 0, 0};
const int my[4] = {0, 0, 1, -1};
const int Direct[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
const int Nmax = 2100;
inline bool can(int x1, int y1, int x2, int y2) {
  int z1 = x2 - x1;
  int z2 = y2 - y1;
  if (z1 % 2 != 0 || z2 % 2 != 0) return false;
  return (z1 % 4 == z2 % 4);
}
inline int numb(int x1, int y1, int x2, int y2) {
  int z1 = x2 - x1;
  int z2 = y2 - y1;
  z2 = abs(z2);
  z1 = abs(z1);
  if (z1 % 2 != 0 || z2 % 2 != 0) return false;
  z1 /= 2;
  return z1 % 2;
}
void Go() {
  vector<string> str(9);
  pair<int, int> first(-1, -1), second(-1, -1);
  for (int i = 1; i <= 8; i++) {
    cin >> str[i];
    if (i == 1 && str[i][0] == ' ') cin >> str[i];
    str[i] = '#' + str[i];
    assert(str[i].size() == 9);
    for (int j = 1; j <= str[i].size() - 1; j++)
      if (str[i][j] == 'K') {
        if (first.first == -1)
          first = make_pair(i, j);
        else
          second = make_pair(i, j);
      }
  }
  for (int i = 1; i <= 8; i++)
    for (int j = 1; j <= 8; j++)
      if (can(first.first, first.second, i, j) &&
          can(second.first, second.second, i, j))
        if (str[i][j] != '#')
          if (numb(first.first, first.second, i, j) ==
              numb(second.first, second.second, i, j)) {
            cout << "YES\n";
            return;
          }
  cout << "NO\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  int t;
  cin >> t;
  string rub;
  for (; t; t--) {
    Go();
  }
  return 0;
}
