#include <bits/stdc++.h>
using namespace std;
bool deb = false;
const int N = 100011;
int n, k;
char a[4][N];
bool ok = 0;
bool vs[4][N];
void dfs(int x, int y) {
  if (x >= 1 && x <= 4 && y >= n) {
    ok = 1;
    return;
  }
  if (x < 1 || x > 4 || y > n || y < 1) return;
  if (vs[x][y] || a[x][y + 1] != '.') return;
  vs[x][y] = 1;
  if (a[x - 1][y + 1] == '.' && a[x - 1][y + 2] == '.' &&
      a[x - 1][y + 3] == '.')
    dfs(x - 1, y + 3);
  if (a[x + 1][y + 1] == '.' && a[x + 1][y + 2] == '.' &&
      a[x + 1][y + 3] == '.')
    dfs(x + 1, y + 3);
  if (a[x][y + 2] == '.' && a[x][y + 3] == '.') dfs(x, y + 3);
}
int main() {
  int testcase;
  scanf("%d", &testcase);
  while (testcase--) {
    ok = 0;
    scanf("%d", &n), scanf("%d", &k);
    for (int i = 0; i < 4; ++i) {
      for (int j = 0; j < n + 4; ++j) vs[i][j] = 0, a[i][j] = '\0';
    }
    for (int i = 1; i < 4; ++i) scanf("%s", a[i] + 1);
    for (int i = 1; i < 4; ++i) {
      a[i][n + 1] = '.', a[i][n + 3] = '.', a[i][n + 2] = '.';
    }
    for (int i = 1; i < 4; ++i) {
      for (int j = 1; j < n + 1; ++j) {
        if (a[i][j] == 's') dfs(i, j);
      }
    }
    if (!ok)
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
