  /*
  ***************************************************************************************************************

                            Author : SUBHENDU SETHI
                            Codechef Handle: subhendu_sethi
                            SPOJ Handle: codekatte
                            Codeforces Handle: subhendu_sethi
                            UVA Handle: codekatte

  **************************************************************************************************************
  */
  #include <bits/stdc++.h>
  #define ll long long int
  #define LD long double
  #define si(x) scanf("%d",&x)
  #define sl(x) scanf("%lld",&x)
  #define sd(x) scanf("%lf",&x)
  #define sc(x) scanf("%c",&x)
  #define ss(x) scanf("%s",x)
  #define vl vector<ll>
  #define vi vector<int>
  #define vvl vector< vl >
  #define vvi vector< vi >
  #define pb push_back
  #define mp make_pair
  #define MOD 1000000007
  #define MOD1 1000000000
  #define mem(x,y) memset(x,y,sizeof(x))
  #define f(i,a,b) for(ll i=(a);i<(b);i++)
  #define max_int_value 2147483647
  #define max_long_value 9223372036854775807
  #define ub(X,v) upper_bound(X.begin(),X.end(),v)
  #define lb(X,v) lower_bound(X.begin(),X.end(),v)
  #define ii pair<ll,ll>
  #define F first
  #define S second
  #define cons 5000
  #define MAXN 100050
  #define gc getchar_unlocked
  using namespace std;
  ll n,m;
  ll a,b,c;
  ll test  =1;
  ll anss(ll a, ll b)
  {
    return b==1?a:a/b+anss(b,a%b);
  }
  void prec()
  {

  }
  inline void read(void)
  {

  }
  const int dx[] = {-2, -2, 2, 2};
  const int dy[] = {-2, 2, -2, 2};
  bool good(ll x, ll y)
  {

  }
  vector<pair<ll,ll> >V;
  char arr[10][10];
  inline void solve()
  {
    f(i,0,8)
    {
      scanf("%s",arr[i]);
    }
    f(i,0,8)
    {
      f(j,0,8)
      {
        if(arr[i][j] == 'K')
          V.pb(mp(i,j));
      }
    }
    cout<<( (abs(V[0].first-V[1].first)%4==0 && abs(V[0].second-V[1].second)%4==0) ?"YES":"NO")<<endl;
    V.clear();
  }
  int main()
  {
      ///dfs(cons);
      string ts;
      cin>>test;
      while(test--)
      {

        read();
        solve();
      }
      return 0;
  }
  // A MAN MUST MATH


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define FOR(i,a) for (int i=0;i<(a);++i)
#define FORD(i,a) for (int i=(a)-1;i>=0;i--)
#define FORT(i,a,b) for (int i=(a);i<=(b);++i)
#define FORTD(i,b,a) for (int i=(b);i>=(a);--i)
#define trav(i,v) for (auto i : v)
#define all(v) v.begin(),v.end()
#define ad push_back
#define fr first
#define sc second
#define mpr(a,b) make_pair(a,b)
#define pir pair<int,int>
#define make_unique(v) v.erase(unique(all(v)),v.end())
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define srng mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define y1 EsiHancagorcRepa

const int N=1e6+6;
const ll MOD=1e9+7;
const ll MOD2=998244353;

string c[10];

int main() {
    fastio;
    srng;
    #ifdef ALEXPC
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int ttt;
    cin>>ttt;
    while(ttt--){
        FOR(i,8){
            cin>>c[i];
        }
        bool ka=false;
        int x1=0,x2=0,y1=0,y2=0;
        FOR(i,8)FOR(j,8){
            if (c[i][j]=='K'){
                if (ka){
                    x2=i;
                    y2=j;
                }
                else{
                    x1=i;
                    y1=j;
                    ka=true;
                }
            }
        }
        //cout<<x1<<" "<<y1<<" "<<x2<<" "<<y2<<endl;
        if ((abs(x1-x2)+abs(y1-y2))%4 || max(abs(x1-x2),abs(y1-y2))%4){
            cout<<"NO"<<endl;
            continue;
        }
        cout<<"YES"<<endl;
    }

    return 0;
}//hello


