#include <bits/stdc++.h>
using namespace std;
int test;
int n, k;
char str[3][111];
bool dp[3][111];
bool ok(int a, int b) {
  char x = str[a][b];
  if (x >= 'A' && x <= 'Z') return 0;
  return 1;
}
void mv(int row, int col, int d) {
  if (row + d < 0 || row + d >= 3) return;
  ++col;
  if (!ok(row, col)) return;
  row += d;
  if (!ok(row, col)) return;
  ++col;
  if (!ok(row, col)) return;
  ++col;
  if (!ok(row, col)) return;
  dp[row][col] = 1;
}
int main() {
  cin >> test;
  while (test--) {
    memset(str, 0, sizeof(str));
    memset(dp, 0, sizeof(dp));
    cin >> n >> k;
    for (int i = 0; i < (3); ++i) cin >> str[i];
    for (int i = 0; i < (3); ++i)
      if (str[i][0] == 's') dp[i][0] = 1;
    for (int col = 0; col < (n); ++col)
      for (int row = 0; row < (3); ++row)
        if (dp[row][col]) {
          for (int t = (-1); t <= (1); ++t) mv(row, col, t);
        }
    bool flag = 0;
    for (int col = (n - 1); col <= (n + 3); ++col)
      for (int row = 0; row < (3); ++row)
        if (dp[row][col]) flag = 1;
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
}
