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