#include <bits/stdc++.h>
using namespace std;
int t, n, k, sx, sy, go[3] = {0, -1, 1};
char s[4][200];
bool flag, vis[4][200];
bool bfs() {
  queue<pair<int, int> > q;
  memset(vis, false, sizeof(vis));
  vis[sx][sy] = true;
  q.push(make_pair(sx, sy));
  while (!q.empty()) {
    pair<int, int> t = q.front();
    q.pop();
    int x = t.first, y = t.second;
    if (y >= n) return true;
    for (int i = -1; i <= 1; i++) {
      int xx = x + i, yy = y + 3;
      if (xx < 1 || xx > 3 || yy > n + 2) continue;
      if (s[x][y + 1] >= 'A' || s[xx][y + 1] >= 'A' || s[xx][y + 2] >= 'A' ||
          s[xx][yy] >= 'A')
        continue;
      if (vis[xx][yy] == false) {
        vis[xx][yy] = true;
        q.push(make_pair(xx, yy));
      }
    }
  }
  return false;
}
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d", &n, &k);
    sx = sy = 0;
    for (int i = 1; i <= 3; i++) {
      scanf("%s", s[i] + 1);
      if (!sx) {
        for (int j = 1; j <= n; j++)
          if (s[i][j] == 's') sx = i, sy = j;
      }
    }
    if (!bfs())
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
