#include <bits/stdc++.h>
using namespace std;
char g[4][111];
int n, k, T;
int check(int row, int col) { return col > k || g[row][col] == '.'; }
bool vis[4][111];
bool dfs(int row, int col) {
  vis[row][col] = true;
  if (col >= k) {
    puts("YES");
    return true;
  }
  for (int i = -1; i <= 1; i++)
    if (g[row][col + 1] == '.' && row + i >= 1 && row + i <= 3 &&
        check(row + i, col + 1) && check(row + i, col + 2) &&
        check(row + i, col + 3)) {
      if (!vis[row + i][col + 3] && dfs(row + i, col + 3)) return true;
    }
  return false;
}
int main() {
  scanf("%d", &T);
  for (int i = 1; i <= T; i++) {
    memset(vis, 0, sizeof(vis));
    scanf("%d %d", &k, &n);
    for (int j = 1; j <= 3; j++) scanf("%s", g[j] + 1);
    for (int j = 1; j <= 3; j++)
      if (g[j][1] == 's' && !dfs(j, 1)) puts("NO");
  }
  return 0;
}
