#include <bits/stdc++.h>   using namespace std;   char s[10];   int v[10][10];   int dx[4] = {-2, -2, 2, 2}, dy[4] = {2, -2, 2, -2};   int sx, sy, ex, ey;   int mark[10][10];   int ans;   void dfs(int curx, int cury, int curnum) {     for (int i = 0; i < 4; i++) {       int tempx = curx + dx[i];       int tempy = cury + dy[i];       if (tempx >= 1 && tempx <= 8 && tempy >= 1 && tempy <= 8 &&           !mark[tempx][tempy]) {         mark[tempx][tempy] = curnum + 1;         dfs(tempx, tempy, curnum + 1);       }     }   }   int const nMax = 1;   int main() {     int t;     scanf( %d , &t);     while (t--) {       sx = -1;       memset(mark, 0, sizeof(mark));       memset(v, 0, sizeof(v));       getchar();       for (int i = 1; i <= 8; i++) {         gets(s);         for (int j = 0; j < 8; j++) {           if (s[j] ==  # )             v[i][j + 1] = -1;           else if (s[j] ==  . ) {             v[i][j + 1] = 0;           } else {             v[i][j + 1] = 0;             if (sx != -1) {               ex = i;               ey = j + 1;             } else {               sx = i;               sy = j + 1;             }           }         }       }       if (abs(sx - ex) % 2 != 0 || abs(sy - ey) % 2 != 0) {         puts( NO );         continue;       }       dfs(sx, sy, 0);       if (mark[ex][ey] % 2 == 0 && mark[ex][ey] != 0)         puts( YES );       else         puts( NO );     }     return 0;   }   