#include <bits/stdc++.h>
using namespace std;
char c;
int main() {
  int n;
  cin >> n;
  while (n--) {
    int f = 1;
    int x, y, x2, y2;
    for (int i = 0; i < 8; i++)
      for (int j = 0; j < 8; j++) {
        cin >> c;
        if (c == 'K' && f) {
          x = i;
          y = j;
          f = 0;
        } else if (c == 'K')
          x2 = i, y2 = j;
      }
    (((x2 - x) % 4 == 0) && ((y2 - y) % 4 == 0)) ? cout << "YES\n"
                                                 : cout << "NO\n";
  }
  return 0;
}
