#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    vector<string> s(8);
    int x1, y1, x2, y2;
    for (int i = 0; i < 8; i++) cin >> s[i];
    int f = 0;
    for (int i = 0; i < 8 and f != 2; i++) {
      for (int j = 0; j < 8 and f != 2; j++) {
        if (s[i][j] == 'K' and !f) {
          x1 = i;
          y1 = j;
          f = 1;
        } else if (s[i][j] == 'K' and f == 1) {
          x2 = i;
          y2 = j;
          f = 2;
        }
      }
    }
    int xmx = max(x1, x2);
    int xmn = min(x1, x2);
    int xd = xmx - xmn;
    int ymx = max(y1, y2);
    int ymn = min(y1, y2);
    int yd = ymx - ymn;
    if (xd % 4 == 0 and yd % 4 == 0)
      cout << "YES" << endl << endl;
    else
      cout << "NO" << endl << endl;
  }
  return 0;
}
