#include <bits/stdc++.h>
using namespace std;
char str[3][105];
bool dp[3][105];
bool ok(int i, int j) { return !(str[i][j] >= 'A' && str[i][j] <= 'Z'); }
bool move(int i, int j, int d) {
  if (i + d > -1 && i + d < 3) {
    return ok(i, j + 1) && ok(i + d, j + 1) && ok(i + d, j + 2) &&
           ok(i + d, j + 3);
  }
  return false;
}
bool solve(int i, int j, int n) {
  if (!dp[i][j]) return dp[i][j];
  bool ret = false;
  if (j >= n) return 1;
  for (int d = -1; d < 2; d++) {
    if (move(i, j, d)) {
      ret = solve(i + d, j + 3, n);
    }
    if (ret) return ret;
  }
  dp[i][j] = false;
}
int main() {
  int x;
  scanf("%d", &x);
  int start = -1;
  while (--x >= 0) {
    int n, k;
    scanf("%d %d", &n, &k);
    memset(str, 0, sizeof(str));
    memset(dp, true, sizeof(dp));
    for (int a = 0; a < 3; a++) {
      scanf("%s", &str[a]);
      if (str[a][0] == 's') {
        start = a;
      }
    }
    bool ret = solve(start, 0, n);
    if (ret) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
