// NOTE: it is recommended to use this even if you don't understand the following code.

#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

int    T, i, test;
char   board[8][10];
bool   ans;

int main() {
    // uncomment the two following lines if you want to read/write from files
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    assert(1 == scanf("%d", &T));
    for (test = 1; test <= T; ++test) {
        for (i = 0; i < 8; ++i)
            assert(1 == scanf("%s", board[i]));
        
        ans = true;
        
        
        // INSERT YOUR CODE HERE
        
        
        printf("%s\n", ans ? "YES" : "NO");
    }

    return 0;
}
