#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    int x1, x2, y1, y2;
    string arr[8];
    for (int i = 0; i < 8; i++) cin >> arr[i];
    bool check = 0;
    for (int i = 0; i < 8; i++) {
      for (int j = 0; j < 8; j++) {
        if (arr[i][j] == 'K' && check == 0) {
          check = 1;
          x1 = j;
          y1 = i;
        } else if (arr[i][j] == 'K') {
          x2 = j;
          y2 = i;
        }
      }
    }
    if ((x1 == x2 && abs(y1 - y2) == 4) || (y1 == y2 && abs(x1 - x2) == 4))
      cout << "YES";
    else if (abs(x1 - x2) == 4 && abs(y1 - y2) == 4)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
  return 0;
}
