#include <bits/stdc++.h>
time_t waktu = clock();
void gettime() {
  printf("\nTime : %.2lf", (clock() - waktu) / double(CLOCKS_PER_SEC));
}
bool comp(int a, int b) { return (a > b); }
using namespace std;
int hasil[2][10][10];
char data[10][10];
void cek(int indeks, int x, int y, int move) {
  if (x >= 0 && x < 8 && y >= 0 && y < 8 && hasil[indeks][x][y] == -1) {
    hasil[indeks][x][y] = move % 2;
    move++;
    cek(indeks, x + 2, y + 2, move);
    cek(indeks, x + 2, y - 2, move);
    cek(indeks, x - 2, y + 2, move);
    cek(indeks, x - 2, y - 2, move);
  }
}
int main() {
  int t, i, j, k, indeks;
  bool ans;
  scanf("%d\n", &t);
  for (i = 1; i <= t; i++) {
    indeks = 0;
    for (j = 0; j < 8; j++) scanf("%s\n", &data[j]);
    memset(hasil, -1, sizeof(hasil));
    for (j = 0; j < 8; j++)
      for (k = 0; k < 8; k++)
        if (data[j][k] == 'K') cek(indeks, j, k, 0), indeks++;
    ans = false;
    for (j = 0; j < 8; j++)
      for (k = 0; k < 8; k++)
        if (hasil[0][j][k] == hasil[1][j][k] && hasil[1][j][k] != -1 &&
            data[j][k] != '#')
          ans = true;
    printf(ans ? "YES\n" : "NO\n");
  }
  return 0;
}
