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