#include <bits/stdc++.h>
using namespace std;
int n, m, f, vis[101][101][101];
char a[1001][1001];
int valid(int x, int y) { return (x >= 1 && x <= n && y >= 1 && y <= m); }
int occupies(int x, int y, int turn) {
  y = y + (turn - 1) * 2;
  if (valid(x, y) && a[x][y] >= 'A' && a[x][y] <= 'Z') return 1;
  return 0;
}
void dfs(int curx, int cury, int turn) {
  if (cury == m) {
    f = 1;
    return;
  }
  if (vis[curx][cury][turn]) return;
  if (occupies(curx, cury, turn)) return;
  vis[curx][cury][turn] = 1;
  if (!occupies(curx, cury + 1, turn)) {
    if (valid(curx, cury + 1) && !occupies(curx, cury + 1, turn))
      dfs(curx, cury + 1, turn + 1);
    if (valid(curx - 1, cury + 1) && !occupies(curx - 1, cury + 1, turn))
      dfs(curx - 1, cury + 1, turn + 1);
    if (valid(curx + 1, cury + 1) && !occupies(curx + 1, cury + 1, turn))
      dfs(curx + 1, cury + 1, turn + 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(0);
  ;
  int i, j, t, sx, sy, temp;
  string st;
  cin >> t;
  while (t--) {
    memset(vis, 0, sizeof vis);
    cin >> m >> temp;
    n = 3;
    for (i = 1; i <= n; i++) {
      cin >> st;
      st = " " + st;
      for (j = 1; j <= m; j++) {
        a[i][j] = st[j];
        if (a[i][j] == 's') {
          sx = i;
          sy = j;
        }
      }
    }
    f = 0;
    dfs(sx, sy, 1);
    if (f)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
