#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, INF = 0x3f3f3f3f, MOD = 1e9 + 7;
int n, k, sx;
char a[5][105];
bool bfs(int sx) {
  queue<pair<int, int> > q;
  q.push(pair<int, int>(sx, 1));
  while (q.size()) {
    int x = q.front().first, y = q.front().second;
    q.pop();
    if (isalpha(a[x][++y])) continue;
    if (y >= n) return true;
    for (int i = -1; i <= 1; ++i) {
      int nx = x + i;
      if (nx < 1 || nx > 3) continue;
      if (isalpha(a[nx][y]) || isalpha(a[nx][y + 1]) || isalpha(a[nx][y + 2]) ||
          a[nx][y + 2] == 1)
        continue;
      int ny = y + 2;
      if (ny >= n) return true;
      a[nx][ny] = 1;
      q.push(pair<int, int>(nx, ny));
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d", &n, &k);
    memset(a, 0, sizeof a);
    for (int i = 1; i <= 3; ++i) {
      scanf("%s", a[i] + 1);
      if (a[i][1] == 's') sx = i;
    }
    puts(bfs(sx) ? "YES" : "NO");
  }
  return 0;
}
