#include <bits/stdc++.h>
using namespace std;
char s[10][10];
int t, i, j, o, x[2], y[2], ok;
int main() {
  scanf("%d", &t);
  while (t--) {
    for (i = o = 0; i < 8; i++) {
      scanf("%s", s + i);
      for (j = 0; j < 8; j++)
        if (s[i][j] == 'K') x[o] = i, y[o++] = j;
    }
    if (abs(x[0] - x[1]) % 4 || abs(y[0] - y[1]) % 4)
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
