#include <bits/stdc++.h>
using namespace std;
int difX[] = {2, 2, -2, -2};
int difY[] = {-2, 2, 2, -2};
bool dfs(int y, int x, const vector<string>& board,
         vector<vector<bool> >& vis) {
  vis[y][x] = true;
  if (board[y][x] != '#') return true;
  for (int i = 0; i < 4; ++i) {
    int nx = x + difX[i];
    int ny = y + difY[i];
    if (nx < 0 || nx >= 8 || ny < 0 || ny >= 8) continue;
    if (vis[ny][nx]) continue;
    if (dfs(ny, nx, board, vis)) return true;
  }
  return false;
}
int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  for (int c = 0; c < n; ++c) {
    vector<string> board(8);
    for (int i = 0; i < 8; ++i) cin >> board[i];
    bool found = false;
    vector<vector<bool> > possible(8, vector<bool>(8, false));
    for (int i = 0; !found && i < 8; ++i)
      for (int j = 0; !found && j < 8; ++j)
        if (board[i][j] == 'K')
          for (int k = 0; k < 4; ++k) {
            int nx = j + difX[k];
            int ny = i + difY[k];
            if (nx < 0 || nx >= 8 || ny < 0 || ny >= 8) continue;
            if (possible[ny][nx]) {
              vector<vector<bool> > vis(8, vector<bool>(8, false));
              if (dfs(ny, nx, board, vis)) {
                found = true;
                break;
              }
            }
            possible[ny][nx] = true;
          }
    if (found)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return EXIT_SUCCESS;
}
