#include <iostream>
#include <cstring>
using namespace std;

int n, k;
char bd[5][100];
int dp[100][5][110];

bool isOK(const int t, const int x, const int y) {
	if(x >= 0 && x < 3 && y >=0 && y < n) {
		if(y + 2 * t >= n)
			return true;
		else if('.' == bd[x][y + 2 * t])
			return true;
	}

	return false;
}

bool DFS(const int t, const int x, const int y) {
	bool flag = true;
	for(int j = y + 1; j + 2 * t < n; j++) {
		if('.' != bd[x][j + 2 * t]) {
			flag = false;
			break;
		}
	}

	if(flag) {
		dp[t][x][y] = 1;
		return dp[t][x][y];
	}

	if(isOK(t + 1, x, y + 1)) {
		bool res = DFS(t + 1, x, y + 1);
		if(res) {
			dp[t][x][y] = 1;
//cerr << t << " " << x << " " << y << " : " << 0 << endl;
			return dp[t][x][y];
		}
	}

	if(isOK(t, x, y + 1) && isOK(t, x + 1, y + 1) && isOK(t + 1, x + 1, y + 1)) {
		bool res = DFS(t + 1, x + 1, y + 1);
		if(res) {
			dp[t][x][y] = 1;
//cerr << t << " " << x << " " << y << " : " << 1 << endl;
			return dp[t][x][y];
		}
	}

	if(isOK(t, x, y + 1) && isOK(t, x - 1, y + 1) && isOK(t + 1, x - 1, y + 1)) {
		bool res = DFS(t + 1, x - 1, y + 1);
		if(res) {
			dp[t][x][y] = 1;
//cerr << t << " " << x << " " << y << " : " << 2 << endl;
			return dp[t][x][y];
		}
	}

	dp[t][x][y] = 0;
	return dp[t][x][y];
}

void print(const int t) {
	for(int i = 0; i < 3; i++) {
		for(int j = 0; j < n; ++j) {
			if(j + 2 * t < n)
				cout << bd[i][j + 2 * t];
			else
				cout << '.';
		}
		cout << endl;
	}
	cout << endl;
}

int main() {
	int t;
	cin >> t;
	while(t--) {
		cin >> n >> k;
		for(int i = 0; i < 3; i++) {
			cin >> bd[i];
			memset(dp[i], -1, sizeof(int) * (n + 5));
		}

		int x, y = 0;
		for(int i = 0; i < 3; ++i)
			if('s' == bd[i][0]) {
				x = i;
				break;
			}
		if(DFS(0, x, y))
			cout << "YES\n";
		else
			cout << "NO\n";
//for(int i = 0; i <= 3; i++)
//	print(i);
	}

	return 0;
}


#include <iostream>
#include <cstring>
using namespace std;

int n, k;
char bd[5][100];
int dp[100][5][110];

bool isOK(const int t, const int x, const int y) {
	if(x >= 0 && x < 3 && y >=0 && y < n) {
		if(y + 2 * t >= n)
			return true;
		else if('.' == bd[x][y + 2 * t])
			return true;
	}

	return false;
}

bool DFS(const int t, const int x, const int y) {
	if(-1 != dp[t][x][y])
		return dp[t][x][y];

	bool flag = true;
	for(int j = y + 1; j + 2 * t < n; j++) {
		if('.' != bd[x][j + 2 * t]) {
			flag = false;
			break;
		}
	}

	if(flag) {
		dp[t][x][y] = 1;
		return dp[t][x][y];
	}

	if(isOK(t, x, y + 1) && isOK(t + 1, x, y + 1)) {
		bool res = DFS(t + 1, x, y + 1);
		if(res) {
			dp[t][x][y] = 1;
#ifdef LOCAL
cerr << t << " " << x << " " << y << " : " << 0 << endl;
#endif
			return dp[t][x][y];
		}
	}

	if(isOK(t, x, y + 1) && isOK(t, x + 1, y + 1) && isOK(t + 1, x + 1, y + 1)) {
		bool res = DFS(t + 1, x + 1, y + 1);
		if(res) {
			dp[t][x][y] = 1;
#ifdef LOCAL
cerr << t << " " << x << " " << y << " : " << 1 << endl;
#endif
			return dp[t][x][y];
		}
	}

	if(isOK(t, x, y + 1) && isOK(t, x - 1, y + 1) && isOK(t + 1, x - 1, y + 1)) {
		bool res = DFS(t + 1, x - 1, y + 1);
		if(res) {
			dp[t][x][y] = 1;
#ifdef LOCAL
cerr << t << " " << x << " " << y << " : " << 2 << endl;
#endif
			return dp[t][x][y];
		}
	}

	dp[t][x][y] = 0;
	return dp[t][x][y];
}

void print(const int t) {
	for(int i = 0; i < 3; i++) {
		for(int j = 0; j < n; ++j) {
			if(j + 2 * t < n)
				cout << bd[i][j + 2 * t];
			else
				cout << '.';
		}
		cout << endl;
	}
	cout << endl;
}

int main() {
	int t;
	cin >> t;
	while(t--) {
		cin >> n >> k;
		for(int i = 0; i < 3; i++) {
			cin >> bd[i];
		}

		for(int t = 0; t < 60; t++) {
			for(int i = 0; i < 3; i++)
				memset(dp[t][i], -1, sizeof(int) * (n + 5));
		}

		int x, y = 0;
		for(int i = 0; i < 3; ++i) {
			if('s' == bd[i][0]) {
				x = i;
				break;
			}
		}

		if(DFS(0, x, y))
			cout << "YES\n";
		else
			cout << "NO\n";
#ifdef LOCAL
for(int i = 0; i <= 5; i++)
	print(i);
#endif
	}
	return 0;
}


#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<list>
#include<queue>
#include<utility>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<math.h>
#include<set>
#include<stack>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<iterator>
using namespace std;
struct node{
  int x,y,time;
};
char str[120][120];
int vis[102][102][102],n,m,ck=0;
void train(int p,int q,int cnt)
{
    int time=0,d=0;
    for(int j=q;(j+cnt-1)>=0;j-=2){
     d=0;
     int lim=cnt;
     if(j<0)lim=cnt+j;
     for(int k=max(j,0);d<lim;k++,d++){
        vis[p][k][time]=1;
     }
     time++;
    }
}
int level[102][102][102];
void bfs(int i,int j)
{
    int v,w,t,a,b,c;
    level[i][j][0]=1;
    queue<node>q;
    node gr;
    gr.x=i;
    gr.y=j;
    gr.time=0;
    q.push(gr);
    while(!q.empty()){
        gr=q.front();
        q.pop();
        v=gr.x;
        w=gr.y;
        //cout<<w<<endl;
        if(w==m-1){
            ck=1;
            return ;
        }
        for(i=0;i<1;i++){
            a=v+0;
            b=w+1;
            t=gr.time+1;
            if(a>=0&&a<n&&b>=0&&b<m&&vis[a][b][t-1]==1)continue;
            if(a>=0&&a<n&&b>=0&&b<m&&vis[a][b][t]==0&&vis[a][b][t-1]==0&&level[a][b][t]==0){
                node pr;
                pr.x=a;
                pr.y=b;
                pr.time=t;
                level[a][b][t]=1;
                q.push(pr);
            }
             c=a-1;
          //   cout<<c<<" "<<b<<" "<<vis[c][b][t]<<" "<<vis[c][b][t-1]<<endl;
                if(c>=0&&c<n&&b>=0&&b<m&&vis[c][b][t]==0&&vis[c][b][t-1]==0&&level[c][b][t]==0){
                    node pr;
                   //   cout<<c<<" fr "<<b<<endl;
                pr.x=c;
                pr.y=b;
                pr.time=t;
                level[c][b][t]=1;
                q.push(pr);
                }
                  c=a+1;
                if(c>=0&&c<n&&b>=0&&b<m&&vis[c][b][t]==0&&vis[c][b][t-1]==0&&level[c][b][t]==0){
                    node pr;
                 //   cout<<c<<" sc   "<<b<<endl;
                pr.x=c;
                pr.y=b;
                pr.time=t;
                level[c][b][t]=1;
                q.push(pr);
                }
        }

    }

}
int main()
{
    int i,j,k,l,test;
    scanf("%d",&test);
    while(test--){
    cin>>m>>k;
    n=3;
    ck=0;
    memset(level,0,sizeof level);
    memset(vis,0,sizeof vis);
    for(i=0;i<3;i++){
        scanf("%s",str[i]);
    }
    for(i=0;i<3;i++){
        for(j=0;j<m;j++){
            if(str[i][j]!='s'&&str[i][j]!='.'){
                    int cnt=0;
                for(k=j;str[i][k];k++){
                    if(str[i][j]!=str[i][k])break;
                    cnt++;
                }
                train(i,j,cnt);
            }

        }

    }
    for(i=0;i<n;i++){
        for(j=0;j<m;j++){
            if(str[i][j]=='s'){
                bfs(i,j);
            }

        }
    }
   if(ck==0)printf("NO\n");
   else printf("YES\n");
}

}


#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<list>
#include<queue>
#include<utility>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<math.h>
#include<set>
#include<stack>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<iterator>
using namespace std;
struct node{
  int x,y,time;
};
char str[120][120];
int vis[102][102][102],n,m,ck=0;
void train(int p,int q,int cnt)
{
    int time=0,d=0;
    for(int j=q;(j+cnt-1)>=0;j-=2){
     d=0;
     int lim=cnt;
     if(j<0)lim=cnt+j;
     for(int k=max(j,0);d<lim;k++,d++){
        vis[p][k][time]=1;
     }
     time++;
    }
}
int level[102][102][102];
void bfs(int i,int j)
{
    int v,w,t,a,b,c;
    level[i][j][0]=1;
    queue<node>q;
    node gr;
    gr.x=i;
    gr.y=j;
    gr.time=0;
    q.push(gr);
    while(!q.empty()){
        gr=q.front();
        q.pop();
        v=gr.x;
        w=gr.y;
        //cout<<w<<endl;
        if(w==m-1){
            ck=1;
            return ;
        }
        for(i=0;i<1;i++){
            a=v+0;
            b=w+1;
            t=gr.time+1;
            if(vis[a][b][t-1]==1)continue;
            if(a>=0&&a<n&&b>=0&&b<m&&vis[a][b][t]==0&&vis[a][b][t-1]==0&&level[c][b][t]==0){
                node pr;
                pr.x=a;
                pr.y=b;
                pr.time=t;
                level[a][b][t]=1;
                q.push(pr);
            }
             c=a-1;
          //   cout<<c<<" "<<b<<" "<<vis[c][b][t]<<" "<<vis[c][b][t-1]<<endl;
                if(c>=0&&c<n&&b>=0&&b<m&&vis[c][b][t]==0&&vis[c][b][t-1]==0&&level[c][b][t]==0){
                    node pr;
                   //   cout<<c<<" fr "<<b<<endl;
                pr.x=c;
                pr.y=b;
                pr.time=t;
                level[c][b][t]=1;
                q.push(pr);
                }
                  c=a+1;
                if(c>=0&&c<n&&b>=0&&b<m&&vis[c][b][t]==0&&vis[c][b][t-1]==0&&level[c][b][t]==0){
                    node pr;
                 //   cout<<c<<" sc   "<<b<<endl;
                pr.x=c;
                pr.y=b;
                pr.time=t;
                level[c][b][t]=1;
                q.push(pr);
                }
        }

    }

}
int main()
{
    int i,j,k,l,test;
    scanf("%d",&test);
    while(test--){
    cin>>m>>k;
    n=3;
    ck=0;
    memset(level,0,sizeof level);
    memset(vis,0,sizeof vis);
    for(i=0;i<3;i++){
        scanf("%s",str[i]);
    }
    for(i=0;i<3;i++){
        for(j=0;j<m;j++){
            if(str[i][j]!='s'&&str[i][j]!='.'){
                    int cnt=0;
                for(k=j;str[i][k];k++){
                    if(str[i][j]!=str[i][k])break;
                    cnt++;
                }
                train(i,j,cnt);
            }

        }

    }
    for(i=0;i<n;i++){
        for(j=0;j<m;j++){
            if(str[i][j]=='s'){
                bfs(i,j);
            }

        }
    }
   if(ck==0)printf("NO\n");
   else printf("YES\n");
}

}


