#include <bits/stdc++.h>
using namespace std;
struct Position {
  int X;
  int Y;
};
bool isSameDiagonal(Position first, Position second) {
  if ((first.X - second.X) % 4 == 0 && (first.Y - second.Y) % 4 == 0)
    return true;
  return false;
}
void readBoard(Position& first, Position& second) {
  char ch;
  bool findFirst = false;
  for (int i = 0; i < 8; ++i) {
    for (int j = 0; j < 8; ++j) {
      cin >> ch;
      if ('K' == ch) {
        if (findFirst) {
          second.X = i;
          second.Y = j;
        } else {
          first.X = i;
          first.Y = j;
          findFirst = true;
        }
      }
    }
  }
}
string calculate(Position& first, Position& second) {
  if (isSameDiagonal(first, second)) return "YES";
  return "NO";
}
void execute() {
  int boards;
  cin >> boards;
  Position first;
  Position second;
  vector<string> result;
  for (int i = 0; i < boards; ++i) {
    readBoard(first, second);
    result.push_back(calculate(first, second));
  }
  std::vector<string>::iterator begin = result.begin();
  std::vector<string>::iterator end = result.end();
  for (std::vector<string>::iterator it = begin; it != end; ++it) {
    cout << (*it) << endl;
  }
}
int main() {
  execute();
  return 0;
}