#include <bits/stdc++.h>
using namespace std;
typedef pair < int , int > ii;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define For(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define db(x) cout << #x << " = " << (x) << endl;
#define dba(a,x,y) {cout << #a << " :";For(i, (x), (y))cout<<" "<<(a)[(i)];cout<<endl;}
#define F first
#define S second

int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
int LCM(int a, int b){
   return (a*b)/gcd(a,b);
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;
int n, xl, yl, xr, yr;
char str[10];

void solve()
{
	n = 8;
	xl = 0;
	for (int i = 1; i <= n; ++i)
	{
		scanf("%s", str + 1);
		for (int j = 1; j <= n; ++j)
			if (str[j] == 'K')
				if (!xl)
					xl = i, yl = j;
				else
				xr = i, yr = j;
	}
	cout << ((abs(xl - xr) % 4 == 0 && abs(yl - yr) % 4 == 0) ? ("YES") : ("NO")) << endl;
}
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	int t;
	cin>>t;
	while(t--) solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair < int , int > ii;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define For(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define db(x) cout << #x << " = " << (x) << endl;
#define dba(a,x,y) {cout << #a << " :";For(i, (x), (y))cout<<" "<<(a)[(i)];cout<<endl;}
#define F first
#define S second

int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
int LCM(int a, int b){
   return (a*b)/gcd(a,b);
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;
int n, xl, yl, xr, yr;
char str[10];

void solve()
{
	n = 8;
	xl = 0;
	for (int i = 1; i <= n; ++i)
	{
		scanf("%s", str + 1);
		for (int j = 1; j <= n; ++j)
			if (str[j] == 'K')
				if (!xl)
					xl = i, yl = j;
				else
				xr = i, yr = j;
	}
	cout << ((abs(xl - xr) % 4 == 0 && abs(yl - yr) % 4 == 0) ? ("YES") : ("NO")) << endl;
}
int main(){
	//std::ios::sync_with_stdio(0);
	//cin.tie(0);
	int t;
	cin>>t;
	while(t--) solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair < int , int > ii;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define For(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define db(x) cout << #x << " = " << (x) << endl;
#define dba(a,x,y) {cout << #a << " :";For(i, (x), (y))cout<<" "<<(a)[(i)];cout<<endl;}
#define F first
#define S second

int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
int LCM(int a, int b){
   return (a*b)/gcd(a,b);
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;

void solve(){
	int i,j;
	char A[8][9],B[8][9],C[8][9];
	vector < ii > Semiknights;
	rep(i,8){
		cin>>A[i];
		rep(j,8){
			B[i][j] = '.';
			C[i][j] = '.';
			if(A[i][j]=='K'){
				Semiknights.pb(ii(i,j));
			}
		}
	}
	queue < ii > Q;
	Q.push(Semiknights[0]);
	while(!Q.empty()){
		ii k = Q.front();
		Q.pop();
		B[k.F][k.S] = 'K';
		if(k.F+2<8 && k.S+2<8 && B[k.F+2][k.S+2]!='K'){
			Q.push(ii(k.F+2,k.S+2));
		}
		if(k.F+2<8 && k.S-2>=0 && B[k.F+2][k.S-2]!='K'){
			Q.push(ii(k.F+2,k.S-2));
		}
		if(k.F-2>=0 && k.S+2<8 && B[k.F-2][k.S+2]!='K'){
			Q.push(ii(k.F-2,k.S+2));
		}
		if(k.F-2 >=0 && k.S-2>=0 && B[k.F-2][k.S-2]!='K'){
			Q.push(ii(k.F-2,k.S-2));
		}
	}
	// find all possible positions by
	Q.push(Semiknights[1]);
	while(!Q.empty()){
		ii k = Q.front();
		Q.pop();
		C[k.F][k.S] ='K';
		if(k.F+2<8 && k.S+2<8 && C[k.F+2][k.S+2]!='K'){
			Q.push(ii(k.F+2,k.S+2));
		}
		if(k.F+2<8 && k.S-2>=0 && C[k.F+2][k.S-2]!='K'){
			Q.push(ii(k.F+2,k.S-2));
		}
		if(k.F-2>=0 && k.S+2<8 && C[k.F-2][k.S+2]!='K'){
			Q.push(ii(k.F-2,k.S+2));
		}
		if(k.F-2 >=0 && k.S-2>=0 && C[k.F-2][k.S-2]!='K'){
			Q.push(ii(k.F-2,k.S-2));
		}
	}
	rep(i,8){
		rep(j,8){
			if(B[i][j]=='K' && C[i][j]=='K' && A[i][j]!='#'){
				cout<<"YES"<<endl;
				return ;
			}
		}
	}
	cout<<"NO"<<endl;
	return ;
}
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	int t;
	cin>>t;
	while(t--) solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair < int , int > ii;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define For(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define db(x) cout << #x << " = " << (x) << endl;
#define dba(a,x,y) {cout << #a << " :";For(i, (x), (y))cout<<" "<<(a)[(i)];cout<<endl;}
#define F first
#define S second

int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
int LCM(int a, int b){
   return (a*b)/gcd(a,b);
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;

void solve(){
	int i,j;
	char A[8][9],B[8][9],C[8][9];
	vector < ii > Semiknights;
	rep(i,8){
		cin>>A[i];
		rep(j,8){
			B[i][j] = '.';
			C[i][j] = '.';
			if(A[i][j]=='K'){
				Semiknights.pb(ii(i,j));
			}
		}
	}
	queue < ii > Q;
	Q.push(Semiknights[0]);
	while(!Q.empty()){
		ii k = Q.front();
		Q.pop();
		B[k.F][k.S] = 'K';
		if(k.F+2<8 && k.S+2<8 && B[k.F+2][k.S+2]=='.'){
			Q.push(ii(k.F+2,k.S+2));
		}
		if(k.F+2<8 && k.S-2>=0 && B[k.F+2][k.S-2]=='.'){
			Q.push(ii(k.F+2,k.S-2));
		}
		if(k.F-2>=0 && k.S+2<8 && B[k.F-2][k.S+2]=='.'){
			Q.push(ii(k.F-2,k.S+2));
		}
		if(k.F-2 >=0 && k.S-2>=0 && B[k.F-2][k.S-2]=='.'){
			Q.push(ii(k.F-2,k.S-2));
		}
	}
	// find all possible positions by
	Q.push(Semiknights[1]);
	while(!Q.empty()){
		ii k = Q.front();
		Q.pop();
		C[k.F][k.S] ='K';
		if(k.F+2<8 && k.S+2<8 && C[k.F+2][k.S+2]=='.'){
			Q.push(ii(k.F+2,k.S+2));
		}
		if(k.F+2<8 && k.S-2>=0 && C[k.F+2][k.S-2]=='.'){
			Q.push(ii(k.F+2,k.S-2));
		}
		if(k.F-2>=0 && k.S+2<8 && C[k.F-2][k.S+2]=='.'){
			Q.push(ii(k.F-2,k.S+2));
		}
		if(k.F-2 >=0 && k.S-2>=0 && C[k.F-2][k.S-2]=='.'){
			Q.push(ii(k.F-2,k.S-2));
		}
	}
	rep(i,8){
		rep(j,8){
			if(B[i][j]=='K' && C[i][j]=='K' && A[i][j]!='#'){
				cout<<"YES"<<endl;
				return ;
			}
		}
	}
	cout<<"NO"<<endl;
	return ;
}
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	int t;
	cin>>t;
	while(t--) solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef pair < int , int > ii;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define For(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define db(x) cout << #x << " = " << (x) << endl;
#define dba(a,x,y) {cout << #a << " :";For(i, (x), (y))cout<<" "<<(a)[(i)];cout<<endl;}
#define F first
#define S second

int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
int LCM(int a, int b){
   return (a*b)/gcd(a,b);
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;

void solve(){
	int i,j;
	char A[8][9],B[8][9],C[8][9];
	vector < ii > Semiknights;
	rep(i,8){
		cin>>A[i];
		rep(j,8){
			B[i][j] = '.';
			C[i][j] = '.';
			if(A[i][j]=='K'){
				Semiknights.pb(ii(i,j));
			}
		}
	}
	queue < ii > Q;
	Q.push(Semiknights[0]);
	while(!Q.empty()){
		ii k = Q.front();
		Q.pop();
		B[k.F][k.S] = 'K';
		if(k.F+2<8 && k.S+2<8 && B[k.F+2][k.S+2]=='.'){
			Q.push(ii(k.F+2,k.S+2));
		}
		else if(k.F+2<8 && k.S-2>=0 && B[k.F+2][k.S-2]=='.'){
			Q.push(ii(k.F+2,k.S-2));
		}
		else if(k.F-2>=0 && k.S+2<8 && B[k.F-2][k.S+2]=='.'){
			Q.push(ii(k.F-2,k.S+2));
		}
		else if(k.F-2 >=0 && k.S-2>=0 && B[k.F-2][k.S-2]=='.'){
			Q.push(ii(k.F-2,k.S-2));
		}
	}
	// find all possible positions by
	Q.push(Semiknights[1]);
	while(!Q.empty()){
		ii k = Q.front();
		Q.pop();
		C[k.F][k.S] ='K';
		if(k.F+2<8 && k.S+2<8 && C[k.F+2][k.S+2]=='.'){
			Q.push(ii(k.F+2,k.S+2));
		}
		else if(k.F+2<8 && k.S-2>=0 && C[k.F+2][k.S-2]=='.'){
			Q.push(ii(k.F+2,k.S-2));
		}
		else if(k.F-2>=0 && k.S+2<8 && C[k.F-2][k.S+2]=='.'){
			Q.push(ii(k.F-2,k.S+2));
		}
		else if(k.F-2 >=0 && k.S-2>=0 && C[k.F-2][k.S-2]=='.'){
			Q.push(ii(k.F-2,k.S-2));
		}
	}
	rep(i,8){
		rep(j,8){
			if(B[i][j]=='K' && C[i][j]=='K' && A[i][j]!='#'){
				cout<<"YES"<<endl;
				return ;
			}
		}
	}
	cout<<"NO"<<endl;
	return ;
}
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	int t;
	cin>>t;
	while(t--) solve();
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
int t;
cin>>t;
bool ans[t];
int dx[]={2,-2,2,-2};
int dy[]={2,-2,-2,2};
for(int i=0;i<t;i++){
char c[8][8];
pair<int,int> p[2];
int cnt=0;
int vis1[8][8],vis2[8][8];
for(int j=0;j<8;j++){
for(int k=0;k<8;k++){vis1[j][k]=-1;vis2[j][k]=-1;
cin>>c[j][k];
if(c[j][k]=='K'){
p[cnt].first=j;
p[cnt].second=k;
cnt++;
}
}
}

queue<pair<int,int> > q;
q.push(p[0]);
vis1[p[0].first][p[0].second]=0;
while(!q.empty()){
pair<int,int> x=q.front();q.pop();
int x1=x.first;int x2=x.second;
for(int i=0;i<4;i++){
if(x1+dx[i]>=0&&x1+dx[i]<8&&x2+dy[i]>=0&&x2+dy[i]<8){
if(vis1[x1+dx[i]][x2+dy[i]]==-1){
q.push(pair<int,int>(x1+dx[i],x2+dy[i]));
vis1[x1+dx[i]][x2+dy[i]]=vis1[x1][x2]+1;
}
}
}
}

q.push(p[1]);
vis2[p[1].first][p[1].second]=0;
while(!q.empty()){
	pair<int,int> x=q.front();q.pop();

	int x1=x.first;int x2=x.second;
	for(int i=0;i<4;i++){
		if(x1+dx[i]>=0&&x1+dx[i]<8&&x2+dy[i]>=0&&x2+dy[i]<8){
			if(vis2[x1+dx[i]][x2+dy[i]]==-1){
				q.push(pair<int,int>(x1+dx[i],x2+dy[i]));
				vis2[x1+dx[i]][x2+dy[i]]=vis2[x1][x2]+1;
			}
		}
	}
}
bool xx=false;

for(int j=0;j<8;j++){
for(int k=0;k<8;k++){
if(vis1[j][k]==vis2[j][k]&&vis2[j][k]!=-1){xx=true;break;}
}
}

ans[i]=xx;

}

for(int i=0;i<t;i++){
if(ans[i]){cout<<"YES"<<endl;}
else{cout<<"NO"<<endl;}
}

return 0;

}


#include<bits/stdc++.h>

using namespace std;

int main(){
int t;
cin>>t;
bool ans[t];
int dx[]={2,-2,2,-2};
int dy[]={2,-2,-2,2};
for(int i=0;i<t;i++){
char c[8][8];
pair<int,int> p[2];
int cnt=0;
int vis1[8][8],vis2[8][8];
for(int j=0;j<8;j++){
for(int k=0;k<8;k++){vis1[j][k]=0;vis2[j][k]=0;
cin>>c[j][k];
if(c[j][k]=='K'){
p[cnt].first=j;
p[cnt].second=k;
cnt++;
}
}
}

queue<pair<int,int> > q;
q.push(p[0]);
while(!q.empty()){
pair<int,int> x=q.front();q.pop();
vis1[x.first][x.second]=1;
int x1=x.first;int x2=x.second;
for(int i=0;i<4;i++){
if(x1+dx[i]>=0&&x1+dx[i]<8&&x2+dy[i]>=0&&x2+dy[i]<8){
if(vis1[x1+dx[i]][x2+dy[i]]==0){
q.push(pair<int,int>(x1+dx[i],x2+dy[i]));
}
}
}
}

q.push(p[1]);
while(!q.empty()){
	pair<int,int> x=q.front();q.pop();
	vis2[x.first][x.second]=1;
	int x1=x.first;int x2=x.second;
	for(int i=0;i<4;i++){
		if(x1+dx[i]>=0&&x1+dx[i]<8&&x2+dy[i]>=0&&x2+dy[i]<8){
			if(vis2[x1+dx[i]][x2+dy[i]]==0){
				q.push(pair<int,int>(x1+dx[i],x2+dy[i]));
			}
		}
	}
}
bool xx=false;

for(int j=0;j<8;j++){
for(int k=0;k<8;k++){
if(c[j][k]!='#'&&vis1[j][k]==1&&vis2[j][k]==1){xx=true;break;}
}
}

ans[i]=xx;

}

for(int i=0;i<t;i++){
if(ans[i]){cout<<"YES"<<endl;}
else{cout<<"NO"<<endl;}
}

return 0;

}


#include<bits/stdc++.h>

using namespace std;

int main(){
int t;
cin>>t;
bool ans[t];
int dx[]={2,-2,2,-2};
int dy[]={2,-2,-2,2};
for(int i=0;i<t;i++){
char c[8][8];
pair<int,int> p[2];
int cnt=0;
int vis1[8][8],vis2[8][8];
for(int j=0;j<8;j++){
for(int k=0;k<8;k++){vis1[j][k]=-1;vis2[j][k]=-1;
cin>>c[j][k];
if(c[j][k]=='K'){
p[cnt].first=j;
p[cnt].second=k;
cnt++;
}
}
}

queue<pair<int,int> > q;
q.push(p[0]);
vis1[p[0].first][p[0].second]=0;
while(!q.empty()){
pair<int,int> x=q.front();q.pop();
int x1=x.first;int x2=x.second;
for(int i=0;i<4;i++){
if(x1+dx[i]>=0&&x1+dx[i]<8&&x2+dy[i]>=0&&x2+dy[i]<8){
if(vis1[x1+dx[i]][x2+dy[i]]==-1){
q.push(pair<int,int>(x1+dx[i],x2+dy[i]));
vis1[x1+dx[i]][x2+dy[i]]=vis1[x1][x2]+1;
}
}
}
}

q.push(p[1]);
vis2[p[1].first][p[1].second]=0;
while(!q.empty()){
	pair<int,int> x=q.front();q.pop();

	int x1=x.first;int x2=x.second;
	for(int i=0;i<4;i++){
		if(x1+dx[i]>=0&&x1+dx[i]<8&&x2+dy[i]>=0&&x2+dy[i]<8){
			if(vis2[x1+dx[i]][x2+dy[i]]==-1){
				q.push(pair<int,int>(x1+dx[i],x2+dy[i]));
				vis2[x1+dx[i]][x2+dy[i]]=vis2[x1][x2]+1;
			}
		}
	}
}
bool xx=false;

for(int j=0;j<8;j++){
for(int k=0;k<8;k++){
if(c[j][k]!='#'&&vis1[j][k]==vis2[j][k]&&vis2[j][k]!=-1){xx=true;break;}
}
}

ans[i]=xx;

}

for(int i=0;i<t;i++){
if(ans[i]){cout<<"YES"<<endl;}
else{cout<<"NO"<<endl;}
}

return 0;

}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <math.h>
#include <cstring>

using namespace std;

char mp[10][10];
bool vis[10][10];
bool ans;
int dir[4][2] = {2,-2, 2,2, -2,2 ,-2,-2};

bool dfs(int x,int y) {
    if ( mp[x][y]=='.'||mp[x][y]=='K' ) return true;
    int tx,ty;
    for ( int i=0; i<4; i++ ) {
        tx = x+dir[i][0];
        ty = y+dir[i][1];
        if ( tx>=0 && ty>=0 && tx<8 && ty<8 && vis[tx][ty]==false ) {
            vis[tx][ty] = 1;
            bool t = dfs(tx,ty);
            if ( t ) return true;
        }
    }
    return false;
}
int main()
{
    int tests;

    int sx1,sx2,sy1,sy2;
    int cnt;
    cin>>tests;
    while ( tests-- ) {
        cnt=0;
        memset(vis,0,sizeof(vis));
        for ( int i=0; i<8; i++ ) {
            scanf("%s",mp[i]);
            for ( int j=0; j<8;j++) {
                if ( mp[i][j]=='K' ) {
                    if ( cnt==0) {
                        sx1=i; sy1=j; ++cnt;
                    }
                    else {
                        sx2 = i; sy2 = j;
                    }
                }
            }
        }

        int dis = abs( sx1-sx2 );
        int dis2 = abs( sy1-sy2 );
        if ( dis%4 || dis2%4 ) cout<<"NO"<<endl;
        else {
            ans = dfs(sx1,sy1);
            if (ans) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<string>
#include<utility>
#define pii pair<int,int>
using namespace std;
int fx[]={2,2,-2,-2};
int fy[]={2,-2,2,-2};
char cell[9][9];
int vis[9][9];
int row=7,col=7;
vector<pii>v,v1;
void bfs(int sx,int sy)
{
	memset(vis,0,sizeof vis);
	vis[sx][sy]=1;
	queue<pii>q;
	q.push(pii(sx,sy));
	while(!q.empty())
	{
		pii top=q.front(); q.pop();
		for(int k=0;k<4;k++)
		{
			int tx=top.first+fx[k];
			int ty=top.second+fy[k]; //Neighbor cell [tx][ty]
			if(tx>=0 && tx<row && ty>=0 && ty<col && cell[tx][ty]!='#' && vis[tx][ty]==0)
			{
				vis[tx][ty]=1;
				q.push(pii(tx,ty));
				v.push_back(pii(tx,ty));
			}
		}
	}
}
void bfs1(int sx,int sy) //Source node is in [sx][sy] cell.
{
	memset(vis,0,sizeof vis);
	vis[sx][sy]=1;
	queue<pii>q;
	q.push(pii(sx,sy));
	while(!q.empty())
	{
		pii top=q.front(); q.pop();
		for(int k=0;k<4;k++)
		{
			int tx=top.first+fx[k];
			int ty=top.second+fy[k]; //Neighbor cell [tx][ty]
			if(tx>=0 && tx<row && ty>=0 && ty<col && cell[tx][ty]!='#' && vis[tx][ty]==0)
			{
				vis[tx][ty]=1;
				q.push(pii(tx,ty));
				v1.push_back(pii(tx,ty));
			}
		}
	}
}
void compare(){
int len=v.size(),len1=v1.size(); //cout<<len<<' '<<len1<<endl;
pii x,y;
bool found=false;
for(int i=0;i<len;i++){
    for(int j=0;j<len1;j++){
            x=v[i]; y=v1[j];
        if(x.first==y.first&&x.second==y.second) { found=true; break; }
    }
    if(found) break;
}
if(found) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
int main()
{
    int t,n,px,px1,py,py1;cin>>t;
    string str;
    while(t--){
            int n_k=0;
           for(int i=0;i<8;i++){
            cin>>str;
            for(int j=0;j<8;j++) { cell[i][j]=str[j]; if(str[j]=='K'&&n_k==0) { px=i; py=j; n_k++; } else if(str[j]=='K'&&n_k==1){ px1=i; py1=j; } }
           }
           //cout<<px<<' '<<py<<endl<<px1<<' '<<py1<<endl;
           bfs(px,py);
           bfs1(px1,py1);
           compare();
           v.clear(); v1.clear();
    }
    return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<string>
#include<utility>
#define pii pair<int,int>
using namespace std;
int fx[]={2,2,-2,-2};
int fy[]={2,-2,2,-2};
char cell[9][9];
int vis[9][9];
int row=7,col=7;
vector<pii>v,v1;
void bfs(int sx,int sy)
{
	memset(vis,0,sizeof vis);
	vis[sx][sy]=1;
	queue<pii>q;
	q.push(pii(sx,sy));
	while(!q.empty())
	{
		pii top=q.front(); q.pop();
		for(int k=0;k<4;k++)
		{
			int tx=top.first+fx[k];
			int ty=top.second+fy[k]; //Neighbor cell [tx][ty]
			if(tx>=0 && tx<row && ty>=0 && ty<col  && vis[tx][ty]==0)
			{
				vis[tx][ty]=1;
				q.push(pii(tx,ty));
				v.push_back(pii(tx,ty));
			}
		}
	}
}
void bfs1(int sx,int sy) //Source node is in [sx][sy] cell.
{
	memset(vis,0,sizeof vis);
	vis[sx][sy]=1;
	queue<pii>q;
	q.push(pii(sx,sy));
	while(!q.empty())
	{
		pii top=q.front(); q.pop();
		for(int k=0;k<4;k++)
		{
			int tx=top.first+fx[k];
			int ty=top.second+fy[k]; //Neighbor cell [tx][ty]
			if(tx>=0 && tx<row && ty>=0 && ty<col  && vis[tx][ty]==0)
			{
				vis[tx][ty]=1;
				q.push(pii(tx,ty));
				v1.push_back(pii(tx,ty));
			}
		}
	}
}
void compare(){
int len=v.size(),len1=v1.size();// cout<<len<<' '<<len1<<endl;
pii x,y;
bool found=false;
for(int i=0;i<len;i++){
    for(int j=0;j<len1;j++){
            x=v[i]; y=v1[j];
        if(x.first==y.first&&x.second==y.second) { found=true; break; }
    }
    if(found) break;
}
if(found) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
int main()
{
    int t,n,px,px1,py,py1;cin>>t;
    string str;
    while(t--){
            int n_k=0;
           for(int i=0;i<8;i++){
            cin>>str;
            for(int j=0;j<8;j++) { cell[i][j]=str[j]; if(str[j]=='K'&&n_k==0) { px=i; py=j; n_k++; } else if(str[j]=='K'&&n_k==1){ px1=i; py1=j; } }
           }
           //cout<<px<<' '<<py<<endl<<px1<<' '<<py1<<endl;
           bfs(px,py);
           bfs1(px1,py1);
           compare();
           v.clear(); v1.clear();
    }
    return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<string>
#include<utility>
#define pii pair<int,int>
using namespace std;
int fx[]={2,2,-2,-2};
int fy[]={2,-2,2,-2};
char cell[9][9];
int vis[9][9];
int row=7,col=7;
vector<pii>v,v1;
void bfs(int sx,int sy)
{
	memset(vis,0,sizeof vis);
	vis[sx][sy]=1;
	queue<pii>q;
	q.push(pii(sx,sy));
	int na=1;
	while(na--)
	{
		pii top=q.front(); q.pop();
		for(int k=0;k<4;k++)
		{
			int tx=top.first+fx[k];
			int ty=top.second+fy[k]; //Neighbor cell [tx][ty]
			if(tx>=0 && tx<row && ty>=0 && ty<col  && vis[tx][ty]==0)
			{
				vis[tx][ty]=1;
				q.push(pii(tx,ty));
				v.push_back(pii(tx,ty));
			}
		}
	}
}
void bfs1(int sx,int sy) //Source node is in [sx][sy] cell.
{
	memset(vis,0,sizeof vis);
	vis[sx][sy]=1;
	queue<pii>q;
	q.push(pii(sx,sy));
	int na=1;
	while(na--)
	{
		pii top=q.front(); q.pop();
		for(int k=0;k<4;k++)
		{
			int tx=top.first+fx[k];
			int ty=top.second+fy[k]; //Neighbor cell [tx][ty]
			if(tx>=0 && tx<row && ty>=0 && ty<col  && vis[tx][ty]==0)
			{
				vis[tx][ty]=1;
				q.push(pii(tx,ty));
				v1.push_back(pii(tx,ty));
			}
		}
	}
}
void compare(){
int len=v.size(),len1=v1.size();// cout<<len<<' '<<len1<<endl;
pii x,y;
bool found=false;
for(int i=0;i<len;i++){
    for(int j=0;j<len1;j++){
            x=v[i]; y=v1[j];
        if(x.first==y.first&&x.second==y.second) { found=true; break; }
    }
    if(found) break;
}
if(found) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
int main()
{
    int t,n,px,px1,py,py1;cin>>t;
    string str;
    while(t--){
            int n_k=0;
           for(int i=0;i<8;i++){
            cin>>str;
            for(int j=0;j<8;j++) { cell[i][j]=str[j]; if(str[j]=='K'&&n_k==0) { px=i; py=j; n_k++; } else if(str[j]=='K'&&n_k==1){ px1=i; py1=j; } }
           }
           //cout<<px<<' '<<py<<endl<<px1<<' '<<py1<<endl;
           bfs(px,py);
           bfs1(px1,py1);
           compare();
           v.clear(); v1.clear();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef pair<int,int> ii;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t; cin>>t;
	for (int c=0; c<t; c++) {
		char ch;
		vector<ii> v;
		for (int i=0; i<8; i++)
			for (int j=0; j<8; j++) {
				cin>>ch;
				if(ch=='K') v.push_back(make_pair(i,j));
			}
		if(((v[1].first-v[0].first)%4==0)&&((v[1].second-v[0].second)%4==0)) cout << "YES";
		else cout << "NO";
		cout << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef pair<int,int> ii;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t; cin>>t;
	for (int c=0; c<t; c++) {
		char ch;
		vector<ii> v;
		for (int i=0; i<8; i++)
			for (int j=0; j<8; j++) {
				cin>>ch;
				if(ch=='K') v.push_back(make_pair(i,j));
			}

		if((v[1].first-v[0].first)%4==0&&(v[1].second-v[0].second==0)) cout << "YES";
		else cout << "NO";
		cout << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long ll;
char grid[8][8];
bool vis[8][8][8][8];
int dx[]={2,2,-2,-2};
int dy[]={2,-2,2,-2};
bool bt(int x1, int y1, int x2, int y2){
  if(vis[x1][y1][x2][y2]||x1>=8||y1>=8||x2>=8||y2>=8||x1<0||y1<0||x2<0||y2<0)
    return 0;
  if(x1==x2&&y1==y2)
    return 1;
  vis[x1][y1][x2][y2] = true;
  bool flag = false;
  for(int i = 0; i < 4;i++){
    for(int j = i + 1 ;j<4;j++){
      flag|=bt(x1 + dx[i], y1 + dy[i], x2 + dx[j], y2 + dy[j]);
    }
  }
  return flag;
}
int main(){
  int t;
  cin >> t;
  while(t--){
    memset(vis, 0, sizeof vis);
    for(int i = 0; i < 8; i++)
      cin >> grid[i];
    int a = -1, b, c, d;
    for(int  i =0; i < 8;i++){
      for(int j = 0;j < 8; j++){
        if(grid[i][j]=='K'){
          if(a == -1)a=i,b=j;
          else c = i, d = j;
        }
      }
    }
    puts(bt(a,b,c,d)?"YES":"NO");

  }

  return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MEM(a,b) memset((a),(b),sizeof(a))

const int INF = 1e5 + 7;
const int N = 1e3 + 10;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    vector<int> v;
    int n;
    cin >> n;
    while (n--)
    {
        for (int i = 0; i < 8; i++)
        {
            for (int j = 0; j < 8; j++)
            {
                char c;
                cin >> c;
                if (c == 'K')
                {
                    v.push_back(i);
                    v.push_back(j);
                }
            }
        }
        if ((v[0] == v[2] || abs(v[1] - v[3]) == 4) && (abs(v[0] - v[2]) == 4 || v[1] == v[3]))
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
        v.clear();
    }
    return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MEM(a,b) memset((a),(b),sizeof(a))

const int INF = 1e5 + 7;
const int N = 1e3 + 10;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    vector<int> v;
    int n;
    cin >> n;
    while (n--)
    {
        for (int i = 0; i < 8; i++)
        {
            for (int j = 0; j < 8; j++)
            {
                char c;
                cin >> c;
                if (c == 'K')
                {
                    v.push_back(i);
                    v.push_back(j);
                }
            }
        }
        if ((v[0] == v[2] || abs(v[0] - v[2]) == 4) && (abs(v[1] - v[3]) == 4 || v[1] == v[3]))
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
        v.clear();
    }
    return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MEM(a,b) memset((a),(b),sizeof(a))

const int INF = 1e5 + 7;
const int N = 1e3 + 10;

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	vector<int> v;
	int n;
	cin >> n;
	while (n--)
	{
		for (int i = 0; i < 8; i++)
		{
			for (int j = 0; j < 8; j++)
			{
				char c;
				cin >> c;
				if (c == 'K')
				{
					v.push_back(i);
					v.push_back(j);
				}
			}
		}
		if ((v[0] == v[2] && abs(v[1] - v[3]) == 4) || (abs(v[0] - v[2]) == 4 && v[1] == v[3]))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
		v.clear();
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

char grid[8][8];
int dx[] = {-2,2,-2,2};
int dy[] = {2,-2,-2,2};

void fill1(int x, int y) {
    for (int i = 0; i < 4; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];
        if (nx < 0 || y < 0 || x >= 8 || y >= 8) continue;
        if (grid[nx][ny] == '.') {
            grid[nx][ny] = '0';
            fill1(nx,ny);
        }
    }
}

void fill2(int x, int y, bool& poss) {
    for (int i = 0; i < 4; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];
        if (nx < 0 || ny < 0 || nx >= 8 || ny >= 8) continue;
        if (grid[nx][ny] == '0') poss = true;
        if (grid[nx][ny] == '.') {
            grid[nx][ny] = '1';
            fill2(nx,ny,poss);
        }
    }
}
void solve() {
    pair<int,int> a[2];
    int c = 0;
    for (int i = 0; i < 8; i++) {
        string s; cin >> s;
        for (int j = 0; j < 8; j++) {
            grid[i][j] = s[j];
            if (grid[i][j] == 'K') {
                grid[i][j] = c+'0';
                a[c++] = {i,j};
            }
        }
    }
    int d1 = abs(a[0].first-a[1].first);
    int d2 = abs(a[0].second-a[1].second);
    if (d1 % 2 == 0 && d2 % 2 == 0 && (d1/2) % 2 == (d2/2) % 2) {
        cout << "YES" << '\n';
    }
    else {
        cout << "NO\n";
    }
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int t; cin >> t; while (t--) solve();
    return 0;
}


#include <iostream>

using namespace std;

int vs[100001];

int main(){
    int n;
    cin>>n;
    for (int i=0;i<n;i++) cin>>vs[i];
    int v=0;
    int wc=0;
    int wcl=0;
    int woc=0;
    int wocl=0;
    for (int i=0;i<n;i++){
        int a=vs[i];
        if (a>wc){
            wc=a;
            wcl++;
        }
        else{
            wc=a;
            wcl=1;
        }
        if (a>woc){
            woc=a;
            wocl++;
        }
        else{
            wc=woc+1;
            wcl=wocl+1;
            woc=a;
            wocl=1;
        }
        //cout <<wc<<" "<<wcl<<" "<<woc<<" "<<wocl<<endl;
        v=max(v,wcl);
    }
    wc=0;
    wcl=0;
    woc=0;
    wocl=0;
    //cout<<"lol"<<endl;
    for (int i=0;i<n;i++){
        int a=vs[i];
        if (a>wc){
            wc=a;
            wcl++;
        }
        else{
            wc=a;
            wcl=1;
        }
        if (a>woc){
            woc=a;
            wocl++;
        }
        else{
            if (i>1){
                if (vs[i-2]<a-1){
                    wc=a;
                    wcl=wocl+1;
                }
                else{
                    wc=a;
                    wcl=2;
                }
            }
            else{
                wc=a;
                wcl=wocl+1;
            }
            woc=a;
            wocl=1;
        }
        //cout <<wc<<" "<<wcl<<" "<<woc<<" "<<wocl<<endl;
        v=max(v,wcl);
    }
    cout<<v<<endl;
}