#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int maxN = 1 << 8;
char T[5][maxN];
bool dp[5][maxN];
bool safe(int i, int j, int k) { return !isalpha(T[i][j + k * 2]); }
void solve() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = (1); i < (4); i++)
    fill(&T[i][0], &T[i][maxN], 0), scanf("%s", &T[i][0]);
  for (int s = (1); s < (4); s++) dp[s][0] = T[s][0] == 's';
  for (int j = (1); j < (n); j++)
    for (int i = (1); i < (4); i++) {
      dp[i][j] = false;
      for (int k = (i - 1); k < (i + 2); k++)
        if (dp[k][j - 1] and safe(k, j, j - 1) and safe(i, j, j - 1) and
            safe(i, j, j))
          dp[i][j] = true;
    }
  printf("%s\n", dp[1][n - 1] or dp[2][n - 1] or dp[3][n - 1] ? "YES" : "NO");
}
int main() {
  int t = 1;
  scanf("%d", &t);
  for (int tid = (1); tid < (t + 1); tid++) {
    solve();
  }
  return 0;
}
