#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(T p, T e) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
int toInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int toLlint(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int dx[] = {0, 1, -1};
int ts, kk = 1;
char s[3][105];
int n, m;
int vs[3][105];
bool bfs() {
  kk++;
  queue<pair<int, int> > q;
  if (s[0][0] == 's')
    q.push(pair<int, int>(0, 0));
  else if (s[1][0] == 's')
    q.push(pair<int, int>(1, 0));
  else if (s[2][0] == 's')
    q.push(pair<int, int>(2, 0));
  int u, v, i, nu, nv;
  while (!q.empty()) {
    u = q.front().first;
    v = q.front().second;
    q.pop();
    if (v >= n - 1) return 1;
    if (v > 0) {
      v++;
      if (v < n && s[u][v] != '.') continue;
      if (v >= n - 1) return 1;
      v++;
      if (v < n && s[u][v] != '.') continue;
      if (v >= n - 1) return 1;
    }
    for (i = 0; i < 3; i++) {
      nu = u + dx[i];
      nv = v + 1;
      if (nu > 2 || nu < 0 || s[nu][nv] != '.' || vs[nu][nv] == kk) continue;
      if (s[u][nv] != '.') continue;
      vs[nu][nv] = kk;
      q.push(pair<int, int>(nu, nv));
    }
  }
  return 0;
}
int main() {
  int t, i, j, k;
  scanf("%d", &ts);
  while (ts--) {
    scanf("%d %d %s %s %s", &n, &m, s[0], s[1], s[2]);
    if (bfs())
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
