#include <bits/stdc++.h>
using namespace std;
const int maxtime = 410;
const int maxrow = 4;
const int maxcol = 110;
int vis[maxtime][maxrow][maxcol];
char str[maxrow][maxcol];
bool maze[maxtime][maxrow][maxcol];
bool times[maxtime];
int n = 4, m, k;
int sx, sy;
struct node {
  int time, x, y;
  node(int _time, int _x, int _y) : time(_time), x(_x), y(_y) {}
  node& operator=(const node& tmp) {
    time = tmp.time;
    x = tmp.x;
    y = tmp.y;
    return *this;
  }
};
int dx[4] = {-1, 1, 0}, dy[4] = {0, 0, 0};
queue<node> q;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    while (!q.empty()) q.pop();
    scanf("%d%d", &m, &k);
    memset(vis, 0, sizeof(vis));
    memset(times, false, sizeof(times));
    times[0] = true;
    for (int i = 1; i <= 3; i++) {
      scanf("%s", str[i] + 1);
      for (int j = 1; j <= m; j++) {
        if (str[i][j] == '.') {
          maze[0][i][j] = false;
        } else if (str[i][j] == 's') {
          sx = i, sy = j;
          maze[0][i][j] = false;
        } else {
          maze[0][i][j] = true;
        }
      }
    }
    vis[0][sx][sy] = 1;
    bool isok = 0;
    q.push(node(0, sx, sy));
    while (!q.empty()) {
      node tmp = q.front();
      q.pop();
      if (tmp.y == m) {
        isok = true;
        break;
      }
      if (times[tmp.time + 1] == false) {
        for (int i = 1; i <= 3; i++) {
          for (int j = 1; j <= m - 2; j++) {
            maze[tmp.time + 1][i][j] = maze[tmp.time][i][j + 2];
          }
          maze[tmp.time + 1][i][m - 1] = false;
          maze[tmp.time + 1][i][m] = false;
        }
        times[tmp.time + 1] = true;
      }
      int kx = tmp.x, ky = tmp.y + 1;
      if (!(kx > 0 && kx <= 3 && ky > 0 && ky <= m &&
            !maze[tmp.time][kx][ky])) {
        continue;
      }
      for (int i = 0; i < 3; i++) {
        int nx = kx + dx[i], ny = ky + dy[i];
        if (nx > 0 && nx <= 3 && ny > 0 && ny <= m && !maze[tmp.time][nx][ny] &&
            !maze[tmp.time + 1][nx][ny] && !vis[tmp.time + 1][nx][ny]) {
          vis[tmp.time + 1][nx][ny] = true;
          q.push(node(tmp.time + 1, nx, ny));
        }
      }
    }
    if (isok)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
