#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
const int INF = 1e9 + 9;
struct train {
  int L, id, start;
  train(int a, int b, int c) : id(a), start(b), L(c) {}
};
int pos(int start, int ti) { return start - ti * 2; }
vector<train> all;
int n, K;
int dp[3][105][105];
int solve(int x, int y, int t) {
  if (y == n - 1) return 1;
  if (dp[x][y][t] != -1) return dp[x][y][t];
  int nx, tx;
  for (int j = 0; j < K; j++) {
    if (all[j].id != x) continue;
    if (pos(all[j].start, t) <= y + 1 &&
        y + 1 <= pos(all[j].start, t) + all[j].L)
      return false;
  }
  for (int i = -1; i < 2; i++) {
    nx = x + i;
    if (nx < 0 || nx > 2) continue;
    int c = 0;
    for (int j = 0; j < K; j++) {
      if (all[j].id != nx) {
        c++;
        continue;
      }
      if (pos(all[j].start, t) <= y + 1 &&
          y + 1 <= pos(all[j].start, t) + all[j].L)
        break;
      if (pos(all[j].start, t + 1) <= y + 1 &&
          y + 1 <= pos(all[j].start, t + 1) + all[j].L)
        break;
      c++;
    }
    if (c == K)
      if (solve(nx, y + 1, t + 1) == 1) return dp[x][y][t] = 1;
  }
  return dp[x][y][t] = 0;
}
int main() {
  int T;
  cin >> T;
  string s;
  int a, b, c;
  while (T--) {
    cin >> n >> K;
    all.clear();
    int x = -1, y = 0;
    for (int i = 0; i < 3; i++) {
      cin >> s;
      if (s[0] == 's') x = i;
      for (int j = 0; j < n; j++) {
        if (s[j] >= 'A' && s[j] <= 'Z') {
          a = i;
          b = j;
          c = 0;
          while (s[j] == s[b] && j < n) c++, j++;
          all.push_back(train(a, b, c - 1));
          j--;
        }
      }
    }
    memset(dp, -1, sizeof dp);
    if (solve(x, y, 0))
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
