#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 29;
const int mod = (int)1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1.0);
int n, m, k;
char a[4][110];
bool check(int i, int j) {
  if (i < 1 || i > 3) return false;
  if (j > n) return true;
  if (a[i][j] != '.') return false;
  return true;
}
int dp[4][110];
int main() {
  int t;
  cin >> t;
  while (t--) {
    scanf("%d%d\n", &n, &k);
    for (int i = 1; i <= 3; i++) {
      gets(a[i] + 1);
      for (int j = n + 1; j <= 108; j++) a[i][j] = '.';
    }
    memset(dp, 0, sizeof dp);
    for (int i = 1; i <= 3; i++)
      if (a[i][1] == 's') dp[i][1] = 1;
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= 3; j++)
        if (dp[j][i] && check(j, i + 1)) {
          for (int k = -1; k <= 1; k++) {
            if (check(j + k, i + 1) && check(j + k, i + 2) &&
                check(j + k, i + 3))
              dp[j + k][i + 3] = 1;
          }
        }
    bool flag = false;
    for (int i = 1; i <= 3; i++)
      for (int j = 1; j <= 4; j++)
        if (dp[i][n + j]) flag = true;
    puts(flag ? "YES" : "NO");
  }
  return 0;
}
