#include <bits/stdc++.h>
using namespace std;
int main() {
  int pp;
  cin >> pp;
  while (pp--) {
    int x1 = -1, x2, y1, y2;
    for (int i = 0; i < 8; i++)
      for (int j = 0; j < 8; j++) {
        char s;
        cin >> s;
        if (s == 'K')
          if (x1 == -1) {
            x1 = i;
            y1 = j;
          } else {
            x2 = i;
            y2 = j;
          }
      }
    if (abs(x1 - x2) % 4 == 0 && abs(y1 - y2) % 4 == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
