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