#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int T, n, k, vis[10][1000], flag, bx, by, visit[10][1000];
struct que {
  int x, y, t;
} q[N];
int dx[4] = {0, 0, 1, -1};
void bfs() {
  q[1] = {bx, by, by};
  for (int head = 1, tail = 1; head <= tail; head++) {
    int x = q[head].x, y = q[head].y + 1, t = q[head].t;
    if (y >= n) {
      flag = 1;
      return;
    }
    if (vis[x][y] || vis[x][y - 1]) continue;
    for (int i = 1; i <= 3; i++) {
      int X = x + dx[i];
      if (vis[X][y] || vis[X][y + 1] || vis[X][y + 2]) continue;
      if (X > 3 || X < 1) continue;
      if (visit[X][y + 2]) continue;
      visit[X][y + 2] = 1;
      q[++tail] = {X, y + 2, t + 1};
    }
  }
}
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d\n", &n, &k);
    flag = 0;
    memset(vis, 0, sizeof(vis));
    memset(visit, 0, sizeof(visit));
    for (int i = 1; i <= 3; i++) {
      for (int j = 1; j <= n; j++) {
        char c = getchar();
        if (c >= 'A' && c <= 'Z') vis[i][j] = 1;
        if (c == 's') {
          bx = i;
          by = j;
        }
      }
      getchar();
    }
    bfs();
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
