#include <bits/stdc++.h>
using namespace std;
bool dp[3][110];
char s[3][110];
char tmp[3][110];
bool judge(char now) {
  if (now >= 'A' && now <= 'Z') return true;
  return false;
}
int main() {
  int test;
  scanf("%d", &test);
  while (test--) {
    int len, K;
    scanf("%d%d", &len, &K);
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i < 3; i++) {
      scanf("%s", s[i]);
      if (s[i][0] == 's') dp[i][0] = true;
    }
    for (int i = 0; i < len; i++) {
      for (int j = 0; j < 3; j++) {
        if (dp[j][i]) {
          if (judge(s[j][i]) || judge(s[j][i + 1])) {
            dp[j][i] = false;
            continue;
          }
          if (j - 1 >= 0 && !judge(s[j - 1][i + 1]) &&
              !judge(s[j - 1][i + 2]) && !judge(s[j - 1][i + 3])) {
            dp[j - 1][i + 1] = true;
          }
          if (j + 1 < 3 && !judge(s[j + 1][i + 1]) && !judge(s[j + 1][i + 2]) &&
              !judge(s[j + 1][i + 3])) {
            dp[j + 1][i + 1] = true;
          }
          if (!judge(s[j][i + 1]) && !judge(s[j][i + 2]) &&
              !judge(s[j][i + 3])) {
            dp[j][i + 1] = true;
          }
        }
      }
      for (int j = 0; j < 3; j++) {
        for (int k = 0; k < len; k++) {
          tmp[j][k] = '.';
        }
      }
      for (int j = 0; j < 3; j++) {
        for (int k = 2; k < len; k++) {
          tmp[j][k - 2] = s[j][k];
        }
      }
      for (int j = 0; j < 3; j++) {
        for (int k = 0; k < len; k++) {
          s[j][k] = tmp[j][k];
        }
      }
    }
    if (dp[0][len] || dp[1][len] || dp[2][len])
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
