#include <bits/stdc++.h>
using namespace std;
int N;
char ar[15][15];
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= 8; j++) scanf(" %s", ar[j] + 1);
    int x1, y1, x2, y2;
    x1 = y1 = x2 = y2 = 0;
    for (int j = 1; j <= 8; j++)
      for (int k = 1; k <= 8; k++) {
        if (ar[j][k] == 'K' && !x1) {
          x1 = j;
          y1 = k;
        } else if (ar[j][k] == 'K') {
          x2 = j;
          y2 = k;
        }
      }
    int t1 = abs(x2 - x1);
    int t2 = abs(y2 - y1);
    if (t1 % 4 == 0 && t2 % 4 == 0)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
