#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
int T, n, m;
int vis[MAXN][MAXN];
char s[5][MAXN];
void debug() {
  printf("*****************\n");
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < n; j++) {
      printf("%d ", vis[i][j]);
    }
    printf("\n");
  }
}
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &n, &m);
    memset(vis, 0, sizeof(vis));
    set<pair<int, int> > ans[2];
    for (int i = 0; i < 3; i++) {
      scanf("%s", s[i]);
      for (int j = 0; j < n; j++) {
        if (s[i][j] == 's') {
          ans[0].insert(make_pair(i, j));
          continue;
        }
        if (isalpha(s[i][j])) vis[i][j] = 1;
      }
    }
    int ok = 0, pre, cur = 0;
    while (1) {
      cur ^= 1;
      pre = 1 - cur;
      ans[cur].clear();
      for (set<pair<int, int> >::iterator it = ans[pre].begin();
           it != ans[pre].end(); it++) {
        pair<int, int> tmp = (*it);
        int x = tmp.first, y = tmp.second + 1;
        if (y >= n) {
          ok = 1;
          break;
        }
        if (vis[x][y]) continue;
        ans[cur].insert(make_pair(x, y));
        if (x - 1 >= 0 && !vis[x - 1][y]) {
          ans[cur].insert(make_pair(x - 1, y));
        }
        if (x + 1 < 3 && !vis[x + 1][y]) {
          ans[cur].insert(make_pair(x + 1, y));
        }
      }
      if (ok == 1) break;
      for (int i = 0; i < 3; i++) {
        for (int j = 0; j < n; j++) {
          if (vis[i][j]) {
            if (j - 2 >= 0) vis[i][j - 2] = 1;
            vis[i][j] = 0;
          }
        }
      }
      set<pair<int, int> > wrong;
      for (set<pair<int, int> >::iterator it = ans[cur].begin();
           it != ans[cur].end(); it++) {
        pair<int, int> tmp = (*it);
        int x = tmp.first, y = tmp.second;
        if (vis[x][y]) {
          wrong.insert(tmp);
        }
      }
      for (set<pair<int, int> >::iterator it = wrong.begin(); it != wrong.end();
           it++) {
        pair<int, int> tmp = (*it);
        ans[cur].erase(tmp);
      }
      if (ans[cur].size() == 0) {
        ok = 0;
        break;
      }
    }
    if (ok)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
