#include <bits/stdc++.h>
using namespace std;
int N, M;
int st, dr, res;
string s[1010];
int viz[1010][1010];
int dy[] = {-1, 0, 1};
int isBad(int x, int y) {
  if (y >= s[1].size()) return 0;
  if (s[x][y] == '.' || s[x][y] == 's') {
    return 0;
  }
  return 1;
}
int valid(int x, int xz, int y) {
  if (x <= 0 || x > 3) {
    return 0;
  }
  if (viz[x][y] == 1) return 0;
  if (isBad(x, y + 2 * (y - 1)) || isBad(xz, y + 2 * (y - 1))) {
    return 0;
  }
  if (isBad(x, y + 2 * y) || isBad(x, y + 2 * y - 1)) {
    return 0;
  }
  return 1;
}
void dfs(int x, int y) {
  if (y >= N) return;
  viz[x][y] = 1;
  for (int i = 0; i < 3; ++i) {
    if (valid(x + dy[i], x, y + 1)) {
      dfs(x + dy[i], y + 1);
    }
  }
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    cin >> N >> M;
    for (int i = 1; i <= 3; ++i) {
      cin >> s[i];
    }
    for (int i = 0; i <= 4; ++i) {
      for (int j = 1; j <= s[1].size() + 100; ++j) {
        viz[i][j] = 0;
      }
    }
    int start = 0;
    for (int i = 1; i <= 3; ++i)
      if (s[i][0] == 's') {
        start = i;
      }
    dfs(start, 0);
    --N;
    int ret = viz[1][N] || viz[2][N] || viz[0][N];
    if (ret == 1) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
}