#include<stdio.h>
#include<bits/stdc++.h>
#include<string.h>
#include <iostream>
using namespace std;
char maze[4][1000];
int n,r,x,a[5],dir[3][2]={{3,1},{3,0},{3,-1}},fang[3][3]={{1,-1},{1,0},{1,1}};
bool vi[4][1000];
bool val(int y,int x)
{
    if(x<0||y<=0||y>3||maze[y][x]!='.'||vi[y][x])
        return false;
    else
        return true;
}
bool test(int y,int x)
{
    for(int i=0;i<3;i++)
    {
        int x1=x+fang[i][1];
        if(x1>=0&&x1<r&&maze[2][x1]!='.'&&maze[2][x1]!='s')
        {
            for(int j=0;j<3;j++)
            {
                int x2=x1+fang[j][1];
                if(x2>=0&&x2<r&&maze[3][x2]!='.'&&maze[3][x2]!='s')
                    return false;
            }
        }
    }
    return true;
}
bool dfs(int y,int x)
{
    vi[y][x]=true;
    if(x>=a[y])
        return true;
    else
    {
        if(maze[y][x+1]!='.')
            return false;
        else
        {
            for(int i=0;i<3;i++)
            {
                int xx=x+dir[i][0],yy=y+dir[i][1];
                if(val(yy,xx)&&val(yy,x+1))
                {
//                    printf("%d %d\n",yy,xx);
                    if(dfs(yy,xx))
                        return true;
                }
            }
        }
    }
                return false;
}
int main()
{
    scanf("%d",&n);
    memset(vi,false,sizeof(vi));
    while(n--)
    {
        scanf("%d%d",&r,&x);
        int i,st;
        for(i=1;i<=3;i++)
            scanf("%s",maze[i]);
        for(i=1;i<=3;i++)
        {
            for(int j=r;j<r+10;j++)
                maze[i][j]='.';
        }
        for(i=1;i<=3;i++)
        {
            if(maze[i][0]=='s')
                {
                    st=i;
                    break;
                }
        }
        for(i=1;i<=3;i++)
        {
            a[i]=0;
            int j;
            for(j=r-1;j>=0;j--)
            {
                if(maze[i][j]!='.'&&maze[i][j]!='s')
                {
                    a[i]=j+1;
                    break;
                }
            }
        }
//        for(i=1;i<=3;i++)
//            printf("%d\n",a[i]);
        if(a[1]>0&&!test(1,a[1]-1))
        {
            printf("NO\n");
            continue;
        }
        if(dfs(st,0))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
#include<string.h>
#include <iostream>
using namespace std;
char maze[4][10000];
int n,r,x,a[5],dir[3][2]={{3,1},{3,0},{3,-1}},fang[3][3]={{1,-1},{1,0},{1,1}};
bool val(int y,int x)
{
    if(x<0||y<=0||y>3||maze[y][x]!='.')
        return false;
    else
        return true;
}
bool test(int y,int x)
{
    for(int i=0;i<3;i++)
    {
        int x1=x+fang[i][1],y1=y+fang[i][0];
        if(x1>=0&&x1<r&&maze[y1][x1]!='.'&&maze[y1][x1]!='s')
        {
            for(int j=0;j<3;j++)
            {
                int x2=x1+fang[j][1],y2=y1+fang[j][0];
                if(x2>=0&&x2<r&&maze[y2][x2]!='.'&&maze[y2][x2]!='s')
                    return false;
            }
        }
    }
    return true;
}
bool dfs(int y,int x)//y�ǵڼ��У�x�ǵڼ���
{
    if(x>=a[y])
        return true;
    else
    {
        if(maze[y][x+1]!='.')
            return false;
        else
        {
            for(int i=0;i<3;i++)
            {
                int xx=x+dir[i][0],yy=y+dir[i][1];
                if(val(yy,xx)&&val(yy,x+1))
                {
//                    printf("%d %d\n",yy,xx);
                    if(dfs(yy,xx))
                        return true;
                }
            }
        }
    }
                return false;
}
int main()
{
    scanf("%d",&n);
    while(n--)
    {
        scanf("%d%d",&r,&x);
        int i,st;
        for(i=1;i<=3;i++)
            scanf("%s",maze[i]);
        for(i=1;i<=3;i++)
        {
            for(int j=r;j<r+10;j++)
                maze[i][j]='.';
        }
        for(i=1;i<=3;i++)
        {
            if(maze[i][0]=='s')
                {
                    st=i;
                    break;
                }
        }
        for(i=1;i<=3;i++)
        {
            a[i]=0;
            int j;
            for(j=r-1;j>=0;j--)
            {
                if(maze[i][j]!='.'&&maze[i][j]!='s')
                {
                    a[i]=j+1;
                    break;
                }
            }
        }
//        for(i=1;i<=3;i++)
//            printf("%d\n",a[i]);
        if(a[1]>0&&!test(1,a[1]-1))
        {
            printf("NO\n");
            continue;
        }
        if(dfs(st,0))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
#include<string.h>
#include <iostream>
using namespace std;
char maze[4][1000];
int n,r,x,a[5],dir[3][2]={{3,1},{3,0},{3,-1}},fang[3][3]={{1,-1},{1,0},{1,1}};
bool vi[4][1000];
bool val(int y,int x)
{
    if(x<0||y<=0||y>3||maze[y][x]!='.'||vi[y][x]==true)
        return false;
    else
        return true;
}
bool test(int y,int x)
{
    for(int i=0;i<3;i++)
    {
        int x1=x+fang[i][1];
        if(x1>=0&&x1<r&&maze[2][x1]!='.'&&maze[2][x1]!='s')
        {
            for(int j=0;j<3;j++)
            {
                int x2=x1+fang[j][1];
                if(x2>=0&&x2<r&&maze[3][x2]!='.'&&maze[3][x2]!='s')
                    return false;
            }
        }
    }
    return true;
}
bool dfs(int y,int x)
{
    vi[y][x]=true;
    if(x>=a[y])
        return true;
    else
    {
        if(maze[y][x+1]!='.')
            return false;
        else
        {
            for(int i=0;i<3;i++)
            {
                int xx=x+dir[i][0],yy=y+dir[i][1];
                if(val(yy,xx)&&val(yy,x+1))
                {
                    if(dfs(yy,xx))
                        return true;
                }
            }
        }
    }
                return false;
}
int main()
{
    scanf("%d",&n);

    while(n--)
    {    memset(vi,false,sizeof(vi));
        scanf("%d%d",&r,&x);
        int i,st;
        for(i=1;i<=3;i++)
            scanf("%s",maze[i]);
        for(i=1;i<=3;i++)
        {
            for(int j=r;j<r+10;j++)
                maze[i][j]='.';
        }
        for(i=1;i<=3;i++)
        {
            if(maze[i][0]=='s')
                {
                    st=i;
                    break;
                }
        }
        for(i=1;i<=3;i++)
        {
            a[i]=0;
            int j;
            for(j=r-1;j>=0;j--)
            {
                if(maze[i][j]!='.'&&maze[i][j]!='s')
                {
                    a[i]=j+1;
                    break;
                }
            }
        }
        if(a[1]>0&&!test(1,a[1]-1))
        {
            printf("NO\n");
            continue;
        }
        if(dfs(st,0))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
#include<string.h>
#include <iostream>
using namespace std;
char maze[4][1000];
int n,r,x,a[5],dir[3][2]={{3,1},{3,0},{3,-1}},fang[3][3]={{1,-1},{1,0},{1,1}};
bool vi[4][1000];
bool val(int y,int x)
{
    if(x<0||y<=0||y>3||maze[y][x]!='.'||vi[y][x]==true)
        return false;
    else
        return true;
}
bool test(int y,int x)
{
    for(int i=0;i<3;i++)
    {
        int x1=x+fang[i][1];
        if(x1>=0&&x1<r&&maze[2][x1]!='.'&&maze[2][x1]!='s')
        {
            for(int j=0;j<3;j++)
            {
                int x2=x1+fang[j][1];
                if(x2>=0&&x2<r&&maze[3][x2]!='.'&&maze[3][x2]!='s')
                    return false;
            }
        }
    }
    return true;
}
bool dfs(int y,int x)
{
    vi[y][x]=true;
    if(x>=a[y])
        return true;
    else
    {
        if(maze[y][x+1]!='.')
            return false;
        else
        {
            for(int i=0;i<3;i++)
            {
                int xx=x+dir[i][0],yy=y+dir[i][1];
                if(val(yy,xx)&&val(yy,x+1))
                {
                    if(dfs(yy,xx))
                        return true;
                }
            }
        }
    }
                return false;
}
int main()
{
    scanf("%d",&n);
    memset(vi,false,sizeof(vi));
    while(n--)
    {
        scanf("%d%d",&r,&x);
        int i,st;
        for(i=1;i<=3;i++)
            scanf("%s",maze[i]);
        for(i=1;i<=3;i++)
        {
            for(int j=r;j<r+10;j++)
                maze[i][j]='.';
        }
        for(i=1;i<=3;i++)
        {
            if(maze[i][0]=='s')
                {
                    st=i;
                    break;
                }
        }
        for(i=1;i<=3;i++)
        {
            a[i]=0;
            int j;
            for(j=r-1;j>=0;j--)
            {
                if(maze[i][j]!='.'&&maze[i][j]!='s')
                {
                    a[i]=j+1;
                    break;
                }
            }
        }
//        for(i=1;i<=3;i++)
//            printf("%d\n",a[i]);
        if(a[1]>0&&!test(1,a[1]-1))
        {
            printf("NO\n");
            continue;
        }
        if(dfs(st,0))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
#include<string.h>
#include <iostream>
using namespace std;
char maze[4][10000];
int n,r,x,a[5],dir[3][2]={{3,1},{3,0},{3,-1}},fang[3][3]={{1,-1},{1,0},{1,1}};
bool val(int y,int x)
{
    if(x<0||y<=0||y>3||maze[y][x]!='.')
        return false;
    else
        return true;
}
bool test(int y,int x)
{
    for(int i=0;i<3;i++)
    {
        int x1=x+fang[i][1],y1=y+fang[i][0];
        if(x1<r&&maze[y1][x1]!='.')
        {
            for(int j=0;j<3;j++)
            {
                int x2=x1+fang[j][1],y2=y1+fang[j][0];
                if(x2<r&&maze[y2][x2]!='.')
                    return false;
            }
        }
    }
    return true;
}
bool dfs(int y,int x)//y�ǵڼ��У�x�ǵڼ���
{
    if(x>=a[y])
        return true;
    else
    {
        if(maze[y][x+1]!='.')
            return false;
        else
        {
            for(int i=0;i<3;i++)
            {
                int xx=x+dir[i][0],yy=y+dir[i][1];
                if(val(yy,xx)&&val(yy,x+1))
                {
//                    printf("%d %d\n",yy,xx);
                    if(dfs(yy,xx))
                        return true;
                }
            }
        }
    }
                return false;
}
int main()
{
    scanf("%d",&n);
    while(n--)
    {
        scanf("%d%d",&r,&x);
        int i,st;
        for(i=1;i<=3;i++)
            scanf("%s",maze[i]);
        for(i=1;i<=3;i++)
        {
            for(int j=r;j<r+300;j++)
                maze[i][j]='.';
        }
        for(i=1;i<=3;i++)
        {
            if(maze[i][0]=='s')
                {
                    st=i;
                    break;
                }
        }
        for(i=1;i<=3;i++)
        {
            a[i]=0;
            int j;
            for(j=r-1;j>=0;j--)
            {
                if(maze[i][j]!='.'&&maze[i][j]!='s')
                {
                    a[i]=j+1;
                    break;
                }
            }
        }
        if(a[1]>0&&!test(1,a[1]-1))
        {
            printf("NO\n");
            continue;
        }
        if(dfs(st,0))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
#define maxn 2000100
#define llg long long
#define yyj(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);
llg n,m,se[maxn],bj[maxn],dl[maxn],head,tail,T;
char s[5][110];
llg S;
llg ys(llg x,llg y) {return (x-1)*n+y;}

void init()
{
	cin>>n>>m;
	for (llg i=1;i<=3;i++) scanf("%s",s[i]+1);
	if (s[1][1]=='s') S=ys(1,1);else if (s[2][1]=='s') S=ys(2,1);else S=ys(3,1);
	for (llg t=2;t<=n+1;t++)
	{
		for (llg i=1;i<=3;i++)
			for (llg j=1;j<=n;j++)
				if ((s[i][j+(t-1)*2]=='.' && (s[i][j+(t-2)*2]=='.' ))|| j+(t-1)*2>n) se[ys(i,j)+3*n*(t-1)]=0;else se[ys(i,j)+3*n*(t-1)]=1;
	}
}

bool BFS()
{
	llg x,w,t,y;
	dl[1]=S;
	head=0,tail=1;
	do
	{
		w=dl[++head];
		t=w/(3*n);
		w%=(3*n);
		x=(w-1)/n+1; y=(w-1)%n+1;
		if (y==n) return 1;
		if (x!=1)
		{
			llg nt=ys(x-1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		if (x!=3)
		{
			llg nt=ys(x+1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		llg nt=ys(x,y+1)+(t+1)*n*3;
		if (!bj[nt] && !se[nt])
		{
			bj[nt]=1;
			dl[++tail]=nt;
		}
	}while (head!=tail);
	return 0;
}

int main()
{
//	yyj("B");
	cin>>T;
	while (T--)
	{
		init();
		if (BFS()) cout<<"YES"<<endl; else cout<<"NO"<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
#define maxn 2000100
#define llg long long
#define yyj(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);
llg n,m,se[maxn],bj[maxn],dl[maxn],head,tail,T;
char s[5][110];
llg S;
llg ys(llg x,llg y) {return (x-1)*n+y;}

void init()
{
	cin>>n>>m;
	for (llg i=1;i<=3;i++) scanf("%s",s[i]+1);
	if (s[1][1]=='s') S=ys(1,1);else if (s[2][1]=='s') S=ys(2,1);else S=ys(3,1);
	for (llg t=2;t<=n+1;t++)
	{
		for (llg i=1;i<=3;i++)
			for (llg j=1;j<=n;j++)
				if ((s[i][j+(t-1)*2]=='.' && (s[i][j+(t-2)*2]=='.' ))|| j+(t)*2>n) se[ys(i,j)+3*n*(t-1)]=0;else se[ys(i,j)+3*n*(t-1)]=1;
	}
}

bool BFS()
{
	llg x,w,t,y;
	dl[1]=S;
	head=0,tail=1;
	do
	{
		w=dl[++head];
		t=w/(3*n);
		w%=(3*n);
		x=(w-1)/n+1; y=(w-1)%n+1;
		if (y==n) return 1;
		if (x!=1)
		{
			llg nt=ys(x-1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		if (x!=3)
		{
			llg nt=ys(x+1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		llg nt=ys(x,y+1)+(t+1)*n*3;
		if (!bj[nt] && !se[nt])
		{
			bj[nt]=1;
			dl[++tail]=nt;
		}
	}while (head!=tail);
	return 0;
}

int main()
{
//	yyj("B");
	cin>>T;
	while (T--)
	{
		init();
		if (BFS()) cout<<"YES"<<endl; else cout<<"NO"<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
#define maxn 2000100
#define llg long long
#define yyj(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);
llg n,m,se[maxn],bj[maxn],dl[maxn],head,tail,T;
char s[5][1000];
llg S;
llg ys(llg x,llg y) {return (x-1)*n+y;}

void init()
{
	cin>>n>>m;
	for (llg i=1;i<=3;i++) scanf("%s",s[i]+1);
	if (s[1][1]=='s') S=ys(1,1);else if (s[2][1]=='s') S=ys(2,1);else S=ys(3,1);
	for (llg i=1;i<=3;i++)
		for (llg j=1;j<=n*3;j++)
			s[i][j+n]='.';
	for (llg t=2;t<=n+1;t++)
	{
		for (llg i=1;i<=3;i++)
			for (llg j=1;j<=n;j++)
				if ((s[i][j+(t-1)*2]=='.') && (s[i][j+(t-2)*2]=='.' )) se[ys(i,j)+3*n*(t-1)]=0;else se[ys(i,j)+3*n*(t-1)]=1;
	}
}

bool BFS()
{
	llg x,w,t,y;
	dl[1]=S;
	head=0,tail=1;
	do
	{
		w=dl[++head];
		t=w/(3*n);
		w%=(3*n);
		x=(w-1)/n+1; y=(w-1)%n+1;
		if (y==n) return 1;
		if (se[ys(x,y+1)+(t)*n*3]) continue;
		if (x!=1)
		{
			llg nt=ys(x-1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		if (x!=3)
		{
			llg nt=ys(x+1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		llg nt=ys(x,y+1)+(t+1)*n*3;
		if (!bj[nt] && !se[nt])
		{
			bj[nt]=1;
			dl[++tail]=nt;
		}
	}while (head!=tail);
	return 0;
}

int main()
{
//	yyj("B");
	cin>>T;
	while (T--)
	{
		init();
		if (BFS()) cout<<"YES"<<endl; else cout<<"NO"<<endl;
		memset(bj,0,sizeof(bj));
		memset(se,0,sizeof(se));
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
#define maxn 2000100
#define llg long long
#define yyj(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);
llg n,m,se[maxn],bj[maxn],dl[maxn],head,tail,T;
char s[5][1000];
llg S;
llg ys(llg x,llg y) {return (x-1)*n+y;}

void init()
{
	cin>>n>>m;
	for (llg i=1;i<=3;i++) scanf("%s",s[i]+1);
	if (s[1][1]=='s') S=ys(1,1);else if (s[2][1]=='s') S=ys(2,1);else S=ys(3,1);
	for (llg i=1;i<=3;i++)
		for (llg j=1;j<=n*4;j++)
			s[i][j+n]='.';
	for (llg i=1;i<=n;i++)
		for (llg j=1;j<=n;j++)
			if (s[i][j]!='.')
			{
				se[ys(i,j)]=1;
			}
	for (llg t=2;t<=n+1;t++)
	{
		for (llg i=1;i<=3;i++)
			for (llg j=1;j<=n;j++)
				if ((s[i][j+(t-1)*2]=='.') && (s[i][j+(t-2)*2]=='.' )) se[ys(i,j)+3*n*(t-1)]=0;else se[ys(i,j)+3*n*(t-1)]=1;
	}
}

bool BFS()
{
	llg x,w,t,y;
	dl[1]=S;
	head=0,tail=1;
	do
	{
		w=dl[++head];
		t=w/(3*n);
		w%=(3*n);
		x=(w-1)/n+1; y=(w-1)%n+1;
		if (y==n) return 1;
		if (se[ys(x,y+1)+(t)*n*3]) continue;
		if (x!=1)
		{
			llg nt=ys(x-1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		if (x!=3)
		{
			llg nt=ys(x+1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		llg nt=ys(x,y+1)+(t+1)*n*3;
		if (!bj[nt] && !se[nt])
		{
			bj[nt]=1;
			dl[++tail]=nt;
		}
	}while (head!=tail);
	return 0;
}

int main()
{
//	yyj("B");
	cin>>T;
	while (T--)
	{
		init();
		if (BFS()) cout<<"YES"<<endl; else cout<<"NO"<<endl;
		memset(bj,0,sizeof(bj));
		memset(se,0,sizeof(se));
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
#define maxn 2000100
#define llg long long
#define yyj(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);
llg n,m,se[maxn],bj[maxn],dl[maxn],head,tail,T;
char s[5][110];
llg S;
llg ys(llg x,llg y) {return (x-1)*n+y;}

void init()
{
	cin>>n>>m;
	for (llg i=1;i<=3;i++) scanf("%s",s[i]+1);
	if (s[1][1]=='s') S=ys(1,1);else if (s[2][1]=='s') S=ys(2,1);else S=ys(3,1);
	for (llg t=2;t<=n+1;t++)
	{
		for (llg i=1;i<=3;i++)
			for (llg j=1;j<=n;j++)
				if (s[i][j+(t-1)*2]=='.' || j+(t-1)*2>n) se[ys(i,j)+3*n*(t-1)]=0;else se[ys(i,j)+3*n*(t-1)]=1;
	}
}

bool BFS()
{
	llg x,w,t,y;
	dl[1]=S;
	head=0,tail=1;
	do
	{
		w=dl[++head];
		t=w/(3*n);
		w%=(3*n);
		x=(w-1)/n+1; y=(w-1)%n+1;
		if (y==n) return 1;
		if (x!=1)
		{
			llg nt=ys(x-1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		if (x!=3)
		{
			llg nt=ys(x+1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		llg nt=ys(x,y+1)+(t+1)*n*3;
		if (!bj[nt] && !se[nt])
		{
			bj[nt]=1;
			dl[++tail]=nt;
		}
	}while (head!=tail);
	return 0;
}

int main()
{
//	yyj("B");
	cin>>T;
	while (T--)
	{
		init();
		if (BFS()) cout<<"YES"<<endl; else cout<<"NO"<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
#define maxn 2000100
#define llg long long
#define yyj(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);
llg n,m,se[maxn],bj[maxn],dl[maxn],head,tail,T;
char s[5][110];
llg S;
llg ys(llg x,llg y) {return (x-1)*n+y;}

void init()
{
	cin>>n>>m;
	for (llg i=1;i<=3;i++) scanf("%s",s[i]+1);
	if (s[1][1]=='s') S=ys(1,1);else if (s[2][1]=='s') S=ys(2,1);else S=ys(3,1);
	for (llg t=2;t<=n+1;t++)
	{
		for (llg i=1;i<=3;i++)
			for (llg j=1;j<=n;j++)
				if ((s[i][j+(t-1)*2]=='.' && (s[i][j+(t-2)*2]=='.' ))|| j+(t-1)*2>n) se[ys(i,j)+3*n*(t-1)]=0;else se[ys(i,j)+3*n*(t-1)]=1;
	}
}

bool BFS()
{
	llg x,w,t,y;
	dl[1]=S;
	head=0,tail=1;
	do
	{
		w=dl[++head];
		t=w/(3*n);
		w%=(3*n);
		x=(w-1)/n+1; y=(w-1)%n+1;
		if (y==n) return 1;
		if (se[ys(x,y+1)+(t)*n*3]) continue;
		if (x!=1)
		{
			llg nt=ys(x-1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		if (x!=3)
		{
			llg nt=ys(x+1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		llg nt=ys(x,y+1)+(t+1)*n*3;
		if (!bj[nt] && !se[nt])
		{
			bj[nt]=1;
			dl[++tail]=nt;
		}
	}while (head!=tail);
	return 0;
}

int main()
{
//	yyj("B");
	cin>>T;
	while (T--)
	{
		init();
		if (BFS()) cout<<"YES"<<endl; else cout<<"NO"<<endl;
		memset(bj,0,sizeof(bj));
		memset(se,0,sizeof(se));
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
#define maxn 2000100
#define llg long long
#define yyj(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);
llg n,m,se[maxn],bj[maxn],dl[maxn],head,tail,T;
char s[5][110];
llg S;
llg ys(llg x,llg y) {return (x-1)*n+y;}

void init()
{
	cin>>n>>m;
	for (llg i=1;i<=3;i++) scanf("%s",s[i]+1);
	if (s[1][1]=='s') S=ys(1,1);else if (s[2][1]=='s') S=ys(2,1);else S=ys(3,1);
	for (llg t=2;t<=n+1;t++)
	{
		for (llg i=1;i<=3;i++)
			for (llg j=1;j<=n;j++)
				if ((s[i][j+(t-1)*2]=='.' && (s[i][j+(t-2)*2]=='.' ))|| j+(t)*2>n) se[ys(i,j)+3*n*(t-1)]=0;else se[ys(i,j)+3*n*(t-1)]=1;
	}
}

bool BFS()
{
	llg x,w,t,y;
	dl[1]=S;
	head=0,tail=1;
	do
	{
		w=dl[++head];
		t=w/(3*n);
		w%=(3*n);
		x=(w-1)/n+1; y=(w-1)%n+1;
		if (y==n) return 1;
		if (x!=1)
		{
			llg nt=ys(x-1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		if (x!=3)
		{
			llg nt=ys(x+1,y+1)+(t+1)*n*3;
			if (!bj[nt] && !se[nt])
			{
				bj[nt]=1;
				dl[++tail]=nt;
			}
		}
		llg nt=ys(x,y+1)+(t+1)*n*3;
		if (!bj[nt] && !se[nt])
		{
			bj[nt]=1;
			dl[++tail]=nt;
		}
	}while (head!=tail);
	return 0;
}

int main()
{
//	yyj("B");
	cin>>T;
	while (T--)
	{
		init();
		if (BFS()) cout<<"YES"<<endl; else cout<<"NO"<<endl;
		memset(bj,0,sizeof(bj));
	}
	return 0;
}


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

inline int getint()
{
	int res=0,fh=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')fh=-1,ch=getchar();
	while(ch<='9'&&ch>='0')res=res*10+ch-'0',ch=getchar();
	return res*fh;
}

int n,k;
char s[5][10001];

bool check(int x,int y)
{
	return s[x][y]=='.'||s[x][y]=='\0';
}

bool dfs(int x,int y)
{
	if(y>=n-2)return 1;
	s[x][y]='s';
	if(s[x][y+1]!='.')return 0;
	if(check(x,y+3)&&dfs(x,y+3))return 1;
	if(x<3)if(check(x+1,y+1)&&check(x+1,y+3)&&dfs(x+1,y+3))return 1;
	if(x>1)if(check(x-1,y+1)&&check(x-1,y+3)&&dfs(x-1,y+3))return 1;
	return 0;
}

int main()
{
//	freopen("B.in","r",stdin); freopen("B.out","w",stdout);
	int T=getint();
	while(T--)
	{
		scanf("%d%d",&n,&k);
		for(int i=1;i<=n;i++)scanf("%s",s[i]+1);
		bool flag=0;
		if(s[1][1]=='s')flag=dfs(1,1);
		else if(s[2][1]=='s')flag=dfs(2,1);
		else flag=dfs(3,1);
		if(flag)printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}


#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <vector>
using namespace std;
const int N = 1e5 + 10, INF = 0x3f3f3f3f, mod = 1e9 + 7;
int n, k, sx;
char a[5][105];
typedef pair<int, int> P;
bool bfs(int sx) {
    queue<P> q; q.push(P(sx, 1));
    while(q.size()) {
        int x = q.front().first, y = q.front().second; q.pop();
        if(isalpha(a[x][++y])) continue;
        if(y >= n) return true;
        for(int i = -1; i <= 1; ++i) {
            int nx = x + i;
            if(nx < 1 || nx > 3) continue;
            if(isalpha(a[nx][y]) || isalpha(a[nx][y + 1])
                    || isalpha(a[nx][y + 2]) || a[nx][y + 2] == 1) continue;
            int ny = y + 2;
            if(ny >= n) return true;
            a[nx][ny] = 1;
            q.push(P(nx, ny));
        }
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(0);
    int t; scanf("%d", &t);
    for(int xx=1;xx<=t;xx++){
    	cin>>n>>k;
    	memset(a, 0, sizeof(a)) ;
        for(int i = 1; i <= 3; ++i) {
            scanf("%s", a[i] + 1);
            if(a[i][1] == 's') sx = i;
        }
        puts(bfs(sx) ? "YES" : "NO");
    }
    return 0;
}


#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <vector>
using namespace std;
#define pr(x) cout << #x << " = " << x << "  "
#define prln(x) cout << #x << " = " << x << endl
const int N = 1e5 + 10, INF = 0x3f3f3f3f, MOD = 1e9 + 7;
int n, k, sx;
char a[5][105];
typedef pair<int, int> P;
bool bfs(int sx) {
    queue<P> q; q.push(P(sx, 1));
    while(q.size()) {
        int x = q.front().first, y = q.front().second; q.pop();
        if(isalpha(a[x][++y])) continue;
        if(y >= n) return true;
        for(int i = -1; i <= 1; ++i) {
            int nx = x + i;
            if(nx < 1 || nx > 3) continue;
            if(isalpha(a[nx][y]) || isalpha(a[nx][y + 1])
                    || isalpha(a[nx][y + 2]) || a[nx][y + 2] == 1) continue;
            int ny = y + 2;
            if(ny >= n) return true;
            a[nx][ny] = 1;
            q.push(P(nx, ny));
        }
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(0);
    int t; scanf("%d", &t);
    while(t--) {
        scanf("%d%d", &n, &k);
        memset(a, 0, sizeof a);
        for(int i = 1; i <= 3; ++i) {
            scanf("%s", a[i] + 1);
            if(a[i][1] == 's') sx = i;
        }
        puts(bfs(sx) ? "YES" : "NO");
    }
    return 0;
}


#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <vector>
using namespace std;
const int N = 1e5 + 10, INF = 0x3f3f3f3f, mod = 1e9 + 7;
int n, k, sx;
char a[5][105];
typedef pair<int, int> P;
bool bfs(int sx) {
    queue<P> q; q.push(P(sx, 1));
    while(q.size()) {
        int x = q.front().first, y = q.front().second; q.pop();
        if(isalpha(a[x][++y])) continue;
        if(y >= n) return true;
        for(int i = -1; i <= 1; ++i) {
            int nx = x + i;
            if(nx < 1 || nx > 3) continue;
            if(isalpha(a[nx][y]) || isalpha(a[nx][y + 1])
                    || isalpha(a[nx][y + 2]) || a[nx][y + 2] == 1) continue;
            int ny = y + 2;
            if(ny >= n) return true;
            a[nx][ny] = 1;
            q.push(P(nx, ny));
        }
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(0);
    int t; scanf("%d", &t);
    for(int xi=1;xi<=t;xi++){
        cin>>n>>k;
        memset(a, 0, sizeof(a)) ;
        for(int i = 1; i <= 3; ++i) {
            scanf("%s", a[i] + 1);
            if(a[i][1] == 's') sx = i;
        }
        puts(bfs(sx) ? "YES" : "NO");
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<sstream>
#include<string>
#include<bitset>
using namespace std;

typedef long long LL;

const LL LINF = (1LL <<63);
const int INF = 1 << 31;

const int NS = 110;
const int MS = 3;
const LL MOD = 1000000007;

int n,k;
int dp[MS][NS];
char str[MS][NS];
int mp[MS][NS];

int solve()
{

}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("585B.in", "r", stdin);
//    freopen("out.txt", "w", stdout);
#endif
    int nCase;
    while(~scanf("%d", &nCase))
    {
        for(int nT = 1; nT <= nCase; nT++)
        {
            memset(dp, 0, sizeof(dp));
            scanf("%d %d", &n, &k);
            for(int i = 0; i < 3; i++)
            {
                scanf("%s", str[i]);
                str[i][n] = '.';
                str[i][n + 1] = '.';
                str[i][n + 2] = '.';
                str[i][n + 3] = '\0';

                if('s' == str[i][0])
                {
                    dp[i][0] = 1;
                }
            }
            n += 3;

            for(int r = 0; r < 3; r++)
            {
                for(int c = 0; c < n; c++)
                {
                    mp[r][c] = str[r][c] - '.';
                }
            }

            int step = 1;
            for(int i = 1; i < n;)
            {
                if(1 == step)
                {
                    for(int j = 0; j < 3; j++)
                    {
                        if((0 == mp[j][i]) && dp[j][i - 1] > 0)
                        {
                            dp[j][i] = 1;
                        }
                    }

                    int state = 0;
                    for(int j = 0; j < 3; j++)
                    {
                        if(dp[j][i] > 0)
                        {
                            for(int d = 1; d <= 1; d++)
                            {
                                int r = j + d;
                                if(r < 3 && (0 == mp[r][i]))
                                {
                                 //   dp[r][i] = 1;
                                    state |= (1 << r);
                                }
                                else
                                {
                                    break;
                                }
                            }

                            for(int d = 1; d <= 1; d++)
                            {
                                int r = j - d;
                                if(r >= 0 && (0 == mp[r][i]))
                                {
                                  //  dp[r][i] = 1;
                                    state |= (1 << r);
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }

                    for(int j = 0; j < 3; j++)
                    {
                        dp[j][i] |= ((state >> j) & 1);
                    }
                }
                else
                {
                    int pre = i - 2;
                    for(int j = 0; j < 3; j++)
                    {
                        if((dp[j][pre] > 0) && (mp[j][pre + 1] == 0) && (0 == mp[j][i]))
                        {
                            dp[j][i] = 1;
                        }
                    }
                }

                step = 3 - step;
                i += step;
            }

            int ans = 0;
            for(int i = n - 3; i < n; i++)
            {
                for(int j = 0; j < 3; j++)
                {
                    if(dp[j][i] > 0)
                    {
                        ans = 1;
                    }
                }
            }

            if(ans)
            {
                printf("YES\n");
            }
            else
            {
                printf("NO\n");
            }

        }
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<sstream>
#include<string>
#include<bitset>
using namespace std;

typedef long long LL;

const LL LINF = (1LL <<63);
const int INF = 1 << 31;

const int NS = 110;
const int MS = 3;
const LL MOD = 1000000007;

int n,k;
int dp[MS][NS];
char str[MS][NS];
int mp[MS][NS];

int solve()
{

}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("D.in", "r", stdin);
//    freopen("out.txt", "w", stdout);
#endif
    int nCase;
    while(~scanf("%d", &nCase))
    {
        for(int nT = 1; nT <= nCase; nT++)
        {
            memset(dp, 0, sizeof(dp));
            scanf("%d %d", &n, &k);
            for(int i = 0; i < 3; i++)
            {
                scanf("%s", str[i]);
                str[i][n] = '.';
                str[i][n + 1] = '.';
                str[i][n + 2] = '.';
                str[i][n + 3] = '\0';

                if('s' == str[i][0])
                {
                    dp[i][0] = 1;
                }
            }
            n += 3;

            for(int r = 0; r < 3; r++)
            {
                for(int c = 0; c < n; c++)
                {
                    mp[r][c] = str[r][c] - '.';
                }
            }

            int step = 1;
            for(int i = 1; i < n;)
            {
                if(1 == step)
                {
                    for(int j = 0; j < 3; j++)
                    {
                        if((0 == mp[j][i]) && dp[j][i - 1] > 0);
                        {
                            dp[j][i] = 1;
                      //      printf("tt dp[%d][%d] = %d mp = %d\n", j, i, dp[j][i], mp[j][i]);
                        }
                    }
                    for(int j = 0; j < 3; j++)
                    {
                        if(dp[j][i] > 0)
                        {
                         //   printf("ss dp[%d][%d] = %d\n", j, i, dp[j][i]);
                            for(int d = 1; d <= 2; d++)
                            {
                                int r = j + d;
                                if(r < 3 && (0 == mp[r][i]))
                                {
                           //         printf("1:j = %d mp[%d][%d] = %d d = %d\n", j, r, i, mp[r][i], d);
                                    dp[r][i] = 1;
                                }
                                else
                                {
                                    break;
                                }
                            }

                            for(int d = 1; d <= 2; d++)
                            {
                                int r = j - d;
                                if(r >= 0 && (0 == mp[r][i]))
                                {
                              //      printf("2:j = %d mp[%d][%d] = %d d = %d\n", j, r, i, mp[r][i], d);
                                    dp[r][i] = 1;
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    int pre = i - 2;
                    for(int j = 0; j < 3; j++)
                    {
                        if((dp[j][pre] > 0) && (mp[j][pre + 1] == 0) && (0 == mp[j][i]))
                        {
                        //    printf("j = %d i = %d pre = %d, (%c %c %c) %d %d \n", j, i, pre, str[j][pre], str[j][pre + 1], str[j][i], mp[j][pre + 1], mp[j][i]);
                            dp[j][i] = 1;
                        }
                    }
                }

                step = 3 - step;
                i += step;
            }

//            printf("n = %d\n", n);
//
//            for(int r = 0; r < 3; r++)
//            {
//                for(int c = 0; c < n; c++)
//                {
//                    printf("%c ", str[r][c]);
//                }
//                puts("");
//            }
//            for(int r = 0; r < 3; r++)
//            {
//                for(int c = 0; c < n; c++)
//                {
//                    printf("%d ", dp[r][c]);
//                }
//                puts("");
//            }

            int ans = 0;
            for(int i = n - 3; i < n; i++)
            {
                for(int j = 0; j < 3; j++)
                {
                    if(dp[j][i] > 0)
                    {
                        ans = 1;
                    }
                }
            }

            if(ans)
            {
                printf("YES\n");
            }
            else
            {
                printf("NO\n");
            }

        }
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<sstream>
#include<string>
#include<bitset>
using namespace std;

typedef long long LL;

const LL LINF = (1LL <<63);
const int INF = 1 << 31;

const int NS = 110;
const int MS = 3;
const LL MOD = 1000000007;

int n,k;
int dp[MS][NS];
char str[MS][NS];
int mp[MS][NS];

int solve()
{

}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("585B.in", "r", stdin);
//    freopen("out.txt", "w", stdout);
#endif
    int nCase;
    while(~scanf("%d", &nCase))
    {
        for(int nT = 1; nT <= nCase; nT++)
        {
            memset(dp, 0, sizeof(dp));
            scanf("%d %d", &n, &k);
            for(int i = 0; i < 3; i++)
            {
                scanf("%s", str[i]);
                str[i][n] = '.';
                str[i][n + 1] = '.';
                str[i][n + 2] = '.';
                str[i][n + 3] = '\0';

                if('s' == str[i][0])
                {
                    dp[i][0] = 1;
                }
            }
            n += 3;

            for(int r = 0; r < 3; r++)
            {
                for(int c = 0; c < n; c++)
                {
                    mp[r][c] = str[r][c] - '.';
                }
            }

            int step = 1;
            for(int i = 1; i < n;)
            {
                if(1 == step)
                {
                    for(int j = 0; j < 3; j++)
                    {
                        if((0 == mp[j][i]) && dp[j][i - 1] > 0)
                        {
                            dp[j][i] = 1;
                      //      printf("tt dp[%d][%d] = %d mp = %d\n", j, i, dp[j][i], mp[j][i]);
                        }
                    }

                    int state = 0;
                    for(int j = 0; j < 3; j++)
                    {
                        if(dp[j][i] > 0)
                        {
                         //   printf("ss dp[%d][%d] = %d\n", j, i, dp[j][i]);
                            for(int d = 1; d <= 1; d++)
                            {
                                int r = j + d;
                                if(r < 3 && (0 == mp[r][i]))
                                {
                                  //  printf("1:j = %d mp[%d][%d] = %d d = %d\n", j, r, i, mp[r][i], d);
                                 //   dp[r][i] = 1;
                                    state |= (1 << r);
                                }
                                else
                                {
                                    break;
                                }
                            }

                            for(int d = 1; d <= 1; d++)
                            {
                                int r = j - d;
                                if(r >= 0 && (0 == mp[r][i]))
                                {
                                   // printf("2:j = %d mp[%d][%d] = %d d = %d\n", j, r, i, mp[r][i], d);
                                  //  dp[r][i] = 1;
                                    state |= (1 << r);
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }

                    for(int j = 0; j < 3; j++)
                    {
                        dp[j][i] |= ((state >> j) & 1);
                    }
                }
                else
                {
                    int pre = i - 2;
                    for(int j = 0; j < 3; j++)
                    {
                        if((dp[j][pre] > 0) && (mp[j][pre + 1] == 0) && (0 == mp[j][i]))
                        {
                        //    printf("j = %d i = %d pre = %d, (%c %c %c) %d %d \n", j, i, pre, str[j][pre], str[j][pre + 1], str[j][i], mp[j][pre + 1], mp[j][i]);
                            dp[j][i] = 1;
                        }
                    }
                }

                step = 3 - step;
                i += step;
            }

//            printf("n = %d\n", n);
//
//            for(int r = 0; r < 3; r++)
//            {
//                for(int c = 0; c < n; c++)
//                {
//                    printf("%c ", str[r][c]);
//                }
//                puts("");
//            }
//            for(int r = 0; r < 3; r++)
//            {
//                for(int c = 0; c < n; c++)
//                {
//                    printf("%d ", dp[r][c]);
//                }
//                puts("");
//            }

            int ans = 0;
            for(int i = n - 3; i < n; i++)
            {
                for(int j = 0; j < 3; j++)
                {
                    if(dp[j][i] > 0)
                    {
                        ans = 1;
                    }
                }
            }

            if(ans)
            {
                printf("YES\n");
            }
            else
            {
                printf("NO\n");
            }

        }
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<sstream>
#include<string>
#include<bitset>
using namespace std;

typedef long long LL;

const LL LINF = (1LL <<63);
const int INF = 1 << 31;

const int NS = 110;
const int MS = 3;
const LL MOD = 1000000007;

int n,k;
int dp[MS][NS];
char str[MS][NS];
int mp[MS][NS];

int solve()
{

}

int main()
{
#ifndef ONLINE_JUDGE
   // freopen("D.in", "r", stdin);
//    freopen("out.txt", "w", stdout);
#endif
    int nCase;
    while(~scanf("%d", &nCase))
    {
        for(int nT = 1; nT <= nCase; nT++)
        {
            memset(dp, 0, sizeof(dp));
            scanf("%d %d", &n, &k);
            for(int i = 0; i < 3; i++)
            {
                scanf("%s", str[i]);
                str[i][n] = '.';
                str[i][n + 1] = '.';
                str[i][n + 2] = '.';
                str[i][n + 3] = '\0';

                if('s' == str[i][0])
                {
                    dp[i][0] = 1;
                }
            }
            n += 3;

            for(int r = 0; r < 3; r++)
            {
                for(int c = 0; c < n; c++)
                {
                    mp[r][c] = str[r][c] - '.';
                }
            }

            int step = 1;
            for(int i = 1; i < n;)
            {
                if(1 == step)
                {
                    for(int j = 0; j < 3; j++)
                    {
                        if((0 == mp[j][i]) && dp[j][i - 1] > 0)
                        {
                            dp[j][i] = 1;
                      //      printf("tt dp[%d][%d] = %d mp = %d\n", j, i, dp[j][i], mp[j][i]);
                        }
                    }
                    for(int j = 0; j < 3; j++)
                    {
                        if(dp[j][i] > 0)
                        {
                         //   printf("ss dp[%d][%d] = %d\n", j, i, dp[j][i]);
                            for(int d = 1; d <= 2; d++)
                            {
                                int r = j + d;
                                if(r < 3 && (0 == mp[r][i]))
                                {
                           //         printf("1:j = %d mp[%d][%d] = %d d = %d\n", j, r, i, mp[r][i], d);
                                    dp[r][i] = 1;
                                }
                                else
                                {
                                    break;
                                }
                            }

                            for(int d = 1; d <= 2; d++)
                            {
                                int r = j - d;
                                if(r >= 0 && (0 == mp[r][i]))
                                {
                              //      printf("2:j = %d mp[%d][%d] = %d d = %d\n", j, r, i, mp[r][i], d);
                                    dp[r][i] = 1;
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    int pre = i - 2;
                    for(int j = 0; j < 3; j++)
                    {
                        if((dp[j][pre] > 0) && (mp[j][pre + 1] == 0) && (0 == mp[j][i]))
                        {
                        //    printf("j = %d i = %d pre = %d, (%c %c %c) %d %d \n", j, i, pre, str[j][pre], str[j][pre + 1], str[j][i], mp[j][pre + 1], mp[j][i]);
                            dp[j][i] = 1;
                        }
                    }
                }

                step = 3 - step;
                i += step;
            }

//            printf("n = %d\n", n);
//
//            for(int r = 0; r < 3; r++)
//            {
//                for(int c = 0; c < n; c++)
//                {
//                    printf("%c ", str[r][c]);
//                }
//                puts("");
//            }
//            for(int r = 0; r < 3; r++)
//            {
//                for(int c = 0; c < n; c++)
//                {
//                    printf("%d ", dp[r][c]);
//                }
//                puts("");
//            }

            int ans = 0;
            for(int i = n - 3; i < n; i++)
            {
                for(int j = 0; j < 3; j++)
                {
                    if(dp[j][i] > 0)
                    {
                        ans = 1;
                    }
                }
            }

            if(ans)
            {
                printf("YES\n");
            }
            else
            {
                printf("NO\n");
            }

        }
    }
    return 0;
}


/*
 * Vinit Gandhi
 * L.D. College of Engineering
 */
#include <bits/stdc++.h>
#if __cplusplus>199711L
    #define typeof decltype
#endif
#define IOS  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define MP   make_pair
#define PB   push_back
#define FI   first
#define SE   second
#define ll   long long
#define ld   long double
#define SIGN(x) (((x)>0)-((x)<0))
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a)   ((a).size())
#define FILL(a,x)   memset(a, (x), sizeof((a)));
#define IN(l,i,r)   ((l)<(i)&&(i)<(r))
#define LIN(l,i,r)  ((l)<=(i)&&(i)<(r))
#define INR(l,i,r)  ((l)<(i)&&(i)<=(r))
#define LINR(l,i,r) ((l)<=(i)&&(i)<=(r))
#define cmp_db(a,b) (abs(b-a)<eps)
#define is_int(a)   (cmp_db(a,0))
#define FOR(i,b,e,s)  for(i=(b);SIGN(s)*i<SIGN(s)*(e);i+=(s))
#define FORE(it,a)    for(typeof((a).begin())it=(a).begin();it!=(a).end();it++)
#define PRESENT(c,x)  ((c).find(x)!=(c).end())
#define CPRESENT(c,x) (find(ALL(c),x)!=(c).end())
#define nl         cout<<'\n'

using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

const ll mod=1e9+7;
const ld pi=acos(-1.0);
const ld eps=1e-9;
const int MAX_SIZE=50;
const int dX[]={-1, 1, 0, 0,-1, 1,-1, 1};
const int dY[]={ 0, 0,-1, 1, 1,-1,-1, 1};

template<class S, class T> ostream& operator<<(ostream& o,const pair<S,T>& a)  {o<<a.FI<<" "<<a.SE; return o;}
template<class S, class T> ostream& operator<<(ostream& o,const map<S,T>& a)   {FORE(it,a) o<<(*it)<<"\n"; return o;}
template<class S> ostream& operator<<(ostream& o,const vector<S>& a)           {FORE(it,a) o<<*it<<" "; o<<"\n"; return o;}
template<class S> ostream& operator<<(ostream& o,const vector<vector<S> >& a)  {FORE(it,a) {o<<(*it)<<"\n";} return o;}
template<class S> ostream& operator<<(ostream& o,const set<S>& a)              {FORE(it,a) o<<*it<<" "; return o;}
const ll MAX=4010;
vector<string> g(3);
int flag, n;
void dfs(int r, int c)
{
    if(flag || c>=(n-1))
    {
        flag=1;
        return;
    }
    if(g[r][c+1]=='.')
    {
        if(g[r][c+2]=='.' && g[r][c+3]=='.')
            dfs(r, c+3);
        if(r<2 && g[r+1][c+1]=='.' && g[r+1][c+2]=='.' && g[r+1][c+3]=='.')
            dfs(r+1, c+3);
        if(r>0 && g[r-1][c+1]=='.' && g[r-1][c+2]=='.' && g[r-1][c+3]=='.')
            dfs(r-1, c+3);
    }
}
int main()
{
    IOS;
    int i, t, k, s;
    cin>>t;
    while(t--)
    {
        cin>>n>>k;
        FOR(i, 0, 3, 1)
        {
            cin>>g[i];
            g[i]+="...";
            if(g[i][0]=='s')
                s=i;
        }
        flag=0;
        dfs(s, 0);
        if(flag)
            cout<<"YES\n";
        else
            cout<<"NO\n";
    }

    return 0;
}


/*
 * Vinit Gandhi
 * L.D. College of Engineering
 */
#include <bits/stdc++.h>
#if __cplusplus>199711L
    #define typeof decltype
#endif
#define IOS  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define MP   make_pair
#define PB   push_back
#define FI   first
#define SE   second
#define ll   long long
#define ld   long double
#define SIGN(x) (((x)>0)-((x)<0))
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a)   ((a).size())
#define FILL(a,x)   memset(a, (x), sizeof((a)));
#define IN(l,i,r)   ((l)<(i)&&(i)<(r))
#define LIN(l,i,r)  ((l)<=(i)&&(i)<(r))
#define INR(l,i,r)  ((l)<(i)&&(i)<=(r))
#define LINR(l,i,r) ((l)<=(i)&&(i)<=(r))
#define cmp_db(a,b) (abs(b-a)<eps)
#define is_int(a)   (cmp_db(a,0))
#define FOR(i,b,e,s)  for(i=(b);SIGN(s)*i<SIGN(s)*(e);i+=(s))
#define FORE(it,a)    for(typeof((a).begin())it=(a).begin();it!=(a).end();it++)
#define PRESENT(c,x)  ((c).find(x)!=(c).end())
#define CPRESENT(c,x) (find(ALL(c),x)!=(c).end())
#define nl         cout<<'\n'

using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

const ll mod=1e9+7;
const ld pi=acos(-1.0);
const ld eps=1e-9;
const int MAX_SIZE=50;
const int dX[]={-1, 1, 0, 0,-1, 1,-1, 1};
const int dY[]={ 0, 0,-1, 1, 1,-1,-1, 1};

template<class S, class T> ostream& operator<<(ostream& o,const pair<S,T>& a)  {o<<a.FI<<" "<<a.SE; return o;}
template<class S, class T> ostream& operator<<(ostream& o,const map<S,T>& a)   {FORE(it,a) o<<(*it)<<"\n"; return o;}
template<class S> ostream& operator<<(ostream& o,const vector<S>& a)           {FORE(it,a) o<<*it<<" "; o<<"\n"; return o;}
template<class S> ostream& operator<<(ostream& o,const vector<vector<S> >& a)  {FORE(it,a) {o<<(*it)<<"\n";} return o;}
template<class S> ostream& operator<<(ostream& o,const set<S>& a)              {FORE(it,a) o<<*it<<" "; return o;}
const ll MAX=110;
vector<string> g(3);
int flag, n, vis[5][MAX];
void dfs(int r, int c)
{
    vis[r][c]=1;
    if(flag || c>=(n-1))
    {
        flag=1;
        return;
    }
    if(g[r][c+1]=='.')
    {
        if(g[r][c+2]=='.' && g[r][c+3]=='.' && !vis[r][c+3])
            dfs(r, c+3);
        if(r<2 && g[r+1][c+1]=='.' && g[r+1][c+2]=='.' && g[r+1][c+3]=='.' && !vis[r+1][c+3])
            dfs(r+1, c+3);
        if(r>0 && g[r-1][c+1]=='.' && g[r-1][c+2]=='.' && g[r-1][c+3]=='.' && !vis[r-1][c+3])
            dfs(r-1, c+3);
    }
}
int main()
{
    IOS;
    int i, t, k, s;
    cin>>t;
    while(t--)
    {
        cin>>n>>k;
        FOR(i, 0, 3, 1)
        {
            cin>>g[i];
            g[i]+="...";
            if(g[i][0]=='s')
                s=i;
            FILL(vis[i], 0);
        }
        flag=0;
        dfs(s, 0);
        if(flag)
            cout<<"YES\n";
        else
            cout<<"NO\n";
    }
    return 0;
}


	#include<cstdio>
	#include<cstring>
	#include<cstdlib>
	#include<iostream>
	#include<algorithm>
	#include<queue>
	#include<cmath>
	using namespace std;
	int n,k;
	struct zk
	{
		int x,y;
	}now,point;
	char c;
	int map[4][201];
	int dir[4]={0,0,1,-1};
	int check(int x,int y)
	{
		return x>=1&&x<=3;
	}
	queue<zk> q;
	int vis[4][201];
	int bfs(int a,int b)
	{
		point.x=a;
		point.y=b;
		vis[a][b]=1;
		q.push(point);
		while(!q.empty())
		{
			now=q.front();
			q.pop();
			if (map[now.x][now.y+1]==1) continue;
			if (now.y>=n) {while(!q.empty())q.pop();return 1;}
			for(int i=1;i<=3;i++)
			{
				if (now.x+dir[i]<1||now.x+dir[i]>3) continue;
			    if (map[now.x+dir[i]][now.y+1]==1||map[now.x+dir[i]][now.y+2]==1||map[now.x+dir[i]][now.y+3]==1) continue;
				if (!vis[now.x+dir[i]][now.y+3])
				{
					point.x=now.x+dir[i];
					point.y=now.y+3;
				q.push(point);
				vis[point.x][point.y]=1;
			    }
			}
		}
		return 0;
	}
	int main()
	{
		int t;
		scanf("%d",&t);
		while(t--)
		{
			scanf("%d%d",&n,&k);
			memset(map,0,sizeof(map));
			memset(vis,0,sizeof(vis));
			int a,b;
			for(int i=1;i<=3;i++)
			for(int j=1;j<=n;j++)
			{
				cin>>c;
				if (c!='.') map[i][j]=1;
				if (c=='s')
				{
					a=i;
					b=j;
				}
			}
			if (bfs(a,b)) printf("YES\n");
			else printf("NO\n");
		}
		return 0;
	}


	#include<cstdio>
	#include<cstring>
	#include<cstdlib>
	#include<iostream>
	#include<algorithm>
	#include<queue>
	#include<cmath>
	using namespace std;
	int n,k;
	struct zk
	{
		int x,y;
	}now,point;
	char c;
	int map[4][201];
	int dir[4]={0,0,1,-1};
	int check(int x,int y)
	{
		return x>=1&&x<=3&&y>=1&&y<=n;
	}
	queue<zk> q;
	int vis[4][201];
	int bfs(int a,int b)
	{
		point.x=a;
		point.y=b;
		vis[a][b]=1;
		q.push(point);
		while(!q.empty())
		{
			now=q.front();
			q.pop();point.y=now.y+1;
			for(int i=1;i<=3;i++)
			{
			    if (map[now.x][now.y+1]==1) continue;

				point.x=now.x+dir[i];
				if (!check(point.x,point.y)) continue;
				if (map[point.x][point.y]==1||map[point.x][point.y+1]==1||map[point.x][point.y+2]==1) continue;if (point.y>=n) {while(!q.empty())q.pop();return 1;}
				point.y+=2;
				if (!vis[point.x][point.y])
				{
				q.push(point);
				vis[point.x][point.y]=1;
			    }
			}
		}
		return 0;
	}
	int main()
	{
		int t;
		scanf("%d",&t);
		while(t--)
		{
			scanf("%d%d",&n,&k);
			memset(map,0,sizeof(map));
			memset(vis,0,sizeof(vis));
			int a,b;
			for(int i=1;i<=3;i++)
			for(int j=1;j<=n;j++)
			{
				cin>>c;
				if (c!='.') map[i][j]=1;
				if (c=='s')
				{
					a=i;
					b=j;
				}
			}
			if (bfs(a,b)) printf("YES\n");
			else printf("NO\n");
		}
		return 0;
	}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<queue>
#include<cmath>
using namespace std;
int n,k;
struct zk
{
	int x,y;
}now,point;
char c;
int map[4][201];
int dir[4]={0,0,1,-1};
int check(int x,int y)
{
	return x>=1&&x<=3&&y>=1&&y<=n;
}
queue<zk> q;
int vis[4][201];
int bfs(int a,int b)
{
	point.x=a;
	point.y=b;
	vis[a][b]=1;
	q.push(point);
	while(!q.empty())
	{
		now=q.front();
		q.pop();point.y=now.y+1;
		for(int i=1;i<=3;i++)
		{
		    if (map[now.x][now.y+1]==1) continue;
			if (point.y>=n) {while(!q.empty())q.pop();return 1;}
			point.x=now.x+dir[i];
			if (!check(point.x,point.y)) continue;
			if (map[point.x][point.y+1]==1||map[point.x][point.y+2]==1) continue;
			point.y+=2;
			if (!vis[point.x][point.y])
			{
			q.push(point);
			vis[point.x][point.y]=1;
		    }
		}
	}
	return 0;
}
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d",&n,&k);
		memset(map,0,sizeof(map));
		memset(vis,0,sizeof(vis));
		int a,b;
		for(int i=1;i<=3;i++)
		for(int j=1;j<=n;j++)
		{
			cin>>c;
			if (c!='.') map[i][j]=1;
			if (c=='s')
			{
				a=i;
				b=j;
			}
		}
		if (bfs(a,b)) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}


#include<cstdio>
	#include<cstring>
	#include<cstdlib>
	#include<iostream>
	#include<algorithm>
	#include<queue>
	#include<cmath>
	using namespace std;
	int n,k;
	struct zk
	{
		int x,y;
	}now,point;
	char c;
	int map[4][201];
	int dir[4]={0,0,1,-1};
	int check(int x,int y)
	{
		return x>=1&&x<=3&&y>=1&&y<=n;
	}
	queue<zk> q;
	int vis[4][201];
	int bfs(int a,int b)
	{
		point.x=a;
		point.y=b;
		vis[a][b]=1;
		q.push(point);
		while(!q.empty())
		{
			now=q.front();
			q.pop();point.y=now.y+1;
			for(int i=1;i<=3;i++)
			{
			    if (map[now.x][now.y+1]==1) continue;
				if (point.y>=n) {while(!q.empty())q.pop();return 1;}
				point.x=now.x+dir[i];
				if (!check(point.x,point.y)) continue;
				if (map[point.x][point.y]==1||map[point.x][point.y+1]==1||map[point.x][point.y+2]==1) continue;
				point.y+=2;
				if (!vis[point.x][point.y])
				{
				q.push(point);
				vis[point.x][point.y]=1;
			    }
			}
		}
		return 0;
	}
	int main()
	{
		int t;
		scanf("%d",&t);
		while(t--)
		{
			scanf("%d%d",&n,&k);
			memset(map,0,sizeof(map));
			memset(vis,0,sizeof(vis));
			int a,b;
			for(int i=1;i<=3;i++)
			for(int j=1;j<=n;j++)
			{
				cin>>c;
				if (c!='.') map[i][j]=1;
				if (c=='s')
				{
					a=i;
					b=j;
				}
			}
			if (bfs(a,b)) printf("YES\n");
			else printf("NO\n");
		}
		return 0;
	}


	#include<cstdio>
	#include<cstring>
	#include<cstdlib>
	#include<iostream>
	#include<algorithm>
	#include<queue>
	#include<cmath>
	using namespace std;
	int n,k;
	struct zk
	{
		int x,y;
	}now,point;
	char c;
	int map[4][201];
	int dir[4]={0,0,1,-1};
	int check(int x,int y)
	{
		return x>=1&&x<=3&&y>=1;
	}
	queue<zk> q;
	int vis[4][201];
	int bfs(int a,int b)
	{
		point.x=a;
		point.y=b;
		vis[a][b]=1;
		q.push(point);
		while(!q.empty())
		{
			now=q.front();
			q.pop();point.y=now.y+1;
			for(int i=1;i<=3;i++)
			{
			    if (map[now.x][now.y+1]==1) continue;
				point.x=now.x+dir[i];
				if (!check(point.x,point.y)) continue;
				if (map[point.x][point.y]==1||map[point.x][point.y+1]==1||map[point.x][point.y+2]==1) continue;
				if (point.y>=n) {while(!q.empty())q.pop();return 1;}
				point.y+=2;
				if (!vis[point.x][point.y])
				{
				q.push(point);
				vis[point.x][point.y]=1;
			    }
			}
		}
		return 0;
	}
	int main()
	{
		int t;
		scanf("%d",&t);
		while(t--)
		{
			scanf("%d%d",&n,&k);
			memset(map,0,sizeof(map));
			memset(vis,0,sizeof(vis));
			int a,b;
			for(int i=1;i<=3;i++)
			for(int j=1;j<=n;j++)
			{
				cin>>c;
				if (c!='.') map[i][j]=1;
				if (c=='s')
				{
					a=i;
					b=j;
				}
			}
			if (bfs(a,b)) printf("YES\n");
			else printf("NO\n");
		}
		return 0;
	}


#include <bits/stdc++.h>
using namespace std;
#define debug(a) cout << #a << ": " << a << endl
#define fto(i, l, r) for(int i = l; i <= r; ++i)
#define fdto(i, r, l) for(int i = r; i >= l; --i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ll long long
#define ii pair<int, int>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define maxN 115
#define oo 1000000007

int nTest, n, m, tmp, xS, yS;
int dx[3] = {-1, 0, 1},
    dy[3] = {1, 1, 1};
char a[5][maxN];
bool visited[5][maxN];

void DFS(int x, int y) {
//    debug(x);
//    debug(y);
    visited[x][y] = true;
    fto(i, 0, 2) {
        int u = x+dx[i], v = y+dy[i];
        if (!visited[u][v+2] && a[x][y+1] == '.' && a[u][v] == '.' && a[u][v+1] == '.'&& a[u][v+2] == '.') DFS(u, v+2);
    }
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    scanf("%d", &nTest);
    fto(iTest, 1, nTest) {
        n = 3;
        scanf("%d%d\n", &m, &tmp);

        memset(visited, false, sizeof(visited));
        fto(j, 0, m+1) a[0][j] = a[n+1][j] = '#';
        fto(i, 1, n) {
            a[i][0] = '#';
            fto(j, 1, m) {
                scanf("%c", &a[i][j]);
                if (a[i][j] == 's') xS = i, yS = j;
            }
            scanf("\n");
            a[i][m+1] = a[i][m+2] = '.';
            a[i][m+3] = a[i][m+4] = a[i][m+5] = '#';
        }

        DFS(xS, yS);

        bool ok = false;
        fto(i, 1, n)
            fto(j, m, m+2)
                if (visited[i][j]) {
                    ok = true;
                    break;
                }
        puts((ok) ? "YES" : "NO");
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define debug(a) cout << #a << ": " << a << endl
#define fto(i, l, r) for(int i = l; i <= r; ++i)
#define fdto(i, r, l) for(int i = r; i >= l; --i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ll long long
#define ii pair<int, int>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define maxN 115
#define oo 1000000007

int nTest, n, m, tmp, xS, yS;
int dx[3] = {-1, 0, 1},
    dy[3] = {1, 1, 1};
char a[5][maxN];
bool visited[5][maxN];

void DFS(int x, int y) {
//    debug(x);
//    debug(y);
    visited[x][y] = true;
    fto(i, 0, 2) {
        int u = x+dx[i], v = y+dy[i];
        if (!visited[u][v] && a[x][y+1] == '.' && a[u][v] == '.' && a[u][v+1] == '.'&& a[u][v+2] == '.') DFS(u, v+2);
    }
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    scanf("%d", &nTest);
    fto(iTest, 1, nTest) {
        n = 3;
        scanf("%d%d\n", &m, &tmp);

        memset(visited, false, sizeof(visited));
        fto(j, 0, m+1) a[0][j] = a[n+1][j] = '#';
        fto(i, 1, n) {
            a[i][0] = '#';
            fto(j, 1, m) {
                scanf("%c", &a[i][j]);
                if (a[i][j] == 's') xS = i, yS = j;
            }
            scanf("\n");
            a[i][m+1] = a[i][m+2] = '.';
            a[i][m+3] = a[i][m+4] = a[i][m+5] = '#';
        }

        DFS(xS, yS);

        bool ok = false;
        fto(i, 1, n)
            fto(j, m, m+2)
                if (visited[i][j]) {
                    ok = true;
                    break;
                }
        puts((ok) ? "YES" : "NO");
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define debug(a) cout << #a << ": " << a << endl
#define fto(i, l, r) for(int i = l; i <= r; ++i)
#define fdto(i, r, l) for(int i = r; i >= l; --i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ll long long
#define ii pair<int, int>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define maxN 155
#define oo 1000000007

int nTest, n, m, tmp, xS, yS;
int dx[3] = {-1, 0, 1},
    dy[3] = {1, 1, 1};
char a[maxN][maxN];
bool visited[maxN][maxN];

void DFS(int x, int y) {
//    debug(x);
//    debug(y);
    visited[x][y] = true;
    fto(i, 0, 2) {
        int u = x+dx[i], v = y+dy[i];
        if (!visited[u][v] && a[x][y+1] == '.' && a[u][v] == '.' && a[u][v+1] == '.'&& a[u][v+2] == '.') DFS(u, v+2);
    }
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    scanf("%d", &nTest);
    fto(iTest, 1, nTest) {
        n = 3;
        scanf("%d%d\n", &m, &tmp);

        memset(visited, false, sizeof(visited));
        fto(j, 0, m+1) a[0][j] = a[n+1][j] = '#';
        fto(i, 1, n) {
            a[i][0] = '#';
            fto(j, 1, m) {
                scanf("%c", &a[i][j]);
                if (a[i][j] == 's') xS = i, yS = j;
            }
            scanf("\n");
            a[i][m+1] = a[i][m+2] = '.';
            a[i][m+3] = a[i][m+4] = a[i][m+5] = '#';
        }

        DFS(xS, yS);

        bool ok = false;
        fto(i, 1, n)
            fto(j, m, m+2)
                if (visited[i][j]) {
                    ok = true;
                    break;
                }
        puts((ok) ? "YES" : "NO");
    }

    return 0;
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <functional>
#include <algorithm>
#include <math.h>
#include <bitset>
#include <set>
#include <queue>
#include <assert.h>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <complex>
#include <numeric>
#include <map>
#include <time.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<int,ull> piu;
typedef pair<ull,ull> puu;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
typedef pair<pii,ll> ppl;
typedef pair<ll,pii> plp;
typedef pair<ll,pll> plP;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;
typedef pair<double,int> pdi;
typedef pair<int,double> pid;
typedef pair<double,pii> pdp;
typedef pair<double,double> pdd;
typedef pair<pdd,double> pd3;
typedef vector<double> vec;
typedef vector<vec> mat;
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
#define repn(i,a,n) for (int (i) = (a); (i) < (n); (i)++)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define SORT(x) sort((x).begin(),(x).end())
#define SORTN(x,n) sort((x),(x)+(n))
#define ERASE(x) (x).erase(unique((x).begin(),(x).end()),(x).end())
#define COUNT(x,c) count((x).begin(),(x).end(),(c))
#define REMOVE(x,c) (x).erase(remove((x).begin(),(x).end(),(c)),(x).end())
#define REVERSE(x) reverse((x).begin(),(x).end())
#define FORIT(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))-(x).begin()
#define lb(x,a) lower_bound((x).begin(),(x).end(),(a))
#define LBN(x,a,n) lower_bound((x),(x)+(n),(a))-(x)
#define lbN(x,a,n) lower_bound((x),(x)+(n),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))-(x).begin()
#define ub(x,a) upper_bound((x).begin(),(x).end(),(a))
#define BS(x,a) binary_search((x).begin(),(x).end(),(a))
#define BS2(x,n,a) binary_search((x),(x)+(n),(a))
#define NB(x) (((x)&~((x)+((x)&-(x))))/((x)&-(x))>>1)|((x)+((x)&-(x)))
#define NP(x) next_permutation((x).begin(),(x).end())
#define MM(x,p) memset((x),(p),sizeof(x))
#define SQ(x) (x)*(x)
#define SC(c1,c2) strcmp(c1,c2)==0
#define mp make_pair
#define INF (1<<28)
#define INFL (1LL<<61)
#define fi first
#define se second
#define EPS 1e-9
#define MOD 1000000007
#define MIN(x,a) x=min(x,a)
#define MAX(x,a) x=max(x,a)
#define madd(x,a) x=(x+a)%MOD
#define msub(x,a) x=(x+MOD-a)%MOD
#define OUTPUT(x) rep(__,x.size())printf("%d%c",x[__],__+1==x.size()?'\n':' ');

int T;
int H,W;
char m[111][30];
bool f[111][30];

int main()
{
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d%d",&W,&H);
        H=3;
        rep(i,H)scanf("%s",&m[i]);
        rep(i,H)rep(j,W)f[i][j]=false;
        rep(i,H)if(m[i][0]=='.')f[i][0]=true;
        rep(j,W-1)
        {
            rep(i,H)if(f[i][j]==true)
            {
                f[i][j+1]=true;
                int kk=j+1+j*2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                if(f[i][j+1]==false)continue;
                if(i)f[i-1][j+1]=true;
                f[i+1][j+1]=true;
            }
            rep(i,H)if(f[i][j+1]==true)
            {
                int kk=j+1+j*2+2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                kk=j+1+j*2+1;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                kk=j+1+j*2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
            }
        }
        bool ok=false;
        rep(i,H)if(f[i][W-1])ok=true;
        puts(ok?"YES":"NO");
    }
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <functional>
#include <algorithm>
#include <math.h>
#include <bitset>
#include <set>
#include <queue>
#include <assert.h>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <complex>
#include <numeric>
#include <map>
#include <time.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<int,ull> piu;
typedef pair<ull,ull> puu;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
typedef pair<pii,ll> ppl;
typedef pair<ll,pii> plp;
typedef pair<ll,pll> plP;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;
typedef pair<double,int> pdi;
typedef pair<int,double> pid;
typedef pair<double,pii> pdp;
typedef pair<double,double> pdd;
typedef pair<pdd,double> pd3;
typedef vector<double> vec;
typedef vector<vec> mat;
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
#define repn(i,a,n) for (int (i) = (a); (i) < (n); (i)++)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define SORT(x) sort((x).begin(),(x).end())
#define SORTN(x,n) sort((x),(x)+(n))
#define ERASE(x) (x).erase(unique((x).begin(),(x).end()),(x).end())
#define COUNT(x,c) count((x).begin(),(x).end(),(c))
#define REMOVE(x,c) (x).erase(remove((x).begin(),(x).end(),(c)),(x).end())
#define REVERSE(x) reverse((x).begin(),(x).end())
#define FORIT(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))-(x).begin()
#define lb(x,a) lower_bound((x).begin(),(x).end(),(a))
#define LBN(x,a,n) lower_bound((x),(x)+(n),(a))-(x)
#define lbN(x,a,n) lower_bound((x),(x)+(n),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))-(x).begin()
#define ub(x,a) upper_bound((x).begin(),(x).end(),(a))
#define BS(x,a) binary_search((x).begin(),(x).end(),(a))
#define BS2(x,n,a) binary_search((x),(x)+(n),(a))
#define NB(x) (((x)&~((x)+((x)&-(x))))/((x)&-(x))>>1)|((x)+((x)&-(x)))
#define NP(x) next_permutation((x).begin(),(x).end())
#define MM(x,p) memset((x),(p),sizeof(x))
#define SQ(x) (x)*(x)
#define SC(c1,c2) strcmp(c1,c2)==0
#define mp make_pair
#define INF (1<<28)
#define INFL (1LL<<61)
#define fi first
#define se second
#define EPS 1e-9
#define MOD 1000000007
#define MIN(x,a) x=min(x,a)
#define MAX(x,a) x=max(x,a)
#define madd(x,a) x=(x+a)%MOD
#define msub(x,a) x=(x+MOD-a)%MOD
#define OUTPUT(x) rep(__,x.size())printf("%d%c",x[__],__+1==x.size()?'\n':' ');

int T;
int H,W;
char m[111][30];
bool f[111][30];

int main()
{
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d%d",&W,&H);
        H=3;
        rep(i,H)scanf("%s",&m[i]);
        rep(i,H)rep(j,W)f[i][j]=false;
        rep(i,H)if(m[i][0]=='.')f[i][0]=true;
        rep(j,W-1)
        {
            rep(i,H)if(f[i][j]==true)
            {
                if(i)f[i-1][j+1]=true;
                f[i][j+1]=true;
                f[i+1][j+1]=true;
            }
            rep(i,H)if(f[i][j+1]==true)
            {
                int kk=j+1+j*2+2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                kk=j+1+j*2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                kk=j+1+j*2+1;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
            }
        }
        bool ok=false;
        rep(i,H)if(f[i][W-1])ok=true;
        puts(ok?"YES":"NO");
    }
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <functional>
#include <algorithm>
#include <math.h>
#include <bitset>
#include <set>
#include <queue>
#include <assert.h>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <complex>
#include <numeric>
#include <map>
#include <time.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<int,ull> piu;
typedef pair<ull,ull> puu;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
typedef pair<pii,ll> ppl;
typedef pair<ll,pii> plp;
typedef pair<ll,pll> plP;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;
typedef pair<double,int> pdi;
typedef pair<int,double> pid;
typedef pair<double,pii> pdp;
typedef pair<double,double> pdd;
typedef pair<pdd,double> pd3;
typedef vector<double> vec;
typedef vector<vec> mat;
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
#define repn(i,a,n) for (int (i) = (a); (i) < (n); (i)++)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define SORT(x) sort((x).begin(),(x).end())
#define SORTN(x,n) sort((x),(x)+(n))
#define ERASE(x) (x).erase(unique((x).begin(),(x).end()),(x).end())
#define COUNT(x,c) count((x).begin(),(x).end(),(c))
#define REMOVE(x,c) (x).erase(remove((x).begin(),(x).end(),(c)),(x).end())
#define REVERSE(x) reverse((x).begin(),(x).end())
#define FORIT(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))-(x).begin()
#define lb(x,a) lower_bound((x).begin(),(x).end(),(a))
#define LBN(x,a,n) lower_bound((x),(x)+(n),(a))-(x)
#define lbN(x,a,n) lower_bound((x),(x)+(n),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))-(x).begin()
#define ub(x,a) upper_bound((x).begin(),(x).end(),(a))
#define BS(x,a) binary_search((x).begin(),(x).end(),(a))
#define BS2(x,n,a) binary_search((x),(x)+(n),(a))
#define NB(x) (((x)&~((x)+((x)&-(x))))/((x)&-(x))>>1)|((x)+((x)&-(x)))
#define NP(x) next_permutation((x).begin(),(x).end())
#define MM(x,p) memset((x),(p),sizeof(x))
#define SQ(x) (x)*(x)
#define SC(c1,c2) strcmp(c1,c2)==0
#define mp make_pair
#define INF (1<<28)
#define INFL (1LL<<61)
#define fi first
#define se second
#define EPS 1e-9
#define MOD 1000000007
#define MIN(x,a) x=min(x,a)
#define MAX(x,a) x=max(x,a)
#define madd(x,a) x=(x+a)%MOD
#define msub(x,a) x=(x+MOD-a)%MOD
#define OUTPUT(x) rep(__,x.size())printf("%d%c",x[__],__+1==x.size()?'\n':' ');

int T;
int H,W;
char m[111][30];
bool f[111][30];

int main()
{
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d%d",&W,&H);
        H=3;
        rep(i,H)scanf("%s",&m[i]);
        rep(i,H)rep(j,W)f[i][j]=false;
        rep(i,H)if(m[i][0]=='s')f[i][0]=true;
        rep(j,W-1)
        {
            rep(i,H)if(f[i][j]==true)
            {
                f[i][j+1]=true;
                int kk=j+1+j*2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                if(f[i][j+1]==false)continue;
                if(i)f[i-1][j+1]=true;
                f[i+1][j+1]=true;
            }
            rep(i,H)if(f[i][j+1]==true)
            {
                int kk=j+1+j*2+2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                kk=j+1+j*2+1;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                kk=j+1+j*2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
            }
        }
        bool ok=false;
        rep(i,H)if(f[i][W-1])ok=true;
        puts(ok?"YES":"NO");
    }
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <functional>
#include <algorithm>
#include <math.h>
#include <bitset>
#include <set>
#include <queue>
#include <assert.h>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <complex>
#include <numeric>
#include <map>
#include <time.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<int,ull> piu;
typedef pair<ull,ull> puu;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
typedef pair<pii,ll> ppl;
typedef pair<ll,pii> plp;
typedef pair<ll,pll> plP;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;
typedef pair<double,int> pdi;
typedef pair<int,double> pid;
typedef pair<double,pii> pdp;
typedef pair<double,double> pdd;
typedef pair<pdd,double> pd3;
typedef vector<double> vec;
typedef vector<vec> mat;
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
#define repn(i,a,n) for (int (i) = (a); (i) < (n); (i)++)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define SORT(x) sort((x).begin(),(x).end())
#define SORTN(x,n) sort((x),(x)+(n))
#define ERASE(x) (x).erase(unique((x).begin(),(x).end()),(x).end())
#define COUNT(x,c) count((x).begin(),(x).end(),(c))
#define REMOVE(x,c) (x).erase(remove((x).begin(),(x).end(),(c)),(x).end())
#define REVERSE(x) reverse((x).begin(),(x).end())
#define FORIT(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))-(x).begin()
#define lb(x,a) lower_bound((x).begin(),(x).end(),(a))
#define LBN(x,a,n) lower_bound((x),(x)+(n),(a))-(x)
#define lbN(x,a,n) lower_bound((x),(x)+(n),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))-(x).begin()
#define ub(x,a) upper_bound((x).begin(),(x).end(),(a))
#define BS(x,a) binary_search((x).begin(),(x).end(),(a))
#define BS2(x,n,a) binary_search((x),(x)+(n),(a))
#define NB(x) (((x)&~((x)+((x)&-(x))))/((x)&-(x))>>1)|((x)+((x)&-(x)))
#define NP(x) next_permutation((x).begin(),(x).end())
#define MM(x,p) memset((x),(p),sizeof(x))
#define SQ(x) (x)*(x)
#define SC(c1,c2) strcmp(c1,c2)==0
#define mp make_pair
#define INF (1<<28)
#define INFL (1LL<<61)
#define fi first
#define se second
#define EPS 1e-9
#define MOD 1000000007
#define MIN(x,a) x=min(x,a)
#define MAX(x,a) x=max(x,a)
#define madd(x,a) x=(x+a)%MOD
#define msub(x,a) x=(x+MOD-a)%MOD
#define OUTPUT(x) rep(__,x.size())printf("%d%c",x[__],__+1==x.size()?'\n':' ');

int T;
int H,W;
char m[300][300];
bool f[300][300];

int main()
{
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d%d",&W,&H);
        H=3;
        rep(i,H)scanf("%s",&m[i]);
        rep(i,H)rep(j,W)f[i][j]=false;
        rep(i,H)if(m[i][0]=='s')f[i][0]=true;
        rep(j,W-1)
        {
            rep(i,H)if(f[i][j]==true)
            {
                f[i][j+1]=true;
                int kk=j+1+j*2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                if(f[i][j+1]==false)continue;
                if(i)f[i-1][j+1]=true;
                f[i+1][j+1]=true;
            }
            rep(i,H)if(f[i][j+1]==true)
            {
                int kk=j+1+j*2+2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                kk=j+1+j*2+1;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                kk=j+1+j*2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
            }
        }
        bool ok=false;
        rep(i,H)if(f[i][W-1])ok=true;
        puts(ok?"YES":"NO");
    }
}


#include <cstdio>
#include <vector>
#include <cstring>
#include <functional>
#include <algorithm>
#include <math.h>
#include <bitset>
#include <set>
#include <queue>
#include <assert.h>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <complex>
#include <numeric>
#include <map>
#include <time.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<int,ull> piu;
typedef pair<ull,ull> puu;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
typedef pair<pii,ll> ppl;
typedef pair<ll,pii> plp;
typedef pair<ll,pll> plP;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;
typedef pair<double,int> pdi;
typedef pair<int,double> pid;
typedef pair<double,pii> pdp;
typedef pair<double,double> pdd;
typedef pair<pdd,double> pd3;
typedef vector<double> vec;
typedef vector<vec> mat;
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
#define repn(i,a,n) for (int (i) = (a); (i) < (n); (i)++)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define SORT(x) sort((x).begin(),(x).end())
#define SORTN(x,n) sort((x),(x)+(n))
#define ERASE(x) (x).erase(unique((x).begin(),(x).end()),(x).end())
#define COUNT(x,c) count((x).begin(),(x).end(),(c))
#define REMOVE(x,c) (x).erase(remove((x).begin(),(x).end(),(c)),(x).end())
#define REVERSE(x) reverse((x).begin(),(x).end())
#define FORIT(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))-(x).begin()
#define lb(x,a) lower_bound((x).begin(),(x).end(),(a))
#define LBN(x,a,n) lower_bound((x),(x)+(n),(a))-(x)
#define lbN(x,a,n) lower_bound((x),(x)+(n),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))-(x).begin()
#define ub(x,a) upper_bound((x).begin(),(x).end(),(a))
#define BS(x,a) binary_search((x).begin(),(x).end(),(a))
#define BS2(x,n,a) binary_search((x),(x)+(n),(a))
#define NB(x) (((x)&~((x)+((x)&-(x))))/((x)&-(x))>>1)|((x)+((x)&-(x)))
#define NP(x) next_permutation((x).begin(),(x).end())
#define MM(x,p) memset((x),(p),sizeof(x))
#define SQ(x) (x)*(x)
#define SC(c1,c2) strcmp(c1,c2)==0
#define mp make_pair
#define INF (1<<28)
#define INFL (1LL<<61)
#define fi first
#define se second
#define EPS 1e-9
#define MOD 1000000007
#define MIN(x,a) x=min(x,a)
#define MAX(x,a) x=max(x,a)
#define madd(x,a) x=(x+a)%MOD
#define msub(x,a) x=(x+MOD-a)%MOD
#define OUTPUT(x) rep(__,x.size())printf("%d%c",x[__],__+1==x.size()?'\n':' ');

int T;
int H,W;
char m[111][30];
bool f[111][30];

int main()
{
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d%d",&W,&H);
        H=3;
        rep(i,H)scanf("%s",&m[i]);
        rep(i,H)rep(j,W)f[i][j]=false;
        rep(i,H)if(m[i][0]=='.')f[i][0]=true;
        rep(j,W-1)
        {
            rep(i,H)if(f[i][j]==true)
            {
                f[i][j+1]=true;
                int kk=j+1+j*2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                if(f[i][j+1]==false)continue;
                if(i)f[i-1][j+1]=true;
                f[i+1][j+1]=true;
            }
            rep(i,H)if(f[i][j+1]==true)
            {
                int kk=j+1+j*2+2;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
                kk=j+1+j*2+1;
                if(kk<W&&m[i][kk]!='.')f[i][j+1]=false;
            }
        }
        bool ok=false;
        rep(i,H)if(f[i][W-1])ok=true;
        puts(ok?"YES":"NO");
    }
}


#include<iostream>
#include<cstdlib>
#include<cstdio>//old c library
#include<cmath>//ceil,floor,round,M_PI,,trig,pow(ambigous)
#include<string>//sting c++ library
#include<cstring>//string c library
#include<iomanip>//set precisions
#include <algorithm>//using swap,sort using some function.
#include<fstream>//used to manipulate files.
#include<stack>//stl for stack
#include<queue>//stl fro queue
#include<map>//stl for map key,info asscociated
//#include <boost/multiprecision/cpp_int.hpp>//algerbric operations on string
//namespace mp=boost::multiprecision;

using namespace std;
int t,n,k,x,c;
char mat[3][105];
bool u,m,d,nu,nm,nd,dead;

bool train(char ch)
{
return (ch>=65 && ch<=90);
}

int main()
{
    scanf("%d",&t);
    while(t--)
    {
        c=0;
        dead=false;
        scanf("%d%d",&n,&k);
        for(x=0;x<3;x++)
        scanf("%s",&mat[x][0]);
        u=mat[0][0]=='s',m=mat[1][0]=='s',d=mat[2][0]=='s';
        while(c<n && !dead)
        {
        nu=false,nm=false,nd=false;
        if(train(mat[0][c+1]))
        u=false;
        if(train(mat[1][c+1]))
        m=false;
        if(train(mat[2][c+1]))
        d=false;
        nu=u||m;
        nm=u||m||d;
        nd=m||d;
        if(train(mat[0][c+1]))
        nu=false;
        if(train(mat[1][c+1]))
        nm=false;
        if(train(mat[2][c+1]))
        nd=false;
        if(train(mat[0][c+2]))
        nu=false;
        if(train(mat[1][c+2]))
        nm=false;
        if(train(mat[2][c+2]))
        nd=false;
        u=nu,m=nm,d=nd;
        dead=!(u||m||d);
        c+=3;
        }
        if(dead)
        printf("NO\n");
        else
        printf("YES\n");
        }
    return 0;
        }


#include<iostream>
#include<cstdlib>
#include<cstdio>//old c library
#include<cmath>//ceil,floor,round,M_PI,,trig,pow(ambigous)
#include<string>//sting c++ library
#include<cstring>//string c library
#include<iomanip>//set precisions
#include <algorithm>//using swap,sort using some function.
#include<fstream>//used to manipulate files.
#include<stack>//stl for stack
#include<queue>//stl fro queue
#include<map>//stl for map key,info asscociated
//#include <boost/multiprecision/cpp_int.hpp>//algerbric operations on string
//namespace mp=boost::multiprecision;

using namespace std;
int t,n,k,x,c;
char mat[3][105];
bool u,m,d,nu,nm,nd,dead;

bool train(char ch)
{
return (ch>='A' && ch<='Z');
}

int main()
{
    scanf("%d",&t);
    while(t--)
    {
        memset(mat,0,sizeof(mat));
        c=0;
        dead=false;
        scanf("%d%d",&n,&k);
        for(x=0;x<3;x++)
        scanf("%s",&mat[x][0]);
        u=mat[0][0]=='s',m=mat[1][0]=='s',d=mat[2][0]=='s';
        while(c<n && !dead)
        {
        nu=false,nm=false,nd=false;
        if(train(mat[0][c+1]))
        u=false;
        if(train(mat[1][c+1]))
        m=false;
        if(train(mat[2][c+1]))
        d=false;
        nu=u||m;
        nm=u||m||d;
        nd=m||d;
        if(train(mat[0][c+1]))
        nu=false;
        if(train(mat[1][c+1]))
        nm=false;
        if(train(mat[2][c+1]))
        nd=false;
        if(train(mat[0][c+2])||train(mat[0][c+3]))
        nu=false;
        if(train(mat[1][c+2])||train(mat[0][c+3]))
        nm=false;
        if(train(mat[2][c+2])||train(mat[0][c+3]))
        nd=false;
        u=nu,m=nm,d=nd;
        dead=!(u||m||d);
        c+=3;
        }
        if(dead)
        printf("NO\n");
        else
        printf("YES\n");
        }
    return 0;
        }


#include<iostream>
#include<cstdlib>
#include<cstdio>//old c library
#include<cmath>//ceil,floor,round,M_PI,,trig,pow(ambigous)
#include<string>//sting c++ library
#include<cstring>//string c library
#include<iomanip>//set precisions
#include <algorithm>//using swap,sort using some function.
#include<fstream>//used to manipulate files.
#include<stack>//stl for stack
#include<queue>//stl fro queue
#include<map>//stl for map key,info asscociated
//#include <boost/multiprecision/cpp_int.hpp>//algerbric operations on string
//namespace mp=boost::multiprecision;

using namespace std;
int t,n,k,x,c;
char mat[3][105];
bool u,m,d,nu,nm,nd,dead;

bool train(char ch)
{
return (ch>=65 && ch<=90);
}

int main()
{
    scanf("%d",&t);
    while(t--)
    {
        c=0;
        dead=false;
        scanf("%d%d",&n,&k);
        for(x=0;x<3;x++)
        scanf("%s",&mat[x][0]);
        u=mat[0][0]=='s',m=mat[1][0]=='s',d=mat[2][0]=='s';
        while(c<n && !dead)
        {
        nu=false,nm=false,nd=false;
        if(train(mat[0][c+1]))
        u=false;
        if(train(mat[1][c+1]))
        m=false;
        if(train(mat[2][c+1]))
        d=false;
        nu=u||m;
        nm=u||m||d;
        nd=m||d;
        if(train(mat[0][c+1]))
        nu=false;
        if(train(mat[1][c+1]))
        nm=false;
        if(train(mat[2][c+1]))
        nd=false;
        if(train(mat[0][c+2])||train(mat[0][c+3]))
        nu=false;
        if(train(mat[1][c+2])||train(mat[1][c+3]))
        nm=false;
        if(train(mat[2][c+2])||train(mat[2][c+3]))
        nd=false;
        u=nu,m=nm,d=nd;
        dead=!(u||m||d);
        c+=3;
        }
        if(dead)
        printf("NO\n");
        else
        printf("YES\n");
        }
    return 0;
        }


#include<iostream>
#include<cstdlib>
#include<cstdio>//old c library
#include<cmath>//ceil,floor,round,M_PI,,trig,pow(ambigous)
#include<string>//sting c++ library
#include<cstring>//string c library
#include<iomanip>//set precisions
#include <algorithm>//using swap,sort using some function.
#include<fstream>//used to manipulate files.
#include<stack>//stl for stack
#include<queue>//stl fro queue
#include<map>//stl for map key,info asscociated
//#include <boost/multiprecision/cpp_int.hpp>//algerbric operations on string
//namespace mp=boost::multiprecision;

using namespace std;
int t,n,k,x,c;
char mat[3][105];
bool u,m,d,nu,nm,nd,dead;

bool train(char ch)
{
return (ch>=65 && ch<=90);
}

int main()
{
    scanf("%d",&t);
    while(t--)
    {
        memset(mat,0,sizeof(mat));
        c=0;
        dead=false;
        scanf("%d%d",&n,&k);
        for(x=0;x<3;x++)
        scanf("%s",&mat[x][0]);
        u=mat[0][0]=='s',m=mat[1][0]=='s',d=mat[2][0]=='s';
        while(c<n && !dead)
        {
        nu=false,nm=false,nd=false;
        if(train(mat[0][c+1]))
        u=false;
        if(train(mat[1][c+1]))
        m=false;
        if(train(mat[2][c+1]))
        d=false;
        nu=u||m;
        nm=u||m||d;
        nd=m||d;
        if(train(mat[0][c+1]))
        nu=false;
        if(train(mat[1][c+1]))
        nm=false;
        if(train(mat[2][c+1]))
        nd=false;
        if(train(mat[0][c+2])||train(mat[0][c+3]))
        nu=false;
        if(train(mat[1][c+2])||train(mat[1][c+3]))
        nm=false;
        if(train(mat[2][c+2])||train(mat[2][c+3]))
        nd=false;
        u=nu,m=nm,d=nd;
        dead=!(u||m||d);
        c+=3;
        }
        if(dead)
        printf("NO\n");
        else
        printf("YES\n");
        }
        return 0;
        }


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<vector>
#include<stack>
#include<string>
using namespace std;
#define lson l,m,x<<1
#define rson m+1,r,x<<1|1

const int INF = 0x3fffffff;
const int dy[3] = { 3, 3, 3 };
const int dx[3] = { 0, 1, -1 };//
const double eps = 1e-8;
const int maxn = 666;

struct NODE {
	int x, y, step;
}st;
int mapn[3][102];
bool vis[3][102];
int n, k;

bool v(NODE a) {
	if (vis[a.x][a.y] == 1) {
		return 0;
	}
	else {
		vis[a.x][a.y] = 1;
		return 1;
	}
}

bool isValid(NODE a, int ud) {
	if (a.x < 0) return 0;
	if (a.x >= 3) return 0;
	if (mapn[a.x][a.y] == 1) return 0;
	if (mapn[a.x][a.y - 1] == 1) return 0;
	if (mapn[a.x][a.y - 2] == 1) return 0;
	//if (mapn[a.x][a.y - 3] == 1) return 0;
	if (ud == 1) {
		if (mapn[a.x - 1][a.y - 2] == 1) return 0;
	}
	if (ud == 2) {
		if (mapn[a.x + 1][a.y - 2] == 1) return 0;
	}
	return 1;
}

int bfs(NODE st) {
	st.step = 0;
	queue<NODE> q;
	q.push(st);
	v(st);
	while (!q.empty()) {
		NODE cur = q.front();
		q.pop();
		if (cur.y >= n - 1) return cur.step;
		for (int i = 0; i < 3; i++) {
			NODE nex = { cur.x + dx[i], cur.y + dy[i], cur.step + 1 };
			if (isValid(nex, i) && v(nex)) {
				q.push(nex);
			}
		}
	}
	return 0;
}

int main() {
	//ios::sync_with_stdio(false);
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	int t;
	cin >> t;
	while (t--) {
		cin >> n >> k;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < n; j++) {
				char ch;
				cin >> ch;
				if (ch == 's') {
					mapn[i][j] = 2;
					st.x = i;
					st.y = j;
				}
				else if (ch == '.') {
					mapn[i][j] = 0;
				}
				else {
					mapn[i][j] = 1;
				}
			}
		}
		memset(vis, 0, sizeof(vis));
		int ans = bfs(st);
		string y = "YES";
		string n = "NO";
		cout << (ans ? y : n) << endl;
		memset(mapn, 0, sizeof(mapn));
	}
	return 0;
}