#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, coun, m[12][2];
  while (cin >> n) {
    while (n--) {
      coun = 0;
      getchar();
      for (i = 0; i < 8; i++) {
        for (j = 0; j < 8; j++) {
          char c = getchar();
          if (c == 'K') {
            m[coun][0] = i;
            m[coun++][1] = j;
          }
        }
        getchar();
      }
      int g = m[0][0] - m[1][0];
      int f = m[0][1] - m[1][1];
      if (g % 4 == 0 && f % 4 == 0)
        cout << "YES";
      else
        cout << "NO";
      cout << endl;
    }
  }
  return 0;
}
