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