#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int gcd(int xx, int yy) {
  while (yy != 0) {
    xx = xx % yy;
    swap(xx, yy);
  }
  return xx;
}
int lcm(int xx, int yy) { return (xx / gcd(xx, yy)) * yy; }
int Power(int a, int x, int base = -1) {
  if (base == -1) {
    if (x == 1)
      return a;
    else if (x == 0)
      return 1;
    int temp = Power(a, x / 2);
    temp = temp * temp;
    if (x % 2 == 1)
      return temp * a;
    else
      return temp;
  } else {
    if (x == 1)
      return a % base;
    else if (x == 0)
      return 1;
    int temp = Power(a, x / 2, base);
    temp = (1ll * temp * temp) % base;
    if (x % 2 == 1)
      return (1ll * temp * a) % base;
    else
      return temp;
  }
}
int n, x1, y_1, x2, y_2, test;
string s;
bool ok;
void DoSth() {}
void ReadInput() {
  ok = false;
  for (int i = (0), _b = (7); i <= _b; i++) {
    cin >> s;
    for (int j = (0), _b = (7); j <= _b; j++)
      if (s[j] == 'K')
        if (ok == false) {
          x1 = i;
          y_1 = j;
          ok = true;
        } else {
          x2 = i;
          y_2 = j;
        }
  }
  getchar();
}
void Process() {
  int a = abs(x1 - x2) % 4;
  int b = abs(y_1 - y_2) % 4;
  if (a == 0 && b == 0)
    cout << "YES";
  else
    cout << "NO";
  cout << endl;
}
int main() {
  cin >> test;
  while (test != 0) {
    ReadInput();
    Process();
    test--;
  }
  return 0;
}
