#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500;
bool vis[3][MAXN];
char g[3][MAXN];
pair<int, int> que[MAXN * 3];
int n, k;
inline void init() {
  memset(g, 0, sizeof(g));
  memset(vis, false, sizeof(vis));
  scanf("%d%d", &n, &k);
  for (int i = 0; i < 3; i++) scanf("%s", g[i]);
}
inline bool BFS() {
  int begin = 0, end = 0;
  for (int i = 0; i < 3; i++)
    if (g[i][0] == 's') que[end++] = pair<int, int>(i, 0);
  while (begin != end) {
    int ux = que[begin].first, uy = que[begin].second;
    begin++;
    if (uy >= n) return true;
    if (!isupper(g[ux][uy + 1])) {
      if (ux + 1 < 3 && !vis[ux + 1][uy + 3] && !isupper(g[ux + 1][uy + 1]) &&
          !isupper(g[ux + 1][uy + 2]) && !isupper(g[ux + 1][uy + 3]))
        que[end++] = pair<int, int>(ux + 1, uy + 3), vis[ux + 1][uy + 3] = true;
      if (ux - 1 >= 0 && !vis[ux - 1][uy + 3] && !isupper(g[ux - 1][uy + 1]) &&
          !isupper(g[ux - 1][uy + 2]) && !isupper(g[ux - 1][uy + 3]))
        que[end++] = pair<int, int>(ux - 1, uy + 3), vis[ux - 1][uy + 3] = true;
      if (!vis[ux][uy + 3] && !isupper(g[ux][uy + 2]) &&
          !isupper(g[ux][uy + 3]))
        que[end++] = pair<int, int>(ux, uy + 3), vis[ux][uy + 3] = true;
    }
  }
  return false;
}
int main(void) {
  int t;
  scanf("%d", &t);
  while (t--) {
    init();
    printf("%s\n", BFS() ? "YES" : "NO");
  }
  return 0;
}
