#include <bits/stdc++.h>
using namespace std;
int N, i, j, k, x, y;
char C;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> N;
  for (i = 0; i < N; i++) {
    x = -1;
    for (j = 0; j < 8; j++) {
      for (k = 0; k < 8; k++) {
        cin >> C;
        if (C == 'K') {
          if (x == -1) {
            x = j;
            y = k;
          } else {
            if ((x - j) % 4 == 0 && (y - k) % 4 == 0) {
              cout << "YES\n";
            } else {
              cout << "NO\n";
            }
          }
        }
      }
    }
  }
}
