#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, time;
};
char str[120][120];
int vis[102][102][102], n, m, ck = 0;
void train(int p, int q, int cnt) {
  int time = 0, d = 0;
  for (int j = q; (j + cnt - 1) >= 0; j -= 2) {
    d = 0;
    int lim = cnt;
    if (j < 0) lim = cnt + j;
    for (int k = max(j, 0); d < lim; k++, d++) {
      vis[p][k][time] = 1;
    }
    time++;
  }
}
int level[102][102][102];
void bfs(int i, int j) {
  int v, w, t, a, b, c;
  level[i][j][0] = 1;
  queue<node> q;
  node gr;
  gr.x = i;
  gr.y = j;
  gr.time = 0;
  q.push(gr);
  while (!q.empty()) {
    gr = q.front();
    q.pop();
    v = gr.x;
    w = gr.y;
    if (w == m - 1) {
      ck = 1;
      return;
    }
    for (i = 0; i < 1; i++) {
      a = v + 0;
      b = w + 1;
      t = gr.time + 1;
      if (a >= 0 && a < n && b >= 0 && b < m && vis[a][b][t - 1] == 1) continue;
      if (a >= 0 && a < n && b >= 0 && b < m && vis[a][b][t] == 0 &&
          vis[a][b][t - 1] == 0 && level[a][b][t] == 0) {
        node pr;
        pr.x = a;
        pr.y = b;
        pr.time = t;
        level[a][b][t] = 1;
        q.push(pr);
      }
      c = a - 1;
      if (c >= 0 && c < n && b >= 0 && b < m && vis[c][b][t] == 0 &&
          vis[c][b][t - 1] == 0 && level[c][b][t] == 0) {
        node pr;
        pr.x = c;
        pr.y = b;
        pr.time = t;
        level[c][b][t] = 1;
        q.push(pr);
      }
      c = a + 1;
      if (c >= 0 && c < n && b >= 0 && b < m && vis[c][b][t] == 0 &&
          vis[c][b][t - 1] == 0 && level[c][b][t] == 0) {
        node pr;
        pr.x = c;
        pr.y = b;
        pr.time = t;
        level[c][b][t] = 1;
        q.push(pr);
      }
    }
  }
}
int main() {
  int i, j, k, l, test;
  scanf("%d", &test);
  while (test--) {
    cin >> m >> k;
    n = 3;
    ck = 0;
    memset(level, 0, sizeof level);
    memset(vis, 0, sizeof vis);
    for (i = 0; i < 3; i++) {
      scanf("%s", str[i]);
    }
    for (i = 0; i < 3; i++) {
      for (j = 0; j < m; j++) {
        if (str[i][j] != 's' && str[i][j] != '.') {
          int cnt = 0;
          for (k = j; str[i][k]; k++) {
            if (str[i][j] != str[i][k]) break;
            cnt++;
          }
          train(i, j, cnt);
        }
      }
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (str[i][j] == 's') {
          bfs(i, j);
        }
      }
    }
    if (ck == 0)
      printf("NO\n");
    else
      printf("YES\n");
  }
}
