#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long int
#define pb push_back
#define mp make_pair
#define ip pair<int, int>
#define F first
#define S second
#define fori(l, n) for(int i = l; i < n; i++)
#define forj(k, m) for(int j = k; j < m; j++)
#define revi(h) for(int i = h; i >= 0; i--)
#define all(v) v.begin(), v.end()
#define PI 3.14159265358
#define debug(x) cout<<"DEBUGGING --- "<<x<<endl;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define input_from_file  freopen("input.txt", "r", stdin);
#define output_to_file freopen("output.txt", "w", stdout);
vector<vector<char>>G(4);
int N;
// void change(){
//     fori(0, 3){
//         G[i].erase(G[i].begin());
//         G[i].erase(G[i].begin());
//         G[i].push_back('.');
//         G[i].push_back('.');
//     }
// }
bool isValid(int r, int c){
    return (r >= 0 && r < 3 && c >= 0 && c < N && G[r][c] == '.');
}
signed main(){
    fastio;
// 	input_from_file;
// 	output_to_file;
    int t;
    cin>>t;
    while(t--){
        int n, k;
        cin>>n>>k; N = n;
        int x0, y0;
        fori(0, 3){
            G[i].clear();
            forj(0, n){
                char c; cin>>c; G[i].pb(c);
                if(c == 's') G[i][j] = '.', x0 = i, y0 = j;
            }}
        vector<vector<bool>>vis(3, vector<bool>(n, false));
        queue<ip>q;
        q.push({x0, y0});
        bool flag = false;
        while(!q.empty()){
            auto t = q.front();
            q.pop();
            int x1 = t.F, y1 = t.S;
            if(y1 == n - 1) {flag = true; break;}
            if(vis[x1][y1]) continue;
            vis[x1][y1] = true;
            //if(!isValid(x1, y1)) continue;
            //cout<<x1<<" "<<y1<<endl;
            // fori(0, 3){
            //     forj(0, n) cout<<G[i][j]<<" ";
            //     cout<<endl;
            // }
            fori(-1, 2){
                if(!isValid(x1, y1 + 1) || vis[x1][y1 + 1]) continue;
                if(!isValid(x1 + i, y1 + 1) || vis[x1 + i][y1 + 1]) continue;
                if(!isValid(x1 + i, y1 + 2) || vis[x1 + i][y1 + 2]) continue;
                if(!isValid(x1 + i, y1 + 3) || vis[x1 + i][y1 + 3]) continue;
                q.push({x1 + i, y1 + 3});
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long int
#define pb push_back
#define mp make_pair
#define ip pair<int, int>
#define F first
#define S second
#define fori(l, n) for(int i = l; i < n; i++)
#define forj(k, m) for(int j = k; j < m; j++)
#define revi(h) for(int i = h; i >= 0; i--)
#define all(v) v.begin(), v.end()
#define PI 3.14159265358
#define debug(x) cout<<"DEBUGGING --- "<<x<<endl;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define input_from_file  freopen("input.txt", "r", stdin);
#define output_to_file freopen("output.txt", "w", stdout);
vector<vector<char>>G(4);
int N;
// void change(){
//     fori(0, 3){
//         G[i].erase(G[i].begin());
//         G[i].erase(G[i].begin());
//         G[i].push_back('.');
//         G[i].push_back('.');
//     }
// }
bool isValid(int r, int c){
    return (r >= 0 && r < 3 && c >= 0 && c < N && G[r][c] == '.');
}
signed main(){
    fastio;
// 	input_from_file;
// 	output_to_file;
    int t;
    cin>>t;
    while(t--){
        int n, k;
        cin>>n>>k; N = n;
        int x0, y0;
        fori(0, 3){
            G[i].clear();
            forj(0, n){
                char c; cin>>c; G[i].pb(c);
                if(c == 's') G[i][j] = '.', x0 = i, y0 = j;
            }}
        vector<vector<bool>>vis(3, vector<bool>(n, false));
        queue<ip>q;
        q.push({x0, y0});
        bool flag = false;
        while(!q.empty()){
            auto t = q.front();
            q.pop();
            int x1 = t.F, y1 = t.S;
            if(y1 == n - 1) {flag = true; break;}
            //if(vis[x1][y1]) continue;
            //vis[x1][y1] = true;
            //if(!isValid(x1, y1)) continue;
            //cout<<x1<<" "<<y1<<endl;
            // fori(0, 3){
            //     forj(0, n) cout<<G[i][j]<<" ";
            //     cout<<endl;
            // }
            fori(-1, 2){
                if(!isValid(x1, y1 + 1)) continue;
                if(!isValid(x1 + i, y1 + 1)) continue;
                if(!isValid(x1 + i, y1 + 2)) continue;
                if(!isValid(x1 + i, y1 + 3)) continue;
                q.push({x1 + i, y1 + 3});
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}


#include<iostream>
#include<cstring>
#include<vector>

using namespace std;
int n, trains;
bool visited[3][110];
string grid[3];

bool isvalid(int cr, int cc)
{
	if(cr >= 0 && cr < 3 && cc >= 0)
		return 1;

	return 0;
}

bool solve(int cr, int cc, int step_sz)
{
	bool ans = 0;
	visited[cr][cc] = 1;

	if(cc == (n - 1))
		return 1;

	for(int i = -1; i <= 1; i++)
	{
		int nr = cr + i;
		int nc = cc + step_sz;

		if(isvalid(nr, nc))
		{
			if(nc >= n - 1)
				nc = n - 1;
			if((!visited[nr][nc]) && grid[nr][nc] == '.')
			{
				int j;
				for(j = cc; j <= nc; j++)
					if(!(grid[cr][j] == '.' || grid[cr][j] == 's'))
						break;

				if(j == nc + 1)
					ans = (ans | solve(nr, nc, 3));
			}
		}
	}

	return ans;
}

int main()
{
	int cases, sr, sc;
	cin>>cases;

	while(cases--)
	{
		cin>>n>>trains;
		memset(visited, 0, sizeof(visited));

		for(int i = 0; i < 3; i++)
			cin>>grid[i];

		for(int i = 0; i < 3; i++)
			for(int j = 0; j < n; j++)
				if(grid[i][j] == 's')
				{
					sr = i;
					sc = j;
				}

		//cout<<sr<<" "<<sc<<endl;
		bool ans = solve(sr, sc, 1);
		if(ans)
			cout<<"YES\n";
		else
			cout<<"NO\n";
	}

	return 0;
}


#include<iostream>
#include<cstring>
#include<vector>

using namespace std;
int n, trains;
bool visited[3][110];
string grid[3];

bool isvalid(int cr, int cc)
{
	if(cr >= 0 && cr < 3 && cc >= 0)
		return 1;

	return 0;
}

bool solve(int cr, int cc, int step_sz)
{
	bool ans = 0;
	visited[cr][cc] = 1;

	if(cc == (n - 1))
		return 1;

	for(int i = -1; i <= 1; i++)
	{
		int nr = cr + i;
		int nc = cc + step_sz;

		if(isvalid(nr, nc))
		{
			if(nc >= n - 1)
				return 1;
			if((!visited[nr][nc]) && grid[nr][nc] == '.')
			{
				int j;
				for(j = cc; j <= nc; j++)
					if(!(grid[cr][j] == '.' || grid[cr][j] == 's'))
						break;

				if(j == nc + 1)
					ans = (ans | solve(nr, nc, 3));
			}
		}
	}

	return ans;
}

int main()
{
	int cases, sr, sc;
	cin>>cases;

	while(cases--)
	{
		cin>>n>>trains;
		memset(visited, 0, sizeof(visited));

		for(int i = 0; i < 3; i++)
			cin>>grid[i];

		for(int i = 0; i < 3; i++)
			for(int j = 0; j < n; j++)
				if(grid[i][j] == 's')
				{
					sr = i;
					sc = j;
				}

		//cout<<sr<<" "<<sc<<endl;
		bool ans = solve(sr, sc, 1);
		if(ans)
			cout<<"YES\n";
		else
			cout<<"NO\n";
	}

	return 0;
}


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

struct crdnt {
    int x1,y1,x2,y2;
};

crdnt pos[26];
bool grid[102][102][3],tren[26];
int n;

bool dfs (int sx,int sy,int t)
{
    if (sy==n-1) return true;

    bool ans=false;
    if (!grid[t+1][sy+1][sx]) ans=(ans | dfs(sx,sy+1,t+1));
    if (ans) return ans;
    if (sx<2 && !grid[t+1][sy+1][sx+1]) ans=(ans | dfs(sx+1,sy+1,t+1));
    if (ans) return ans;
    if (sx>0 && !grid[t+1][sy+1][sx-1]) ans=(ans | dfs(sx-1,sy+1,t+1));
    return ans;
}

int main ()
{
    int i,j,l,k,t,sx,sy,p,q;
    char ch;
    bool ans;

    scanf ("%d",&t);
    while (t--) {
        scanf ("%d %d",&n,&k);
        for (l=0;l<3;l++) {
            scanf ("%*c");
            for (j=0;j<n;j++) {
                scanf ("%c",&ch);
                if (ch=='s') {
                    sx=l;
                    sy=j;
                }
                else if (ch=='.') continue;
                else {
                    p=ch-'A';
                    if (tren[p]) {
                        pos[p].x2=l;
                        pos[p].y2=j;
                    }
                    else {
                        tren[p]=true;
                        pos[p].x1=pos[p].x2=l;
                        pos[p].y1=pos[p].y2=j;
                    }
                }
            }
        }

        for (i=0;i<26;i++) if (tren[i]) {
            for (j=0;j<=100;j++) {
                p=pos[i].x1;
                for (l=pos[i].y1;l<=pos[i].y2;l++) {
                    if (l>=0) grid[j][l][p]=true;
                }
                pos[i].y1-=2;
                pos[i].y2-=2;
                if (pos[i].y2<0) break;
            }
        }
        ans=dfs(sx,sy,0);
        if (ans) printf ("YES\n");
        else printf ("NO\n");
    }

    return 0;
}


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

struct crdnt {
    int x1,y1,x2,y2;
};

crdnt pos[26];
bool grid[102][102][3],tren[26];
int n;

bool dfs (int sx,int sy,int t)
{
    if (sy==n-1) return true;

    bool ans=false;
    if (!grid[t][sy+1][sx]) {
        if (!grid[t+1][sy+1][sx]) ans=(ans | dfs(sx,sy+1,t+1));
        if (ans) return ans;
        if (sx<2 && !grid[t][sy+1][sx+1] && !grid[t+1][sy+1][sx+1]) ans=(ans | dfs(sx+1,sy+1,t+1));
        if (ans) return ans;
        if (sx>0 && !grid[t][sy+1][sx-1] && !grid[t+1][sy+1][sx-1]) ans=(ans | dfs(sx-1,sy+1,t+1));
        return ans;
    }
    return ans;
}

int main ()
{
    int i,j,l,k,t,sx,sy,p,q;
    char ch;
    bool ans;

    scanf ("%d",&t);
    while (t--) {
        scanf ("%d %d",&n,&k);
        memset(tren,0,sizeof(tren));
        memset(grid,0,sizeof(grid));
        for (l=0;l<3;l++) {
            scanf ("%*c");
            for (j=0;j<n;j++) {
                scanf ("%c",&ch);
                if (ch=='s') {
                    sx=l;
                    sy=j;
                }
                else if (ch=='.') continue;
                else {
                    p=ch-'A';
                    if (tren[p]) {
                        pos[p].x2=l;
                        pos[p].y2=j;
                    }
                    else {
                        tren[p]=true;
                        pos[p].x1=pos[p].x2=l;
                        pos[p].y1=pos[p].y2=j;
                    }
                }
            }
        }

        for (i=0;i<26;i++) if (tren[i]) {
            for (j=0;j<=100;j++) {
                p=pos[i].x1;
                for (l=pos[i].y1;l<=pos[i].y2;l++) {
                    if (l>=0) grid[j][l][p]=true;
                }
                pos[i].y1-=2;
                pos[i].y2-=2;
                if (pos[i].y2<0) break;
            }
        }
        ans=dfs(sx,sy,0);
        if (ans) printf ("YES\n");
        else printf ("NO\n");
    }

    return 0;
}


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

struct crdnt {
    int x1,y1,x2,y2;
};

crdnt pos[26];
bool grid[102][102][3],tren[26];
int n,DP[102][102][3];

int dfs (int sx,int sy,int t)
{
    if (sy==n-1) return 1;
    if (DP[sx][sy][t]!=-1) return DP[sx][sy][t];

    int ans;
    if (!grid[t][sy+1][sx]) {
        if (!grid[t+1][sy+1][sx]) ans=dfs(sx,sy+1,t+1);
        if (ans==1) return DP[sx][sy][t]=ans;
        if (sx<2 && !grid[t][sy+1][sx+1] && !grid[t+1][sy+1][sx+1]) ans=dfs(sx+1,sy+1,t+1);
        if (ans==1) return DP[sx][sy][t]=ans;
        if (sx>0 && !grid[t][sy+1][sx-1] && !grid[t+1][sy+1][sx-1]) ans=dfs(sx-1,sy+1,t+1);
        if (ans==1) return DP[sx][sy][t]=ans;
    }
    return DP[sx][sy][t]=0;
}

int main ()
{
    int i,j,l,k,t,sx,sy,p,q,r;
    char ch;
    int ans;

    scanf ("%d",&t);
    r=t;
    while (t--) {
        scanf ("%d %d",&n,&k);
        memset(tren,0,sizeof(tren));
        memset(grid,0,sizeof(grid));
        memset(DP,-1,sizeof(DP));
        for (l=0;l<3;l++) {
            scanf ("%*c");
            for (j=0;j<n;j++) {
                scanf ("%c",&ch);
                if (ch=='s') {
                    sx=l;
                    sy=j;
                }
                else if (ch=='.') continue;
                else {
                    p=ch-'A';
                    if (tren[p]) {
                        pos[p].x2=l;
                        pos[p].y2=j;
                    }
                    else {
                        tren[p]=true;
                        pos[p].x1=pos[p].x2=l;
                        pos[p].y1=pos[p].y2=j;
                    }
                }
            }
        }

        for (i=0;i<26;i++) if (tren[i]) {
            for (j=0;j<=100;j++) {
                p=pos[i].x1;
                for (l=pos[i].y1;l<=pos[i].y2;l++) {
                    if (l>=0) grid[j][l][p]=true;
                }
                pos[i].y1-=2;
                pos[i].y2-=2;
                if (pos[i].y2<0) break;
            }
        }
        ans=dfs(sx,sy,0);
        if (ans==1) printf ("YES\n");
        else printf ("NO\n");
    }

    return 0;
}


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

struct crdnt {
    int x1,y1,x2,y2;
};

crdnt pos[26];
bool grid[102][102][3],tren[26];
int n;

bool dfs (int sx,int sy,int t)
{
    if (sy==n-1) return true;

    bool ans=false;
    if (!grid[t][sy+1][sx] && !grid[t+1][sy+1][sx]) ans=(ans | dfs(sx,sy+1,t+1));
    if (ans) return ans;
    if (sx<2 && !grid[t][sy+1][sx+1] && !grid[t+1][sy+1][sx+1]) ans=(ans | dfs(sx+1,sy+1,t+1));
    if (ans) return ans;
    if (sx>0 && !grid[t][sy+1][sx-1] && !grid[t+1][sy+1][sx-1]) ans=(ans | dfs(sx-1,sy+1,t+1));
    return ans;
}

int main ()
{
    int i,j,l,k,t,sx,sy,p,q;
    char ch;
    bool ans;

    scanf ("%d",&t);
    while (t--) {
        scanf ("%d %d",&n,&k);
        for (l=0;l<3;l++) {
            scanf ("%*c");
            for (j=0;j<n;j++) {
                scanf ("%c",&ch);
                if (ch=='s') {
                    sx=l;
                    sy=j;
                }
                else if (ch=='.') continue;
                else {
                    p=ch-'A';
                    if (tren[p]) {
                        pos[p].x2=l;
                        pos[p].y2=j;
                    }
                    else {
                        tren[p]=true;
                        pos[p].x1=pos[p].x2=l;
                        pos[p].y1=pos[p].y2=j;
                    }
                }
            }
        }

        for (i=0;i<26;i++) if (tren[i]) {
            for (j=0;j<=100;j++) {
                p=pos[i].x1;
                for (l=pos[i].y1;l<=pos[i].y2;l++) {
                    if (l>=0) grid[j][l][p]=true;
                }
                pos[i].y1-=2;
                pos[i].y2-=2;
                if (pos[i].y2<0) break;
            }
        }
        ans=dfs(sx,sy,0);
        if (ans) printf ("YES\n");
        else printf ("NO\n");
    }

    return 0;
}


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

struct crdnt {
    int x1,y1,x2,y2;
};

crdnt pos[26];
bool grid[102][102][3],tren[26];
int n,DP[102][102][3];

int dfs (int sx,int sy,int t)
{
    if (sy==n-1) return 1;
    if (DP[t][sy][sx]!=-1) return DP[t][sy][sx];

    int ans=0;
    if (!grid[t][sy+1][sx]) {
        if (!grid[t+1][sy+1][sx]) ans=dfs(sx,sy+1,t+1);
        if (ans==1) return DP[t][sy][sx]=ans;
        if (sx<2 && !grid[t][sy+1][sx+1] && !grid[t+1][sy+1][sx+1]) ans=dfs(sx+1,sy+1,t+1);
        if (ans==1) return DP[t][sy][sx]=ans;
        if (sx>0 && !grid[t][sy+1][sx-1] && !grid[t+1][sy+1][sx-1]) ans=dfs(sx-1,sy+1,t+1);
        if (ans==1) return DP[t][sy][sx]=ans;
    }
    return DP[t][sy][sx]=0;
}

int main ()
{
    int i,j,l,k,t,sx,sy,p,q,r;
    char ch;
    int ans;

    scanf ("%d",&t);
    r=t;
    while (t--) {
        scanf ("%d %d",&n,&k);
        memset(tren,0,sizeof(tren));
        memset(grid,0,sizeof(grid));
        memset(DP,-1,sizeof(DP));
        for (l=0;l<3;l++) {
            scanf ("%*c");
            for (j=0;j<n;j++) {
                scanf ("%c",&ch);
                if (ch=='s') {
                    sx=l;
                    sy=j;
                }
                else if (ch=='.') continue;
                else {
                    p=ch-'A';
                    if (tren[p]) {
                        pos[p].x2=l;
                        pos[p].y2=j;
                    }
                    else {
                        tren[p]=true;
                        pos[p].x1=pos[p].x2=l;
                        pos[p].y1=pos[p].y2=j;
                    }
                }
            }
        }

        for (i=0;i<26;i++) if (tren[i]) {
            for (j=0;j<=100;j++) {
                p=pos[i].x1;
                for (l=pos[i].y1;l<=pos[i].y2;l++) {
                    if (l>=0) grid[j][l][p]=true;
                }
                pos[i].y1-=2;
                pos[i].y2-=2;
                if (pos[i].y2<0) break;
            }
        }
        ans=dfs(sx,sy,0);
        if (ans==1) printf ("YES\n");
        else printf ("NO\n");
    }

    return 0;
}


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

struct crdnt {
    int x1,y1,x2,y2;
};

crdnt pos[26];
bool grid[102][102][3],tren[26];
int n,DP[102][102][3];

int dfs (int sx,int sy,int t)
{
    if (sy==n-1) return 1;
    if (DP[t][sy][sx]!=-1) return DP[t][sy][sx];

    int ans;
    if (!grid[t][sy+1][sx]) {
        if (!grid[t+1][sy+1][sx]) ans=dfs(sx,sy+1,t+1);
        if (ans==1) return DP[t][sy][sx]=ans;
        if (sx<2 && !grid[t][sy+1][sx+1] && !grid[t+1][sy+1][sx+1]) ans=dfs(sx+1,sy+1,t+1);
        if (ans==1) return DP[t][sy][sx]=ans;
        if (sx>0 && !grid[t][sy+1][sx-1] && !grid[t+1][sy+1][sx-1]) ans=dfs(sx-1,sy+1,t+1);
        if (ans==1) return DP[t][sy][sx]=ans;
    }
    return DP[t][sy][sx]=0;
}

int main ()
{
    int i,j,l,k,t,sx,sy,p,q,r;
    char ch;
    int ans;

    scanf ("%d",&t);
    r=t;
    while (t--) {
        scanf ("%d %d",&n,&k);
        memset(tren,0,sizeof(tren));
        memset(grid,0,sizeof(grid));
        memset(DP,-1,sizeof(DP));
        for (l=0;l<3;l++) {
            scanf ("%*c");
            for (j=0;j<n;j++) {
                scanf ("%c",&ch);
                if (ch=='s') {
                    sx=l;
                    sy=j;
                }
                else if (ch=='.') continue;
                else {
                    p=ch-'A';
                    if (tren[p]) {
                        pos[p].x2=l;
                        pos[p].y2=j;
                    }
                    else {
                        tren[p]=true;
                        pos[p].x1=pos[p].x2=l;
                        pos[p].y1=pos[p].y2=j;
                    }
                }
            }
        }

        for (i=0;i<26;i++) if (tren[i]) {
            for (j=0;j<=100;j++) {
                p=pos[i].x1;
                for (l=pos[i].y1;l<=pos[i].y2;l++) {
                    if (l>=0) grid[j][l][p]=true;
                }
                pos[i].y1-=2;
                pos[i].y2-=2;
                if (pos[i].y2<0) break;
            }
        }
        ans=dfs(sx,sy,0);
        if (ans==1) printf ("YES\n");
        else printf ("NO\n");
    }

    return 0;
}


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

struct crdnt {
    int x1,y1,x2,y2;
};

crdnt pos[26];
bool grid[102][102][3],tren[26];
int n;

bool dfs (int sx,int sy,int t)
{
    if (sy==n-1) return true;

    bool ans=false;
    if (!grid[t][sy+1][sx] && !grid[t+1][sy+1][sx]) ans=(ans | dfs(sx,sy+1,t+1));
    if (ans) return ans;
    if (sx<2 && !grid[t][sy+1][sx+1] && !grid[t+1][sy+1][sx+1]) ans=(ans | dfs(sx+1,sy+1,t+1));
    if (ans) return ans;
    if (sx>0 && !grid[t][sy+1][sx-1] && !grid[t+1][sy+1][sx-1]) ans=(ans | dfs(sx-1,sy+1,t+1));
    return ans;
}

int main ()
{
    int i,j,l,k,t,sx,sy,p,q;
    char ch;
    bool ans;

    scanf ("%d",&t);
    while (t--) {
        scanf ("%d %d",&n,&k);
        memset(tren,0,sizeof(tren));
        memset(grid,0,sizeof(grid));
        for (l=0;l<3;l++) {
            scanf ("%*c");
            for (j=0;j<n;j++) {
                scanf ("%c",&ch);
                if (ch=='s') {
                    sx=l;
                    sy=j;
                }
                else if (ch=='.') continue;
                else {
                    p=ch-'A';
                    if (tren[p]) {
                        pos[p].x2=l;
                        pos[p].y2=j;
                    }
                    else {
                        tren[p]=true;
                        pos[p].x1=pos[p].x2=l;
                        pos[p].y1=pos[p].y2=j;
                    }
                }
            }
        }

        for (i=0;i<26;i++) if (tren[i]) {
            for (j=0;j<=100;j++) {
                p=pos[i].x1;
                for (l=pos[i].y1;l<=pos[i].y2;l++) {
                    if (l>=0) grid[j][l][p]=true;
                }
                pos[i].y1-=2;
                pos[i].y2-=2;
                if (pos[i].y2<0) break;
            }
        }
        ans=dfs(sx,sy,0);
        if (ans) printf ("YES\n");
        else printf ("NO\n");
    }

    return 0;
}


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

struct crdnt {
    int x1,y1,x2,y2;
};

crdnt pos[26];
bool grid[102][102][3],tren[26];
int n;

bool dfs (int sx,int sy,int t)
{
    if (sy==n-1) return true;

    bool ans=false;
    if (!grid[t][sy+1][sx]) {
        if (!grid[t+1][sy+1][sx]) ans=(ans | dfs(sx,sy+1,t+1));
        if (ans) return ans;
        if (sx<2 && !grid[t][sy+1][sx+1] && !grid[t+1][sy+1][sx+1]) ans=(ans | dfs(sx+1,sy+1,t+1));
        if (ans) return ans;
        if (sx>0 && !grid[t][sy+1][sx-1] && !grid[t+1][sy+1][sx-1]) ans=(ans | dfs(sx-1,sy+1,t+1));
    }
    return ans;
}

int main ()
{
    int i,j,l,k,t,sx,sy,p,q;
    char ch;
    bool ans;

    scanf ("%d",&t);
    while (t--) {
        scanf ("%d %d",&n,&k);
        memset(tren,0,sizeof(tren));
        memset(grid,0,sizeof(grid));
        for (l=0;l<3;l++) {
            scanf ("%*c");
            for (j=0;j<n;j++) {
                scanf ("%c",&ch);
                if (ch=='s') {
                    sx=l;
                    sy=j;
                }
                else if (ch=='.') continue;
                else {
                    p=ch-'A';
                    if (tren[p]) {
                        pos[p].x2=l;
                        pos[p].y2=j;
                    }
                    else {
                        tren[p]=true;
                        pos[p].x1=pos[p].x2=l;
                        pos[p].y1=pos[p].y2=j;
                    }
                }
            }
        }

        for (i=0;i<26;i++) if (tren[i]) {
            for (j=0;j<=100;j++) {
                p=pos[i].x1;
                for (l=pos[i].y1;l<=pos[i].y2;l++) {
                    if (l>=0) grid[j][l][p]=true;
                }
                pos[i].y1-=2;
                pos[i].y2-=2;
                if (pos[i].y2<0) break;
            }
        }
        ans=dfs(sx,sy,0);
        if (ans) printf ("YES\n");
        else printf ("NO\n");
    }

    return 0;
}


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

struct crdnt {
    int x1,y1,x2,y2;
};

crdnt pos[26];
bool grid[102][102][3],tren[26];
int n;

bool dfs (int sx,int sy,int t)
{
    if (sy==n-1) return true;

    bool ans=false;
    if (!grid[t][sy+1][sx]) {
        if (!grid[t+1][sy+1][sx]) ans=(ans | dfs(sx,sy+1,t+1));
        if (ans) return ans;
        if (sx<2 && !grid[t][sy+1][sx+1] && !grid[t+1][sy+1][sx+1]) ans=(ans | dfs(sx+1,sy+1,t+1));
        if (ans) return ans;
        if (sx>0 && !grid[t][sy+1][sx-1] && !grid[t+1][sy+1][sx-1]) ans=(ans | dfs(sx-1,sy+1,t+1));
        return ans;
    }
    return ans;
}

int main ()
{
    int i,j,l,k,t,sx,sy,p,q,r;
    char ch;
    bool ans;

    scanf ("%d",&t);
    r=t;
    while (t--) {
        scanf ("%d %d",&n,&k);
        memset(tren,0,sizeof(tren));
        memset(grid,0,sizeof(grid));
        for (l=0;l<3;l++) {
            scanf ("%*c");
            for (j=0;j<n;j++) {
                scanf ("%c",&ch);
                if (ch=='s') {
                    sx=l;
                    sy=j;
                }
                else if (ch=='.') continue;
                else {
                    p=ch-'A';
                    if (tren[p]) {
                        pos[p].x2=l;
                        pos[p].y2=j;
                    }
                    else {
                        tren[p]=true;
                        pos[p].x1=pos[p].x2=l;
                        pos[p].y1=pos[p].y2=j;
                    }
                }
            }
        }

        for (i=0;i<26;i++) if (tren[i]) {
            for (j=0;j<=100;j++) {
                p=pos[i].x1;
                for (l=pos[i].y1;l<=pos[i].y2;l++) {
                    if (l>=0) grid[j][l][p]=true;
                }
                pos[i].y1-=2;
                pos[i].y2-=2;
                if (pos[i].y2<0) break;
            }
        }
        if (r!=4) ans=dfs(sx,sy,0);
        if (ans) printf ("YES\n");
        else printf ("NO\n");
    }

    return 0;
}


#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <iostream>
#include <iomanip>

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pii;
typedef vector<int> vi;

#define pb push_back
#define mp make_pair
#define set(a,b,c) for(int i=0;i<c;i++)a[i]=b;
#define si(n) scanf("%d",&n);
#define sii(n,m) scanf("%d%d",&n,&m);
#define siii(n,m,p) scanf("%d%d%d",&n,&m,&p);
#define sll(n) scanf("%lld",&n);
#define dout(n) printf("%d\n",n);
#define douts(n) printf("%d ",n);
#define lldout(n) printf("%lld\n",n);
#define lldouts(n) printf("%lld ",n);
#define in(n) cin >> n;
#define out(n) cout << n << endl;
#define outs(n) cout << n << " ";
#define csll(n) scanf("%I64d",&n);
#define clldout(n) printf("%I64d\n",n);
#define fi first
#define se second
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

const int INF=1e9;
const ll INFF=1e17;
const double EPS=1e-9;
const ll MOD=1e9+7;
vector<pair<pair<int,int>,int > >t;
int n,k;
bool flag,vis[110][3][110];;
bool check(int x,int y,int mov){
	if(x<0 || x>=n || y<0 || y>=3)return 1;
	for(auto u:t){
		if(u.se==y){
			int l_1=u.fi.fi-2*(mov-1),r_1=u.fi.se-2*(mov-1);
			int l_2=u.fi.fi-2*mov,r_2=u.fi.se-2*mov;
			if(x>=l_2 && x<=r_1)return 1;
		}
	}
	return 0;
}
void dfs(int x,int y,int mov){
	if(vis[x][y][mov])return;
	vis[x][y][mov]=1;
	if(x==(n-1)){flag=1;return;}
	if(!check(x+1,y,mov)){
		if(!check(x+1,y,mov+1))dfs(x+1,y,mov+1);
		if(!check(x+1,y+1,mov+1))dfs(x+1,y+1,mov+1);
		if(!check(x+1,y-1,mov+1))dfs(x+1,y-1,mov+1);
	}
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int test;
	cin >> test;
	while(test--){
		t.clear();
		string a[110];
		int sy;
		cin >> n >> k;
		REP(i,3)cin >> a[i];
		REP(i,3){
			int t1=0,l,r;
			char t2='z';
			while(t1<n){
				if(a[i][t1]=='s')sy=i;
				if((int)a[i][t1]>='A' && (int)a[i][t1]<='Z'){
					if(t2=='z'){t2=a[i][t1];l=t1;}
					else{
						if(a[i][t1]!=t2){r=t1;t.pb(mp(mp(l,r-1),i));l=t1;t2=a[i][t1];}
					}
				}
				else{
					if(t2!='z'){r=t1;t.pb(mp(mp(l,r-1),i));}
					t2='z';
				}
				t1++;
			}
			r=t1;
			if(t2!='z')t.pb(mp(mp(l,r-1),i));
		}
		REP(i,n+1)REP(j,3)REP(k,n+1)vis[i][j][k]=0;
		flag=0;
		dfs(0,sy,0);
		if(flag)cout << "YES" << '\n';
		else cout << "NO" << '\n';
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <iostream>
#include <iomanip>

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pii;
typedef vector<int> vi;

#define pb push_back
#define mp make_pair
#define set(a,b,c) for(int i=0;i<c;i++)a[i]=b;
#define si(n) scanf("%d",&n);
#define sii(n,m) scanf("%d%d",&n,&m);
#define siii(n,m,p) scanf("%d%d%d",&n,&m,&p);
#define sll(n) scanf("%lld",&n);
#define dout(n) printf("%d\n",n);
#define douts(n) printf("%d ",n);
#define lldout(n) printf("%lld\n",n);
#define lldouts(n) printf("%lld ",n);
#define in(n) cin >> n;
#define out(n) cout << n << endl;
#define outs(n) cout << n << " ";
#define csll(n) scanf("%I64d",&n);
#define clldout(n) printf("%I64d\n",n);
#define fi first
#define se second
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

const int INF=1e9;
const ll INFF=1e17;
const double EPS=1e-9;
const ll MOD=1e9+7;
vector<pair<pair<int,int>,int > >t;
int n,k;
bool flag,vis[110][3][110];;
bool check(int x,int y,int mov){
	if(x<0 || x>=n || y<0 || y>=3)return 1;
	for(auto u:t){
		if(u.se==y){
			int l_1=u.fi.fi-2*(mov-1),r_1=u.fi.se-2*(mov-1);
			int l_2=u.fi.fi-2*mov,r_2=u.fi.se-2*mov;
			if(x>=l_2 && x<=r_1)return 1;
		}
	}
	return 0;
}
void dfs(int x,int y,int mov){
	if(vis[x][y][mov])return;
	vis[x][y][mov]=1;
	if(x==(n-1)){flag=1;return;}
	if(!check(x+1,y,mov)){
		if(!check(x+1,y,mov+1))dfs(x+1,y,mov+1);
		if(!check(x+1,y+1,mov+1))dfs(x+1,y+1,mov+1);
		if(!check(x+1,y-1,mov+1))dfs(x+1,y-1,mov+1);
	}
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int test;
	cin >> test;
	while(test--){
		string a[110];
		cin >> n >> k;
		REP(i,3)cin >> a[i];
		REP(i,3){
			int t1=0,l,r;
			char t2='z';
			while(t1<n){
				if((int)a[i][t1]>='A' && (int)a[i][t1]<='Z'){
					if(t2=='z'){t2=a[i][t1];l=t1;}
					else{
						if(a[i][t1]!=t2){r=t1;t.pb(mp(mp(l,r-1),i));l=t1;t2=a[i][t1];}
					}
				}
				else{
					if(t2!='z'){r=t1;t.pb(mp(mp(l,r-1),i));}
					t2='z';
				}
				t1++;
			}
			r=t1;
			if(t2!='z')t.pb(mp(mp(l,r-1),i));
		}
		REP(i,n+1)REP(j,3)REP(k,n+1)vis[i][j][k]=0;
		flag=0;
		dfs(0,1,0);
		if(flag)cout << "YES" << '\n';
		else cout << "NO" << '\n';
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x.size()))
//#define dbg cout

int train[3][105];
set<int> q, q2;

int main()
{
//	ios::sync_with_stdio(0);
//	cin.tie(0);
//	freopen("in.txt","r",stdin);
//	freopen("out.txt","w",stdout);
a:
	int t; cin >> t;
	while(t--)
	{
		int n, k; cin >> n >> k;
		memset(train,0,sizeof train);
		q.clear(); q2.clear();
		for(int i=0; i<3; i++) for(int j=0; j<n; j++)
		{
			char ch; cin >> ch;
			train[i][j]=(ch!='.' and ch!='s');
			if(ch=='s') q.insert(i);
		}
		int win=0;
		for(int j=0; j<n; j++)
		{
//			dbg << sz(q) << ',' << sz(q2) << '\n';
			q2.clear();
			for(int i:q)
			{
//				dbg << "i:" << i << '\n';
				if(train[i][j]) continue;
				if(j==n-1) win=1;
				if(j+1>=n or train[i][j+1]) continue;
				q2.insert(i);
				if(i-1>=0 and (!train[i-1][j+1])) q2.insert(i-1);
				if(i+1<3 and (!train[i+1][j+1])) q2.insert(i+1);
			}
			q.clear();
			for(int u:q2)
			{
				q.insert(u);
			}
			for(int i=0; i<3; i++) for(int j=0; j<n; j++)
			{
				train[i][j]=(j+2<n and train[i][j+2]);
			}
		}
		if(win) cout << "YES\n";
		else cout << "NO\n";
	}
//	goto a;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x.size()))
//#define dbg cout

int train[3][105];
queue<int> q, q2;

int main()
{
	ios::sync_with_stdio(0);
//	cin.tie(0);
//	freopen("in.txt","r",stdin);
//	freopen("out.txt","w",stdout);
a:
	int t; cin >> t;
	while(t--)
	{
		int n, k; cin >> n >> k;
		memset(train,0,sizeof train);
		while(!q.empty()) q.pop();
		while(!q2.empty()) q2.pop();
		for(int i=0; i<3; i++) for(int j=0; j<n; j++)
		{
			char ch; cin >> ch;
			train[i][j]=(ch!='.' and ch!='s');
			if(ch=='s') q.push(i);
		}
		int win=0;
		for(int j=0; j<n; j++)
		{
			while(!q2.empty()) q2.pop();
			while(!q.empty())
			{
				int i=q.front(); q.pop();
				if(train[i][j]) continue;
				if(j==n-1) win=1;
				if(j+1>=n or train[i][j+1]) continue;
				q2.push(i);
				if(i-1>=0 and (!train[i-1][j+1])) q2.push(i-1);
				if(i+1<3 and (!train[i+1][j+1])) q2.push(i+1);
			}
			while(!q.empty()) q.pop();
			while(!q2.empty())
			{
				int u=q2.front(); q2.pop(); q.push(u);
			}
			for(int i=0; i<3; i++) for(int j=0; j<n; j++)
			{
				train[i][j]=(j+2<n and train[i][j+2]);
			}
		}
		if(win) cout << "YES\n";
		else cout << "NO\n";
	}
//	goto a;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 305
#define x first
#define y second

long long int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline long long int rnd(long long int l=0,long long int r=0xFFFFFFFFFFFFFFFL)
{return uniform_int_distribution<long long int>(l,r)(rng);}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

char a[3][MAX];
int vis[3][MAX][MAX]={0},n,k,s;
bool gg=false;

bool isvalid(int x,int y)
{
	return (x>=0 && x<n && y>=0 && y<3);
}
void dfs(int y,int x,int t)
{
	if(!isvalid(x,y))
	return;
	if(vis[y][x][t])
	return;
	if(gg)
	return;
	//cout<<x<<" "<<y<<" "<<t<<endl;
	vis[y][x][t]=1;
	if(x==n-1)
	{
		gg=true;
		return;
	}
	if(isvalid(x+1,y))
	if(!vis[y][x+1][t])
	{
		dfs(y,x+1,t+1);
		if(gg)
		return;
		if(isvalid(x+1,y-1))
		if(!vis[y-1][x+1][t])
		dfs(y-1,x+1,t+1);
		if(gg)
		return;
		if(isvalid(x+1,y+1))
		if(!vis[y+1][x+1][t])
		dfs(y+1,x+1,t+1);
	}
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		int i,j,l,m;
		cin>>n>>k;
		gg=false;
		memset(vis,0,sizeof(vis));
		for(i=0;i<3;i++)
		{
			for(j=0;j<MAX;j++)
			{
				if(j<n)
				cin>>a[i][j];
				else
				a[i][j]='.';
				if(a[i][j]=='s')
				s=i,a[i][j]='.';
				if(isalpha(a[i][j]))
				{
					for(l=j,m=0;l>=0;l-=2,m++)
					vis[i][l][m]=1;
				}
			}
		}
		/*for(m=0;m<7;m++)
		{
			cout<<m<<"##########################\n";
			for(i=0;i<3;i++)
			{
				for(j=0;j<n;j++)
				cout<<vis[i][j][m];
				cout<<endl;
			}
			cout<<endl;
		}*/
		dfs(s,0,0);
		if(gg)
		cout<<"YES\n";
		else
		cout<<"NO\n";
	}
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 305
#define x first
#define y second

long long int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline long long int rnd(long long int l=0,long long int r=0xFFFFFFFFFFFFFFFL)
{return uniform_int_distribution<long long int>(l,r)(rng);}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

char a[3][MAX];
int vis[3][MAX][MAX]={0},n,k,s;
bool gg=false;

bool isvalid(int x,int y)
{
	return (x>=0 && x<305 && y>=0 && y<3);
}
void dfs(int y,int x,int t)
{
	//cout<<x<<" "<<y<<" "<<t<<endl;
	if(!isvalid(x,y))
	return;
	if(vis[y][x][t])
	return;
	if(gg)
	return;
	vis[y][x][t]=1;
	if(a[y][2*t+y]!='.')
	return;
	if(x>=n)
	{
		gg=true;
		return;
	}
	dfs(y,x+1,t+1);
	if(gg)
	return;
	dfs(y-1,x+1,t+1);
	if(gg)
	return;
	dfs(y+1,x+1,t+1);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		int i,j;
		cin>>n>>k;
		gg=false;
		for(i=0;i<3;i++)
		{
			for(j=0;j<MAX;j++)
			{
				if(j<n)
				cin>>a[i][j];
				else
				a[i][j]='.';
				if(a[i][j]=='s')
				s=i,a[i][j]='.';
			}
		}
		/*for(i=0;i<3;i++)
		{
			for(j=0;j<n;j++)
			cout<<a[i][j];
			cout<<endl;
		}*/
		dfs(s,0,0);
		if(gg)
		cout<<"YES\n";
		else
		cout<<"NO\n";
	}
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 305
#define x first
#define y second

long long int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline long long int rnd(long long int l=0,long long int r=0xFFFFFFFFFFFFFFFL)
{return uniform_int_distribution<long long int>(l,r)(rng);}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

char a[3][MAX];
int vis[3][MAX][MAX]={0},n,k,s;
bool gg=false;

bool isvalid(int x,int y)
{
	return (x>=0 && x<305 && y>=0 && y<3);
}
void dfs(int y,int x,int t)
{
	//cout<<x<<" "<<y<<" "<<t<<endl;
	if(!isvalid(x,y))
	return;
	if(vis[y][x][t])
	return;
	if(gg)
	return;
	vis[y][x][t]=1;
	if(a[y][2*t+y]!='.')
	return;
	if(x==105)
	{
		gg=true;
		return;
	}
	dfs(y,x+1,t+1);
	if(gg)
	return;
	dfs(y-1,x+1,t+1);
	if(gg)
	return;
	dfs(y+1,x+1,t+1);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		int i,j;
		cin>>n>>k;
		gg=false;
		for(i=0;i<3;i++)
		{
			for(j=0;j<MAX;j++)
			{
				if(j<n)
				cin>>a[i][j];
				else
				a[i][j]='.';
				if(a[i][j]=='s')
				s=i,a[i][j]='.';
			}
		}
		/*for(i=0;i<3;i++)
		{
			for(j=0;j<n;j++)
			cout<<a[i][j];
			cout<<endl;
		}*/
		dfs(s,0,0);
		if(gg)
		cout<<"YES\n";
		else
		cout<<"NO\n";
	}
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 305
#define x first
#define y second

long long int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline long long int rnd(long long int l=0,long long int r=0xFFFFFFFFFFFFFFFL)
{return uniform_int_distribution<long long int>(l,r)(rng);}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

char a[3][MAX];
int vis[3][MAX][MAX]={0},n,k,s;
bool gg=false;

bool isvalid(int x,int y)
{
	return (x>=0 && x<n && y>=0 && y<3);
}
void dfs(int y,int x,int t)
{
	//cout<<x<<" "<<y<<" "<<t<<endl;
	if(!isvalid(x,y))
	return;
	if(vis[y][x][t])
	return;
	if(gg)
	return;
	vis[y][x][t]=1;
	if(a[y][2*t+y]!='.')
	return;
	if(x==105)
	{
		gg=true;
		return;
	}
	dfs(y,x+1,t+1);
	if(gg)
	return;
	dfs(y-1,x+1,t+1);
	if(gg)
	return;
	dfs(y+1,x+1,t+1);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		int i,j;
		cin>>n>>k;
		gg=false;
		for(i=0;i<3;i++)
		{
			for(j=0;j<MAX;j++)
			{
				if(j<n)
				cin>>a[i][j];
				else
				a[i][j]='.';
				if(a[i][j]=='s')
				s=i,a[i][j]='.';
			}
		}
		for(i=0;i<3;i++)
		{
			for(j=0;j<n;j++)
			cout<<a[i][j];
			cout<<endl;
		}
		dfs(s,0,0);
		if(gg)
		cout<<"YES\n";
		else
		cout<<"NO\n";
	}
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 305
#define x first
#define y second

long long int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline long long int rnd(long long int l=0,long long int r=0xFFFFFFFFFFFFFFFL)
{return uniform_int_distribution<long long int>(l,r)(rng);}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

char a[3][MAX];
int vis[3][MAX][MAX]={0},n,k,s;
bool gg=false;

bool isvalid(int x,int y)
{
	return (x>=0 && x<305 && y>=0 && y<3);
}
void dfs(int y,int x,int t)
{
	//cout<<x<<" "<<y<<" "<<t<<endl;
	if(!isvalid(x,y))
	return;
	if(vis[y][x][t])
	return;
	if(gg)
	return;
	vis[y][x][t]=1;
	if(a[y][2*t+x]!='.')
	return;
	if(x>=n)
	{
		gg=true;
		return;
	}
	dfs(y,x+1,t+1);
	if(gg)
	return;
	dfs(y-1,x+1,t+1);
	if(gg)
	return;
	dfs(y+1,x+1,t+1);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		int i,j;
		cin>>n>>k;
		gg=false;
		for(i=0;i<3;i++)
		{
			for(j=0;j<MAX;j++)
			{
				if(j<n)
				cin>>a[i][j];
				else
				a[i][j]='.';
				if(a[i][j]=='s')
				s=i,a[i][j]='.';
			}
		}
		/*for(i=0;i<3;i++)
		{
			for(j=0;j<n;j++)
			cout<<a[i][j];
			cout<<endl;
		}*/
		dfs(s,0,0);
		if(gg)
		cout<<"YES\n";
		else
		cout<<"NO\n";
	}
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 305
#define x first
#define y second

long long int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline long long int rnd(long long int l=0,long long int r=0xFFFFFFFFFFFFFFFL)
{return uniform_int_distribution<long long int>(l,r)(rng);}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

char a[3][MAX];
int vis[3][MAX][MAX]={0},n,k,s;
bool gg=false;

bool isvalid(int x,int y)
{
	return (x>=0 && x<n && y>=0 && y<3);
}
void dfs(int y,int x,int t)
{
	//cout<<x<<" "<<y<<" "<<t<<endl;
	if(!isvalid(x,y))
	return;
	if(vis[y][x][t])
	return;
	if(gg)
	return;
	vis[y][x][t]=1;
	if(a[y][2*t+y]!='.')
	return;
	if(x==n-1)
	{
		gg=true;
		return;
	}
	dfs(y,x+1,t+1);
	if(gg)
	return;
	dfs(y-1,x+1,t+1);
	if(gg)
	return;
	dfs(y+1,x+1,t+1);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		int i,j;
		cin>>n>>k;
		gg=false;
		for(i=0;i<3;i++)
		{
			for(j=0;j<MAX;j++)
			{
				if(j<n)
				cin>>a[i][j];
				else
				a[i][j]='.';
				if(a[i][j]=='s')
				s=i,a[i][j]='.';
			}
		}
		dfs(s,0,0);
		if(gg)
		cout<<"YES\n";
		else
		cout<<"NO\n";
	}
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 305
#define x first
#define y second

long long int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline long long int rnd(long long int l=0,long long int r=0xFFFFFFFFFFFFFFFL)
{return uniform_int_distribution<long long int>(l,r)(rng);}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

char a[3][MAX];
int vis[3][MAX][MAX]={0},n,k,s;
bool gg=false;

bool isvalid(int x,int y)
{
	return (x>=0 && x<305 && y>=0 && y<3);
}
void dfs(int y,int x,int t)
{
	//cout<<x<<" "<<y<<" "<<t<<endl;
	if(!isvalid(x,y))
	return;
	if(vis[y][x][t])
	return;
	if(gg)
	return;
	vis[y][x][t]=1;
	if(a[y][2*t+y]!='.')
	return;
	if(x==n-1)
	{
		gg=true;
		return;
	}
	dfs(y,x+1,t+1);
	if(gg)
	return;
	dfs(y-1,x+1,t+1);
	if(gg)
	return;
	dfs(y+1,x+1,t+1);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int t;
	cin>>t;
	while(t--)
	{
		int i,j;
		cin>>n>>k;
		gg=false;
		for(i=0;i<3;i++)
		{
			for(j=0;j<MAX;j++)
			{
				if(j<n)
				cin>>a[i][j];
				else
				a[i][j]='.';
				if(a[i][j]=='s')
				s=i,a[i][j]='.';
			}
		}
		/*for(i=0;i<3;i++)
		{
			for(j=0;j<n;j++)
			cout<<a[i][j];
			cout<<endl;
		}*/
		dfs(s,0,0);
		if(gg)
		cout<<"YES\n";
		else
		cout<<"NO\n";
	}
	return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;
int t,n,k;
char a[5][500];
bool vis[5][500],check;
bool valid(int x,int y)
{
    if(x<0||x>2||vis[x][y])return 0;
    return 1;
}
void dfs(int x,int y,int tm)
{
    if(!valid(x,y)||check)return;
    if(a[x][y+2*tm]!='.')return;
    vis[x][y]=1;
    if(y>=n-1){check=1;return;}
    dfs(x,y+1,tm+1);
    if(a[x+1][y+1+2*tm]=='.')dfs(x+1,y+1,tm+1);
    if(a[x-1][y+1+2*tm]=='.')dfs(x-1,y+1,tm+1);
}
int main()
{
    cin>>t;
    while(t--)
    {
        check=0;
        memset(vis,0,sizeof(vis));
        for(int i=0;i<4;i++)
            for(int j=0;j<500;j++)
                a[i][j]='.';
        cin>>n>>k;
        for(int i=0;i<3;i++)
            for(int j=0;j<n;j++)
                cin>>a[i][j];
        int p;
        for(int i=0;i<3;i++)
            if(a[i][0]=='s')p=i;
        a[p][0]='.';
        dfs(p,0,0);
        if(check)cout<<"YES\n";
        else cout<<"NO\n";
    }
return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;
int t,n,k;
char a[5][500];
bool vis[5][500],check;
bool valid(int x,int y)
{
    if(x<0||x>2||vis[x][y])return 0;
    return 1;
}
void dfs(int x,int y,int tm)
{
    if(!valid(x,y)||check)return;
    if(a[x][y+2*tm]!='.')return;
    vis[x][y]=1;
    if(y>=n-1){check=1;return;}
    if(a[x][y+2*tm+1]!='.')return;
    dfs(x,y+1,tm+1);
    if(a[x+1][y+1+2*tm]=='.')dfs(x+1,y+1,tm+1);
    if(a[x-1][y+1+2*tm]=='.')dfs(x-1,y+1,tm+1);
}
int main()
{
    cin>>t;
    while(t--)
    {
        check=0;
        memset(vis,0,sizeof(vis));
        for(int i=0;i<4;i++)
            for(int j=0;j<500;j++)
                a[i][j]='.';
        cin>>n>>k;
        for(int i=0;i<3;i++)
            for(int j=0;j<n;j++)
                cin>>a[i][j];
        int p;
        for(int i=0;i<3;i++)
            if(a[i][0]=='s')p=i;
        a[p][0]='.';
        dfs(p,0,0);
        if(check)cout<<"YES\n";
        else cout<<"NO\n";
    }
return 0;
}


# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <set>
# include <cmath>
# include <algorithm>
using namespace std;
# define lowbit(x) ((x)&(-x))
# define pi acos(-1.0)
# define eps 1e-3
# define MOD 1000000007
# define INF 1000000000
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
# define bug puts("H");
# define lch p<<1,l,mid
# define rch p<<1|1,mid+1,r
# define mp make_pair
# define pb push_back
typedef pair<int,int> PII;
typedef vector<int> VI;
# pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long LL;
int Scan() {
    int res=0, flag=0;
    char ch;
    if((ch=getchar())=='-') flag=1;
    else if(ch>='0'&&ch<='9') res=ch-'0';
    while((ch=getchar())>='0'&&ch<='9')  res=res*10+(ch-'0');
    return flag?-res:res;
}
void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
const int N=105;
//Code begin...

typedef struct{int x, y;}PX;
int ps[3][2]={{1,0},{1,1},{1,-1}}, vis[4][N];
char s[4][N];
queue<PII>que;

int main ()
{
    int T, n, k;
    scanf("%d",&T);
    while (T--) {
        mem(vis,0);
        while (!que.empty()) que.pop();
        scanf("%d%d",&n,&k);
        FOR(i,1,3) scanf("%s",s[i]+1);
        FOR(i,1,3) if (s[i][1]=='s') que.push(mp(1,i)), vis[1][i]=1;
        int flag=0;
        while (!que.empty()) {
            int x=que.front().first, y=que.front().second;
            que.pop();
            printf("%d %d\n",x,y);
            if (x>=n) {flag=1; break;}
            if (s[y][x+1]!='.') continue;
            FO(i,0,3) {
                int dx=x+ps[i][0], dy=y+ps[i][1];
                if (dy<=0||dy>3||s[dy][dx]!='.') continue;
                if (dx==n||s[dy][++dx]=='.') if (dx==n||s[dy][++dx]=='.')
                if (!vis[dx][dy]) que.push(mp(dx,dy)), vis[dx][dy]=1;
            }
        }
        puts(flag?"YES":"NO");
    }
    return 0;
}


# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <set>
# include <cmath>
# include <algorithm>
using namespace std;
# define lowbit(x) ((x)&(-x))
# define pi acos(-1.0)
# define eps 1e-3
# define MOD 1000000007
# define INF 1000000000
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
# define bug puts("H");
# define lch p<<1,l,mid
# define rch p<<1|1,mid+1,r
# define mp make_pair
# define pb push_back
typedef pair<int,int> PII;
typedef vector<int> VI;
# pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long LL;
int Scan() {
    int res=0, flag=0;
    char ch;
    if((ch=getchar())=='-') flag=1;
    else if(ch>='0'&&ch<='9') res=ch-'0';
    while((ch=getchar())>='0'&&ch<='9')  res=res*10+(ch-'0');
    return flag?-res:res;
}
void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
const int N=105;
//Code begin...

typedef struct{int x, y;}PX;
int ps[3][2]={{1,0},{1,1},{1,-1}}, vis[4][N];
char s[4][N];
queue<PII>que;

int main ()
{
    int T, n, k;
    scanf("%d",&T);
    while (T--) {
        mem(vis,0);
        while (!que.empty()) que.pop();
        scanf("%d%d",&n,&k);
        FOR(i,1,3) scanf("%s",s[i]+1);
        FOR(i,1,3) if (s[i][1]=='s') que.push(mp(1,i)), vis[i][1]=1;
        int flag=0;
        while (!que.empty()) {
            int x=que.front().first, y=que.front().second;
            que.pop();
            if (x>=n) {flag=1; break;}
            if (s[y][x+1]!='.') continue;
            FO(i,0,3) {
                int dx=x+ps[i][0], dy=y+ps[i][1];
                if (dy<=0||dy>3||s[dy][dx]!='.') continue;
                if (dx==n||s[dy][++dx]=='.') if (dx==n||s[dy][++dx]=='.')
                if (!vis[dy][dx]) que.push(mp(dx,dy)), vis[dy][dx]=1;
            }
        }
        puts(flag?"YES":"NO");
    }
    return 0;
}


# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <set>
# include <cmath>
# include <algorithm>
using namespace std;
# define lowbit(x) ((x)&(-x))
# define pi acos(-1.0)
# define eps 1e-3
# define MOD 1000000007
# define INF 1000000000
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
# define bug puts("H");
# define lch p<<1,l,mid
# define rch p<<1|1,mid+1,r
# define mp make_pair
# define pb push_back
typedef pair<int,int> PII;
typedef vector<int> VI;
# pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long LL;
int Scan() {
    int res=0, flag=0;
    char ch;
    if((ch=getchar())=='-') flag=1;
    else if(ch>='0'&&ch<='9') res=ch-'0';
    while((ch=getchar())>='0'&&ch<='9')  res=res*10+(ch-'0');
    return flag?-res:res;
}
void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
const int N=105;
//Code begin...

typedef struct{int x, y;}PX;
int ps[3][2]={{1,0},{1,1},{1,-1}}, vis[4][N];
char s[4][N];
queue<PII>que;

int main ()
{
    int T, n, k;
    scanf("%d",&T);
    while (T--) {
        scanf("%d%d",&n,&k);
        FOR(i,1,3) scanf("%s",s[i]+1);
        FOR(i,1,3) if (s[i][1]=='s') que.push(mp(1,i)), vis[1][i]=1;
        int flag=0;
        while (!que.empty()) {
            int x=que.front().first, y=que.front().second;
            que.pop();
            if (x>=n) {flag=1; break;}
            if (s[y][x+1]!='.') continue;
            FO(i,0,3) {
                int dx=x+ps[i][0], dy=y+ps[i][1];
                if (dy<=0||dy>3||s[dy][dx]!='.') continue;
                if (dx==n||s[dy][++dx]=='.') if (dx==n||s[dy][++dx]=='.')
                if (!vis[dx][dy]) que.push(mp(dx,dy)), vis[dx][dy]=1;
            }
        }
        puts(flag?"YES":"NO");
    }
    return 0;
}


# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <set>
# include <cmath>
# include <algorithm>
using namespace std;
# define lowbit(x) ((x)&(-x))
# define pi acos(-1.0)
# define eps 1e-3
# define MOD 1000000007
# define INF 1000000000
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
# define bug puts("H");
# define lch p<<1,l,mid
# define rch p<<1|1,mid+1,r
# define mp make_pair
# define pb push_back
typedef pair<int,int> PII;
typedef vector<int> VI;
# pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long LL;
int Scan() {
    int res=0, flag=0;
    char ch;
    if((ch=getchar())=='-') flag=1;
    else if(ch>='0'&&ch<='9') res=ch-'0';
    while((ch=getchar())>='0'&&ch<='9')  res=res*10+(ch-'0');
    return flag?-res:res;
}
void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
const int N=105;
//Code begin...

typedef struct{int x, y;}PX;
int ps[3][2]={{1,0},{1,1},{1,-1}}, vis[4][N];
char s[4][N];
queue<PII>que;

int main ()
{
    int T, n, k;
    scanf("%d",&T);
    while (T--) {
        mem(vis,0);
        while (!que.empty()) que.pop();
        scanf("%d%d",&n,&k);
        FOR(i,1,3) scanf("%s",s[i]+1);
        FOR(i,1,3) if (s[i][1]=='s') que.push(mp(1,i)), vis[1][i]=1;
        int flag=0;
        while (!que.empty()) {
            int x=que.front().first, y=que.front().second;
            que.pop();
            if (x>=n) {flag=1; break;}
            if (s[y][x+1]!='.') continue;
            FO(i,0,3) {
                int dx=x+ps[i][0], dy=y+ps[i][1];
                if (dy<=0||dy>3||s[dy][dx]!='.') continue;
                if (dx==n||s[dy][++dx]=='.') if (dx==n||s[dy][++dx]=='.')
                if (!vis[dx][dy]) que.push(mp(dx,dy)), vis[dx][dy]=1;
            }
        }
        puts(flag?"YES":"NO");
    }
    return 0;
}


# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <set>
# include <cmath>
# include <algorithm>
using namespace std;
# define lowbit(x) ((x)&(-x))
# define pi acos(-1.0)
# define eps 1e-3
# define MOD 1000000007
# define INF 1000000000
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
# define bug puts("H");
# define lch p<<1,l,mid
# define rch p<<1|1,mid+1,r
# define mp make_pair
# define pb push_back
typedef pair<int,int> PII;
typedef vector<int> VI;
# pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long LL;
int Scan() {
    int res=0, flag=0;
    char ch;
    if((ch=getchar())=='-') flag=1;
    else if(ch>='0'&&ch<='9') res=ch-'0';
    while((ch=getchar())>='0'&&ch<='9')  res=res*10+(ch-'0');
    return flag?-res:res;
}
void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
const int N=1000005;
//Code begin...

typedef struct{int x, y;}PX;
int ps[3][2]={{1,0},{1,1},{1,-1}};
char s[4][N];
queue<PII>que;

int main ()
{
    int T, n, k;
    scanf("%d",&T);
    while (T--) {
        scanf("%d%d",&n,&k);
        FOR(i,1,3) scanf("%s",s[i]+1);
        FOR(i,1,3) if (s[i][1]=='s') que.push(mp(1,i));
        int flag=0;
        while (!que.empty()) {
            int x=que.front().first, y=que.front().second;
            que.pop();
            if (x>=n) {flag=1; break;}
            if (s[y][x+1]!='.') continue;
            FO(i,0,3) {
                int dx=x+ps[i][0], dy=y+ps[i][1];
                if (dy<=0||dy>3||s[dy][dx]!='.') continue;
                if (dx==n||s[dy][++dx]=='.') if (dx==n||s[dy][++dx]=='.') que.push(mp(dx,dy));
            }
        }
        puts(flag?"YES":"NO");
    }
    return 0;
}


# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <set>
# include <cmath>
# include <algorithm>
using namespace std;
# define lowbit(x) ((x)&(-x))
# define pi acos(-1.0)
# define eps 1e-3
# define MOD 1000000007
# define INF 1000000000
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
# define bug puts("H");
# define lch p<<1,l,mid
# define rch p<<1|1,mid+1,r
# define mp make_pair
# define pb push_back
typedef pair<int,int> PII;
typedef vector<int> VI;
# pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long LL;
int Scan() {
    int res=0, flag=0;
    char ch;
    if((ch=getchar())=='-') flag=1;
    else if(ch>='0'&&ch<='9') res=ch-'0';
    while((ch=getchar())>='0'&&ch<='9')  res=res*10+(ch-'0');
    return flag?-res:res;
}
void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
const int N=105;
//Code begin...

typedef struct{int x, y;}PX;
int ps[3][2]={{1,0},{1,1},{1,-1}};
char s[4][N];
queue<PII>que;

int main ()
{
    int T, n, k;
    scanf("%d",&T);
    while (T--) {
        scanf("%d%d",&n,&k);
        FOR(i,1,3) scanf("%s",s[i]+1);
        FOR(i,1,3) if (s[i][1]=='s') que.push(mp(1,i));
        int flag=0;
        while (!que.empty()) {
            int x=que.front().first, y=que.front().second;
            que.pop();
            if (x>=n) {flag=1; break;}
            if (s[y][x+1]!='.') continue;
            FO(i,0,3) {
                int dx=x+ps[i][0], dy=y+ps[i][1];
                if (dy<=0||dy>3||s[dy][dx]!='.') continue;
                if (dx==n||s[dy][++dx]=='.') if (dx==n||s[dy][++dx]=='.') que.push(mp(dx,dy));
            }
        }
        puts(flag?"YES":"NO");
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <cstdio>
#include <vector>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>

#define inf 0x3f3f3f3f
const int maxn=1e6+10;
using namespace std;
typedef long long ll;
int n,k;
char mapp[110][110];
int vis[110][110];

struct node
{
    int x;
    int y;
} start,now;

queue <node> q;

int istrue(int x,int y)
{
    if((mapp[x][y]>='a'&&mapp[x][y]<='z')||(mapp[x][y]>='A'&&mapp[x][y]<='Z'))
        return 1;
    else
        return 0;
}

int bfs(int x,int y)
{
    while(!q.empty())
    {
        q.pop();
    }
    int i;
    memset(vis,0,sizeof(vis));
    start.x=x;
    start.y=y;
    vis[x][y]=1;
    q.push(start);
    while(!q.empty())
    {
        now=q.front();
        q.pop();
        if(now.y>=n)
            return 1;
        now.y+=1;
        if(istrue(now.x,now.y))
        {
            continue;
        }
        for(i=-1;i<=1;i++)
        {
            start.x=now.x+i;
            start.y=now.y;
            if(start.x>=1&&start.x<=3)
            {
                if(istrue(start.x,start.y) || istrue(start.x,start.y+1) || istrue(start.x,start.y+2))
                    continue;
                if(vis[start.x][start.y+2]==1)
                    continue;
                start.y+=2;
                vis[start.x][start.y]=1;
                if(start.y>=n)
                    return 1;
                q.push(start);

            }
        }
    }
    return 0;

}

int  main()
{
    int T;
    int c,d;
    cin>>T;
    while(T--)
    {
        cin>>n>>k;
        for(int i=1; i<=3; i++)
        {
            for(int j=1; j<=n; j++)
            {
                cin>>mapp[i][j];
            }
        }
        for(int i=1; i<=3; i++)
        {
            for(int j=1; j<=n; j++)
            {
                if(mapp[i][j]=='s')
                {
                    c=i;
                    d=j;
                }
            }
        }
        int flag=bfs(c,d);
        if(flag==1)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <cstdio>
#include <vector>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>

#define inf 0x3f3f3f3f
const int maxn=1e6+10;
using namespace std;
typedef long long ll;
int n,k;
char mapp[110][110];
int vis[110][110];

struct node
{
    int x;
    int y;
} start,now;

queue <node> q;

int istrue(int x,int y)
{
    if((mapp[x][y]>='a'&&mapp[x][y]<='z')||(mapp[x][y]>='A'&&mapp[x][y]<='Z'))
        return 1;
    else
        return 0;
}

int bfs(int x,int y)
{
    while(!q.empty())
    {
        q.pop();
    }
    int i;
    memset(vis,0,sizeof(vis));
    start.x=x;
    start.y=y;
    vis[x][y]=1;
    q.push(start);
    while(!q.empty())
    {
        now=q.front();
        q.pop();
        if(now.y>=n)
            return 1;
        now.y+=1;
        if(istrue(now.x,now.y))
        {
            continue;
        }
        for(i=-1;i<=1;i++)
        {
            start.x=now.x+i;
            start.y=now.y;
            if(start.x>=1&&start.x<=3)
            {
                if(istrue(start.x,start.y) || istrue(start.x,start.y+1) || istrue(start.x,start.y+2))
                    continue;
                start.y+=2;
                vis[start.x][start.y]=1;
                if(start.y>=n)
                    return 1;
                q.push(start);

            }
        }
    }
    return 0;

}

int  main()
{
    int T;
    int c,d;
    cin>>T;
    while(T--)
    {
        cin>>n>>k;
        for(int i=1;i<=3;i++)
            scanf(" %s",mapp[i]+1);
        for(int i=1; i<=3; i++)
        {
            for(int j=1; j<=n; j++)
            {
                if(mapp[i][j]=='s')
                {
                    c=i;
                    d=j;
                }
            }
        }
        int flag=bfs(c,d);
        if(flag==1)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <cstdio>
#include <vector>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>

#define inf 0x3f3f3f3f
const int maxn=1e6+10;
using namespace std;
typedef long long ll;
int n,k;
char mapp[110][110];
int vis[110][110];

struct node
{
    int x;
    int y;
} start,now;

queue <node> q;

int istrue(int x,int y)
{
    if((mapp[x][y]>='a'&&mapp[x][y]<='z')||(mapp[x][y]>='A'&&mapp[x][y]<='Z'))
        return 1;
    else
        return 0;
}

int bfs(int x,int y)
{
    while(!q.empty())
    {
        q.pop();
    }
    int i;
    memset(vis,0,sizeof(vis));
    start.x=x;
    start.y=y;
    vis[x][y]=1;
    q.push(start);
    while(!q.empty())
    {
        now=q.front();
        q.pop();
        if(now.y>=n)
            return 1;
        now.y+=1;
        if(istrue(now.x,now.y))
        {
            continue;
        }
        for(i=-1;i<=1;i++)
        {
            start.x=now.x+i;
            start.y=now.y;
            if(start.x>=1&&start.x<=3)
            {
                if(istrue(start.x,start.y) || istrue(start.x,start.y+1) || istrue(start.x,start.y+2))
                    continue;
                if(vis[start.x][start.y+2]==1)
                    continue;
                start.y+=2;
                vis[start.x][start.y]=1;
                if(start.y>=n)
                    return 1;
                q.push(start);

            }
        }
    }
    return 0;

}

int  main()
{
    int T;
    int c,d;
    cin>>T;
    while(T--)
    {
        cin>>n>>k;
        for(int i=1; i<=3; i++)
        {
            getchar();
            for(int j=1; j<=n; j++)
            {
                cin>>mapp[i][j];
            }
        }
        for(int i=1; i<=3; i++)
        {
            for(int j=1; j<=n; j++)
            {
                if(mapp[i][j]=='s')
                {
                    c=i;
                    d=j;
                }
            }
        }
        int flag=bfs(c,d);
        if(flag==1)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <cstdio>
#include <vector>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>

#define inf 0x3f3f3f3f
const int maxn=1e6+10;
using namespace std;
typedef long long ll;
int n,k;
char mapp[110][110];
int vis[110][110];

struct node
{
    int x;
    int y;
} start,now;

queue <node> q;

int istrue(int x,int y)
{
    if((mapp[x][y]>='a'&&mapp[x][y]<='z')||(mapp[x][y]>='A'&&mapp[x][y]<='Z'))
        return 1;
    else
        return 0;
}

int bfs(int x,int y)
{
    while(!q.empty())
    {
        q.pop();
    }
    int i;
    memset(vis,0,sizeof(vis));
    start.x=x;
    start.y=y;
    vis[x][y]=1;
    q.push(start);
    while(!q.empty())
    {
        now=q.front();
        q.pop();
        if(now.y>=n)
            return 1;
        now.y+=1;
        if(istrue(now.x,now.y))
        {
            continue;
        }
        for(i=-1;i<=1;i++)
        {
            start.x=now.x+i;
            start.y=now.y;
            if(start.x>=1&&start.x<=3)
            {
                if(istrue(start.x,start.y) || istrue(start.x,start.y+1) || istrue(start.x,start.y+2))
                    continue;
                if(vis[start.x][start.y+2]==1)
                    continue;
                start.y+=2;
                vis[start.x][start.y]=1;
                if(start.y>=n)
                    return 1;
                q.push(start);

            }
        }
    }
    return 0;

}

int  main()
{
    int T;
    int c,d;
    cin>>T;
    while(T--)
    {
        cin>>n>>k;
        for(int i=1;i<=3;i++)
            scanf(" %s",mapp[i]+1);
        for(int i=1; i<=3; i++)
        {
            for(int j=1; j<=n; j++)
            {
                if(mapp[i][j]=='s')
                {
                    c=i;
                    d=j;
                }
            }
        }
        int flag=bfs(c,d);
        if(flag==1)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cstring>
#include<string>
using namespace std;
int dx[] = { 1,1,1 };
int dy[] = { 0,1,-1 };
bool x = false;
bool vist[3][106];
char arr[3][106];
int n;
bool en(int x, int y) {
	if (!vist[x][y]&&x >= 0 && x <= 2 && arr[x][y] == '.'
		&&arr[x][y + 2] == '.'&&arr[x][y + 1] == '.')
		return true;
    return false;
}
void dfs(int i, int j) {
	vist[i][j] = true;
	if (j >= n) {
		x = true;
		return;
	}
	for (int k = 0; k < 3; ++k) {
		if (en(i + dy[k], j + dx[k])) {
			if (arr[i][j + 1] == '.') {
				vist[i + dy[k]][j + dx[k] + 1] = true;
				vist[i][j + 1] = true;
				vist[i + dy[k]][j + dx[k]] = true;
				dfs(i + dy[k], j + dx[k] + 2);

			}
		}
	}
}
int main() {

	int t, k;
	cin >> t;
	while (t--) {
		memset(vist, 0, sizeof(vist));
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 106; ++j)
				arr[i][j] = '.';
		}
		cin >> n >> k;
		int l, r;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < n; ++j) {
				cin >> arr[i][j];
				if (arr[i][j] == 's')
					l = i, r = j;
			}

		}
		x = false;
		dfs(l, r);
		if (x)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cstring>
#include<string>
using namespace std;
int dx[] = { 1,1,1 };
int dy[] = { 0,1,-1 };
bool x = false;
bool vist[3][206];
char arr[3][206];
int n;
bool en(int x, int y) {
	if (!vist[x][y]&&x >= 0 && x <= 2 && arr[x][y] == '.'
		&&arr[x][y + 2] == '.'&&arr[x][y + 1] == '.')
		return true;
    return false;
}
void dfs(int i, int j) {
	vist[i][j] = true;
	if (j >= n) {
		x = true;
		return;
	}
	for (int k = 0; k < 3; ++k) {
		if (en(i + dy[k], j + dx[k])) {
			if(arr[i][j+1]=='.'&&!vist[i][j+1]&&k!=0)
			dfs(i + dy[k], j + dx[k]+2);
			else if(k==0)
			 dfs(i + dy[k], j + dx[k] + 2);
		}
	}
}
int main() {

	int t, k;
	cin >> t;
	while (t--) {
		memset(vist, 0, sizeof(vist));
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 204; ++j)
				arr[i][j] = '.';
		}
		cin >> n >> k;
		int l, r;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < n; ++j) {
				cin >> arr[i][j];
				if (arr[i][j] == 's')
					l = i, r = j;
			}

		}
		x = false;
		dfs(l, r);
		if (x)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cstring>
#include<string>
using namespace std;
int dx[] = { 1,1,1 };
int dy[] = { 0,1,-1 };
bool x = false;
bool vist[3][106];
char arr[3][106];
int n;
bool en(int x, int y) {
	if (!vist[x][y]&&x >= 0 && x <= 2 && arr[x][y] == '.'
		&&arr[x][y + 2] == '.'&&arr[x][y + 1] == '.')
		return true;
    return false;
}
void dfs(int i, int j) {
	vist[i][j] = true;
	if (j >= n) {
		x = true;
		return;
	}
	for (int k = 0; k < 3; ++k) {
		if (en(i + dy[k], j + dx[k])) {
			if(arr[i][j+1]=='.'&&!vist[i][j+1]&&k!=0)
			dfs(i + dy[k], j + dx[k]+2);
			else if(k==0)
			 dfs(i + dy[k], j + dx[k] + 2);
		}
	}
}
int main() {

	int t, k;
	cin >> t;
	while (t--) {
		memset(vist, 0, sizeof(vist));
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 106; ++j)
				arr[i][j] = '.';
		}
		cin >> n >> k;
		int l, r;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < n; ++j) {
				cin >> arr[i][j];
				if (arr[i][j] == 's')
					l = i, r = j;
			}

		}
		x = false;
		dfs(l, r);
		if (x)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<string>
using namespace std;
int dx[] = { 1,1,1 };
int dy[] = { 0,1,-1 };
bool x = false;
bool vist[3][206];
char arr[3][206];
int n;
bool en(int x, int y) {
	if (!vist[x][y]&&x >= 0 && x <= 2 && arr[x][y] == '.'
		&&arr[x][y + 2] == '.'&&arr[x][y + 1] == '.')
		return true;
    return false;
}
void dfs(int i, int j) {
	vist[i][j] = true;
	if (j >= n) {
		x = true;
		return;
	}
	for (int k = 0; k < 3; ++k) {
		if (en(i + dy[k], j + dx[k])) {
			if(arr[i][j+1]=='.'&&!vist[i][j+1]&&k!=0)
			dfs(i + dy[k], j + dx[k]+2);
			else if(k==0)
			 dfs(i + dy[k], j + dx[k] + 2);
		}
	}
}
int main() {

	int t, k;
	cin >> t;
	while (t--) {
		memset(vist, 0, sizeof(vist));
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 204; ++j)
				arr[i][j] = '.';
		}
		cin >> n >> k;
		int l, r;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < n; ++j) {
				cin >> arr[i][j];
				if (arr[i][j] == 's')
					l = i, r = j;
			}

		}
		x = false;
		dfs(l, r);
		if (x)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cstring>
#include<string>
using namespace std;
int dx[] = { 1,1,1 };
int dy[] = { 0,1,-1 };
bool x = false;
bool vist[3][106];
char arr[3][106];
int n;
bool en(int x, int y) {
	if (!vist[x][y]&&x >= 0 && x <= 2 && arr[x][y] == '.'
		&&arr[x][y + 2] == '.'&&arr[x][y + 1] == '.')
		return true;
    return false;
}
void dfs(int i, int j) {
	vist[i][j] = true;
	if (j >= n) {
		x = true;
		return;
	}
	for (int k = 0; k < 3; ++k) {
		if (en(i + dy[k], j + dx[k])) {
			if (arr[i][j + 1] == '.' && !vist[i][j + 1])
			{
				vist[i + dy[k]][j + dx[k] + 1] = true;
				vist[i + dy[k]][j + dx[k]] = true;
				dfs(i + dy[k], j + dx[k] + 2);

			}
		}
	}
}
int main() {

	int t, k;
	cin >> t;
	while (t--) {
		memset(vist, 0, sizeof(vist));
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 106; ++j)
				arr[i][j] = '.';
		}
		cin >> n >> k;
		int l, r;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < n; ++j) {
				cin >> arr[i][j];
				if (arr[i][j] == 's')
					l = i, r = j;
			}

		}
		x = false;
		dfs(l, r);
		if (x)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}


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

#define M 1000000007

#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vll vector<long long>

typedef long long ll;
typedef long double ld;

vector<int> adj[100][3];
int n;

bool dfs(int i, int tr)
{
    //cout<<i<<" "<<tr<<endl;
    if(adj[i][tr].empty())
    {
        //cout<<i<<" "<<tr<<"cc"<<endl;
        return false;
    }
    if(i>=(n-3))return true;
    bool chk=false;
    for(auto j : adj[i][tr])
    {
        chk|=dfs(i+3,j);
    }
    return chk;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t; cin>>t;
    for(int q=0; q<t; q++)
    {
        int k;
        cin>>n>>k;
        string tr0, tr1, tr2;
        cin>>tr0>>tr1>>tr2;
        tr0=tr0+"...";
        tr1=tr1+"...";
        tr2=tr2+"...";
        for(int i=0; i<n; i++)
        {
            if(tr0[i+1]=='.')
            {
                if(tr0[i+2]=='.' and tr0[i+3]=='.')
                {
                    adj[i][0].pb(0);
                }
                if(tr1[i+1]=='.' and tr1[i+2]=='.' and tr1[i+3]=='.')
                {
                    adj[i][0].pb(1);
                }
            }
            if(tr1[i+1]=='.')
            {
                if(tr1[i+2]=='.' and tr1[i+3]=='.')
                {
                    adj[i][1].pb(1);
                }
                if(tr0[i+1]=='.' and tr0[i+2]=='.' and tr0[i+3]=='.')
                {
                    adj[i][1].pb(0);
                }
                if(tr2[i+1]=='.' and tr2[i+2]=='.' and tr2[i+3]=='.')
                {
                    adj[i][1].pb(2);
                }
            }
            if(tr2[i+1]=='.')
            {
                if(tr2[i+2]=='.' and tr2[i+3]=='.')
                {
                    adj[i][2].pb(2);
                }
                if(tr1[i+1]=='.' and tr1[i+2]=='.' and tr1[i+3]=='.')
                {
                    adj[i][2].pb(1);
                }
            }
        }
        //cout<<tr0<<endl<<tr1<<endl<<tr2<<endl;
        bool chk=false;
        if(tr0[0]=='s')chk=dfs(0,0);
        else if(tr1[0]=='s')chk=dfs(0,1);
        else if(tr2[0]=='s')chk=dfs(0,2);
        if(chk==true)
        {
            cout<<"YES\n";
        }
        else cout<<"NO\n";
        for(int i=0; i<n; i++)
        {
            for(int j=0; j<3; j++)
            {
                adj[i][j].clear();
            }
        }
    }
    return 0;
}


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

#define M 1000000007

#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vll vector<long long>

typedef long long ll;
typedef long double ld;

vector<int> adj[100][3];
int arr[100][3];
int n;

bool dfs(int i, int tr)
{
    //cout<<i<<" "<<tr<<endl;
    if(arr[i][tr]>=0)return arr[i][tr];
    if(adj[i][tr].empty())
    {
        //cout<<i<<" "<<tr<<"cc"<<endl;
        return arr[i][tr]=false;
    }
    if(i>=(n-3))return arr[i][tr]=true;
    bool chk=false;
    for(auto j : adj[i][tr])
    {
        chk|=dfs(i+3,j);
    }
    return arr[i][tr]=chk;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t; cin>>t;
    for(int q=0; q<t; q++)
    {
        memset(arr,-1,sizeof(arr));
        int k;
        cin>>n>>k;
        string tr0, tr1, tr2;
        cin>>tr0>>tr1>>tr2;
        tr0=tr0+"...";
        tr1=tr1+"...";
        tr2=tr2+"...";
        for(int i=0; i<n; i++)
        {
            if(tr0[i+1]=='.')
            {
                if(tr0[i+2]=='.' and tr0[i+3]=='.')
                {
                    adj[i][0].pb(0);
                }
                if(tr1[i+1]=='.' and tr1[i+2]=='.' and tr1[i+3]=='.')
                {
                    adj[i][0].pb(1);
                }
            }
            if(tr1[i+1]=='.')
            {
                if(tr1[i+2]=='.' and tr1[i+3]=='.')
                {
                    adj[i][1].pb(1);
                }
                if(tr0[i+1]=='.' and tr0[i+2]=='.' and tr0[i+3]=='.')
                {
                    adj[i][1].pb(0);
                }
                if(tr2[i+1]=='.' and tr2[i+2]=='.' and tr2[i+3]=='.')
                {
                    adj[i][1].pb(2);
                }
            }
            if(tr2[i+1]=='.')
            {
                if(tr2[i+2]=='.' and tr2[i+3]=='.')
                {
                    adj[i][2].pb(2);
                }
                if(tr1[i+1]=='.' and tr1[i+2]=='.' and tr1[i+3]=='.')
                {
                    adj[i][2].pb(1);
                }
            }
        }
        //cout<<tr0<<endl<<tr1<<endl<<tr2<<endl;
        bool chk=false;
        if(tr0[0]=='s')chk=dfs(0,0);
        else if(tr1[0]=='s')chk=dfs(0,1);
        else if(tr2[0]=='s')chk=dfs(0,2);
        if(chk==true)
        {
            cout<<"YES\n";
        }
        else cout<<"NO\n";
        for(int i=0; i<n; i++)
        {
            for(int j=0; j<3; j++)
            {
                adj[i][j].clear();
            }
        }
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <iostream>
#include <vector>
#include <queue>
#define inf 0x3f3f3f3f
using namespace std;
const int maxn = 150;
typedef long long ll;
struct node
{
	int x, y;
	node(int x=0,int y=0):x(x),y(y){}
};
int m, vis[maxn][maxn],sx,sy;
char s[10][maxn];
int dx[3] = { 0,1,-1 };
int dy[3] = { 1,1,1 };

int bfs()
{
	queue<node>que;
	que.push(node(sx, sy));
	vis[sx][sy] = 1;
	while(!que.empty())
	{
		node e = que.front(); que.pop();
		//printf("%d %d\n", e.x + 1, e.y);
		if (s[e.x][e.y+1] != '.') continue;
		for(int i=0;i<3;i++)
		{
			int tx = e.x + dx[i];
			int ty = e.y + dy[i];

			if (vis[tx][ty]) continue;
			if (tx<1 || ty<1 || tx>3) continue;
			if (s[tx][ty] != '.') continue;

			if (ty >= m) return 1;
			if (s[tx][ty + 1] != '.') continue;
			if (ty + 1 >= m) return 1;
			if (s[tx][ty + 2] != '.') continue;
			if (ty + 2 >= m) return 1;

			//printf("tx=%d ty=%d\n", tx, ty);
			vis[e.x][e.y+1] = 1;
			vis[tx][ty] = 1;
			vis[tx][ty + 1] = 1;
			vis[tx][ty + 2] = 1;
			que.push(node(tx, ty + 2));
		}
	}
	return 0;
}

int main()
{
	int t,k;
	cin >> t;
	while(t--)
	{
		cin >> m>>k;
		for(int i=1;i<=3;i++)
		{
			cin >> s[i] + 1;
			for(int j=1;j<=m;j++)
			{
				if (s[i][j] == 's') sx = i, sy = j;
			}
		}
		memset(vis, 0, sizeof(vis));
		int f=bfs();
		if (f) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <iostream>
#include <vector>
#include <queue>
#define inf 0x3f3f3f3f
using namespace std;
const int maxn = 150;
typedef long long ll;
struct node
{
	int x, y;
	node(int x=0,int y=0):x(x),y(y){}
}exa[maxn];
int m, vis[maxn][maxn],sx,sy;
char s[10][maxn];
int dx[3] = { 0,1,-1 };
int dy[3] = { 1,1,1 };

int bfs()
{
	queue<node>que;
	que.push(node(sx, sy));
	while(!que.empty())
	{
		node e = que.front(); que.pop();
	//	printf("%d %d\n", e.x + 1, e.y);
		if (s[e.x][e.y+1] != '.') continue;
		for(int i=0;i<3;i++)
		{
			int tx = e.x + dx[i];
			int ty = e.y + dy[i];

			if (tx<1 || ty<1 || tx>3) continue;
			if (s[tx][ty] != '.') continue;

			if (ty >= m) return 1;
			if (s[tx][ty + 1] != '.') continue;
			if (ty + 1 >= m) return 1;
			if (s[tx][ty + 2] != '.') continue;
			if (ty + 2 >= m) return 1;

		//	printf("tx=%d ty=%d\n", tx, ty);
			que.push(node(tx, ty + 2));
		}
	}
	return 0;
}

int main()
{
	int t,k;
	cin >> t;
	while(t--)
	{
		cin >> m>>k;
		for(int i=1;i<=3;i++)
		{
			cin >> s[i] + 1;
			for(int j=1;j<=m;j++)
			{
				if (s[i][j] == 's') sx = i, sy = j;
			}
		}
		int f=bfs();
		if (f) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <iostream>
#include <vector>
#include <queue>
#define inf 0x3f3f3f3f
using namespace std;
const int maxn = 150;
typedef long long ll;
struct node
{
	int x, y;
	node(int x=0,int y=0):x(x),y(y){}
};
int m, vis[maxn][maxn],sx,sy;
char s[10][maxn];
int dx[3] = { 0,1,-1 };
int dy[3] = { 1,1,1 };

int bfs()
{
	queue<node>que;
	que.push(node(sx, sy));
	vis[sx][sy] = 1;
	while(!que.empty())
	{
		node e = que.front(); que.pop();
	//	printf("%d %d\n", e.x + 1, e.y);
		vis[e.x][e.y + 1] = 1;
		if (s[e.x][e.y+1] != '.') continue;
		for(int i=0;i<3;i++)
		{
			int tx = e.x + dx[i];
			int ty = e.y + dy[i];

			if (vis[tx][ty]) continue;
			if (tx<1 || ty<1 || tx>3) continue;
			if (s[tx][ty] != '.') continue;

			if (ty >= m) return 1;
			if (s[tx][ty + 1] != '.') continue;
			if (ty + 1 >= m) return 1;
			if (s[tx][ty + 2] != '.') continue;
			if (ty + 2 >= m) return 1;

		//	printf("tx=%d ty=%d\n", tx, ty);
			vis[tx][ty] = 1;
			vis[tx][ty + 1] = 1;
			vis[tx][ty + 2] = 1;
			que.push(node(tx, ty + 2));
		}
	}
	return 0;
}

int main()
{
	int t,k;
	cin >> t;
	while(t--)
	{
		cin >> m>>k;
		for(int i=1;i<=3;i++)
		{
			cin >> s[i] + 1;
			for(int j=1;j<=m;j++)
			{
				if (s[i][j] == 's') sx = i, sy = j;
			}
		}
		memset(vis, 0, sizeof(vis));
		int f=bfs();
		if (f) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}


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

#define pb          push_back
#define F           first
#define S           second
#define rep(i,a,b)  for(int i=a; i<b; i++)
#define all(a)      (a).begin(),(a).end()
#define wa(x)       cout << (#x) << " -------- " << (x) << endl
#define line1	    printf("---------------------------\n")

#define printf //

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

void pvi(auto v){
	for(auto it:v) cout << it << " ";
	cout << endl;
}

void solve();
signed main() {
	//ios_base::sync_with_stdio(false); cin.tie(NULL);

	int t=1;
	cin>>t;
	while(t--) solve();
	return 0;
}

//___________________________________________________________________________________________________________

vector<vi> g;
vector<vi> seen;

int tim;
int n,k;

int check(int x, int y, int xr, int yr){

	// int t = (y-yr)/3;

	// y = y + 2*t;

	if(y > n-1 || g[x][y]==0) return 1;
	else {
		printf("Check for %d,%d failed \n", x,y);
		return 0;
	}
}

void dfs(int xr,int yr){

	stack<pii> st;
	vi r(n,0);
	seen.assign(3,r);

	st.push({xr,yr});

	while(!st.empty()){

		int x = st.top().F;
		int y = st.top().S;
		st.pop();

		line1;
		printf("At [%d,%d] : %d\n",x,y,(int)st.size());
		// wa(n);
		// wa(y);

		if(y >= n-10){
			printf("**********************************\n");
			cout << "YES" << endl;
			return;
		}

		if(seen[x][y]) continue;

		seen[x][y] = 1;

		if(!check(x,y+1,xr,yr)){
			// printf("No1\n");
			// cout << "NO" << endl;
			// return;
			continue;
		}

		if(!seen[x][y+1]) {
			printf("Trying here\n");
			if(check(x,y+1,xr,yr) && check(x,y+2,xr,yr) && check(x,y+3,xr,yr)){
				printf("Here success - [%d,%d]\n",x,y+3);
				st.push({x,y+3});
			}
			// else{
			// 	printf("No2\n");
			// 	cout << "NO" << endl;
			// 	return;
			// }
		}

		if(x!=0 && !seen[x-1][y+1]) {
			printf("Trying up\n");
			if(check(x-1,y+1,xr,yr) && check(x-1,y+2,xr,yr) && check(x-1,y+3,xr,yr)){
				printf("Up success - [%d,%d]\n",x-1,y+3);
				st.push({x-1,y+3});
			}
			// else{
			// 	printf("No3\n");
			// 	cout << "NO" << endl;
			// 	return;
			// }
		}

		if(x!=2 && !seen[x+1][y+1]) {
			printf("Trying down\n");
			if(check(x+1,y+1,xr,yr) && check(x+1,y+2,xr,yr) && check(x+1,y+3,xr,yr)){
				printf("Down success - [%d,%d]\n",x+1,y+3);
				st.push({x+1,y+3});
			}
			// else{
			// 	printf("No4\n");
			// 	cout << "NO" << endl;
			// 	return;
			// }
		}
	}

	printf("Stack empty.\n");
	cout << "NO" << endl;
}

void solve() {

	g.clear();

	int x,y;
	cin>>n>>k;

	rep(i,0,3){
		vi r;

		rep(j,0,n){
			char t;
			cin>>t;

			if(t == '.') r.pb(0);
			else if (t == 's') {
				r.pb(0);
				x = i;
				y = j;
			}
			else (r.pb(t-'A'+1));
		}

		rep(j,0,10) r.pb(0);
		// pvi(r);
		g.pb(r);
	}

	n += 10;

	dfs(x,y);
}


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

#define pb          push_back
#define F           first
#define S           second
#define rep(i,a,b)  for(int i=a; i<b; i++)
#define all(a)      (a).begin(),(a).end()
// #define wa(x)       cout << (#x) << " -------- " << (x) << endl
#define line1	    printf("---------------------------\n")

#define wa //
#define printf //

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

void pvi(auto v){
	for(auto it:v) cout << it << " ";
	cout << endl;
}

void solve();
signed main() {
	//ios_base::sync_with_stdio(false); cin.tie(NULL);

	int t=1;
	cin>>t;
	while(t--) solve();
	return 0;
}

//___________________________________________________________________________________________________________

vector<vi> g;
vector<vi> seen;

int tim;
int n,k;

int check(int x, int y, int xr, int yr){

	// int t = (y-yr)/3;

	// y = y + 2*t;

	if(y > n-1 || g[x][y]==0) return 1;
	else {
		printf("Check for %d,%d failed \n", x,y);
		return 0;
	}
}

void dfs(int xr,int yr){

	stack<pii> st;
	vi r(n,0);
	seen.assign(3,r);

	st.push({xr,yr});

	while(!st.empty()){

		int x = st.top().F;
		int y = st.top().S;
		st.pop();

		line1;
		wa(x);
		wa(y);

		if(y >= n){
			cout << "YES" << endl;
			return;
		}

		if(seen[x][y]) continue;

		seen[x][y] = 1;

		if(!check(x,y+1,xr,yr)){
			printf("No1\n");
			cout << "NO" << endl;
			return;
		}

		printf("Trying here\n");
		if(!seen[x][y+1]) {
			if(check(x,y+1,xr,yr) && check(x,y+2,xr,yr) && check(x,y+3,xr,yr)){
				printf("Here success\n");
				st.push({x,y+3});
			}
			// else{
			// 	printf("No2\n");
			// 	cout << "NO" << endl;
			// 	return;
			// }
		}

		printf("Trying up\n");
		if(x!=0 && !seen[x-1][y+1]) {
			if(check(x-1,y+1,xr,yr) && check(x-1,y+2,xr,yr) && check(x-1,y+3,xr,yr)){
				printf("Down success\n");
				st.push({x-1,y+3});
			}
			// else{
			// 	printf("No3\n");
			// 	cout << "NO" << endl;
			// 	return;
			// }
		}

		printf("Trying down\n");
		if(x!=2 && !seen[x+1][y+1]) {
			if(check(x+1,y+1,xr,yr) && check(x+1,y+2,xr,yr) && check(x+1,y+3,xr,yr)){
				printf("Down success\n");
				st.push({x+1,y+3});
			}
			// else{
			// 	printf("No4\n");
			// 	cout << "NO" << endl;
			// 	return;
			// }
		}
	}

	printf("Stack empty.\n");
}

void solve() {

	g.clear();

	int x,y;
	cin>>n>>k;

	rep(i,0,3){
		vi r;

		rep(j,0,n){
			char t;
			cin>>t;

			if(t == '.') r.pb(0);
			else if (t == 's') {
				r.pb(0);
				x = i;
				y = j;
			}
			else (r.pb(t-'A'+1));
		}

		rep(j,0,10) r.pb(0);
		// pvi(r);
		g.pb(r);
	}

	n += 10;

	dfs(x,y);
}


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

#define pb          push_back
#define F           first
#define S           second
#define rep(i,a,b)  for(int i=a; i<b; i++)
#define all(a)      (a).begin(),(a).end()
// #define wa(x)       cout << (#x) << " -------- " << (x) << endl
#define line1	    printf("---------------------------\n")

#define wa //
#define printf //

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

void pvi(auto v){
	for(auto it:v) cout << it << " ";
	cout << endl;
}

void solve();
signed main() {
	//ios_base::sync_with_stdio(false); cin.tie(NULL);

	int t=1;
	cin>>t;
	while(t--) solve();
	return 0;
}

//___________________________________________________________________________________________________________

vector<vi> g;
vector<vi> seen;

int tim;
int n,k;

int check(int x, int y, int xr, int yr){

	// int t = (y-yr)/3;

	// y = y + 2*t;

	if(y > n-1 || g[x][y]==0) return 1;
	else {
		printf("Check for %d,%d failed \n", x,y);
		return 0;
	}
}

void dfs(int xr,int yr){

	stack<pii> st;
	vi r(n,0);
	seen.assign(3,r);

	st.push({xr,yr});

	while(!st.empty()){

		int x = st.top().F;
		int y = st.top().S;
		st.pop();

		line1;
		wa(x);
		wa(y);

		if(y >= n){
			cout << "YES" << endl;
			return;
		}

		if(seen[x][y]) continue;

		seen[x][y] = 1;

		if(!check(x,y+1,xr,yr)){
			printf("No1\n");
			cout << "NO" << endl;
			return;
		}

		printf("Trying here\n");
		if(!seen[x][y+1]) {
			if(check(x,y+1,xr,yr) && check(x,y+2,xr,yr) && check(x,y+3,xr,yr)){
				printf("Here success\n");
				st.push({x,y+3});
			}
			// else{
			// 	printf("No2\n");
			// 	cout << "NO" << endl;
			// 	return;
			// }
		}

		printf("Trying up\n");
		if(x!=0 && !seen[x-1][y+1]) {
			if(check(x-1,y+1,xr,yr) && check(x-1,y+2,xr,yr) && check(x-1,y+3,xr,yr)){
				printf("Down success\n");
				st.push({x-1,y+3});
			}
			// else{
			// 	printf("No3\n");
			// 	cout << "NO" << endl;
			// 	return;
			// }
		}

		printf("Trying down\n");
		if(x!=2 && !seen[x+1][y+1]) {
			if(check(x+1,y+1,xr,yr) && check(x+1,y+2,xr,yr) && check(x+1,y+3,xr,yr)){
				printf("Down success\n");
				st.push({x+1,y+3});
			}
			// else{
			// 	printf("No4\n");
			// 	cout << "NO" << endl;
			// 	return;
			// }
		}
	}

	printf("Stack empty.\n");
	cout << "NO" << endl;
}

void solve() {

	g.clear();

	int x,y;
	cin>>n>>k;

	rep(i,0,3){
		vi r;

		rep(j,0,n){
			char t;
			cin>>t;

			if(t == '.') r.pb(0);
			else if (t == 's') {
				r.pb(0);
				x = i;
				y = j;
			}
			else (r.pb(t-'A'+1));
		}

		rep(j,0,10) r.pb(0);
		// pvi(r);
		g.pb(r);
	}

	n += 10;

	dfs(x,y);
}