#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  char s[8][9];
  int i, j, k1x = -1, k1y, k2x, k2y;
  while (T--) {
    for (i = 0; i < 8; i++) cin >> s[i];
    k1x = -1;
    for (i = 0; i < 8; i++) {
      for (j = 0; j < 8; j++) {
        if (s[i][j] == 'K') {
          if (k1x == -1)
            k1x = i + 1, k1y = j + 1;
          else
            k2x = i + 1, k2y = j + 1;
        }
      }
    }
    if (k1x == k2x) {
      if ((abs(k1y - k2y)) % 4 == 0)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else if (k1y == k2y) {
      if ((abs(k1x - k2x)) % 4 == 0)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else if (((abs(k1x - k2x)) % 4 == 0 && (abs(k1y - k2y)) % 4 == 0) ||
               ((abs(k1x - k2x)) % 4 == 0 && (abs(k1y - k2y)) % 4 == 0)) {
      cout << "YES" << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
