#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char a[5][105];
int t, n, k, cnt, hsh[256], len[30], X[30], Y[30], ban[105][5][105], dp[5][105];
int main() {
  t = read();
  while (t--) {
    memset(hsh, 0, sizeof(hsh));
    memset(dp, 0, sizeof(dp));
    memset(ban, 0, sizeof(ban));
    cnt = 0;
    int pos;
    n = read(), k = read();
    for (int i = 1; i <= 3; i++) gets(a[i] + 1);
    for (int i = 1; i <= 3; i++)
      if (a[i][1] == 's') dp[i][1] = 1, pos = i;
    for (int i = 1; i <= 3; i++)
      for (int j = 1; j <= n; j++)
        if (a[i][j] != 's' && a[i][j] != '.') {
          if (hsh[a[i][j]])
            len[hsh[a[i][j]]]++;
          else
            hsh[a[i][j]] = ++cnt, X[cnt] = i, Y[cnt] = j, len[cnt] = 1;
        }
    bool ok = 0;
    for (int i = 1; i < n; i++)
      for (int j = 1; j <= k; j++) {
        for (int h = Y[j] - 3; h < Y[j] + len[j]; h++)
          if (h > 0) ban[i][X[j]][h] = 1;
        if (i == 1 && X[j] == pos && Y[j] == 2) ok = 1;
        Y[j] -= 2;
      }
    if (ok) {
      puts("NO");
      continue;
    }
    for (int i = 1; i < n; i++)
      for (int j = 1; j <= 3; j++)
        if (dp[j][i])
          for (int h = -1; h <= 1; h++) {
            int tx = j + h, ty = i + 1;
            if (tx == 0 || tx == 4) continue;
            if (ban[i][tx][ty]) continue;
            dp[tx][ty] = 1;
          }
    bool flag = 0;
    for (int i = 1; i <= 3; i++)
      if (dp[i][n]) flag = 1;
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
