#include <bits/stdc++.h>
using namespace std;
typedef struct node_t {
  int x, y, t;
  node_t() {}
  node_t(int x_, int y_, int t_) : x(x_), y(y_), t(t_) {}
} node_t;
const int maxn = 105;
char s[3][maxn];
int n = 3, m;
bool visit[3][maxn][105];
int dx[3] = {0, -1, 1};
int sx, sy = 0;
bool judge(int x, int y) { return x < 0 || x >= n || y < 0 || y >= m; }
bool bfs() {
  queue<node_t> Q;
  node_t nd, d;
  int x, y, t;
  memset(visit, false, sizeof(visit));
  visit[sx][sy][0] = true;
  Q.push(node_t(sx, sy, 0));
  while (!Q.empty()) {
    nd = Q.front();
    Q.pop();
    t = nd.t + 1;
    x = nd.x;
    y = nd.y + 1;
    if (y >= m) return true;
    if (s[x][y] != '.') continue;
    for (int k = 0; k < 3; ++k) {
      x = nd.x + dx[k];
      if (x < 0 || x >= n || s[x][y] != '.') continue;
      if (y + 1 >= m) return true;
      if (s[x][y + 1] != '.') continue;
      if (y + 2 >= m) return true;
      if (s[x][y + 2] != '.') continue;
      if (!visit[x][y + 2][t]) {
        visit[x][y + 2][t] = true;
        Q.push(node_t(x, y + 2, t));
      }
    }
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  int t, k_;
  scanf("%d", &t);
  while (t--) {
    scanf("%d %d", &m, &k_);
    for (int i = 0; i < 3; ++i) {
      scanf("%s", s[i]);
      if (s[i][0] == 's') {
        sx = i;
        s[i][0] = '.';
      }
    }
    puts(bfs() ? "YES" : "NO");
  }
  return 0;
}
