#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, m;
bool flag, vis[4][N];
char s[4][N];
inline void OK() {
  puts("YES");
  flag = true;
}
inline void bfs(int start) {
  memset(vis, 0, sizeof vis);
  queue<pair<int, int> > q;
  q.push(make_pair(start, 0));
  vis[start][0] = 1;
  while (!q.empty()) {
    pair<int, int> u = q.front(), now;
    q.pop();
    if (u.second >= n - 1) {
      OK();
      return;
    }
    for (int i = -1; i <= 1; i++) {
      now.first = u.first + i;
      now.second = u.second + 1;
      if (now.first < 0 || now.first > 2) continue;
      if (now.second < n && s[u.first][now.second] != '.') continue;
      if ((now.second >= n || s[now.first][now.second] == '.') &&
          (now.second + 1 >= n || s[now.first][now.second + 1] == '.') &&
          (now.second + 2 >= n || s[now.first][now.second + 2] == '.')) {
        now.second += 2;
        if (!vis[now.first][now.second]) {
          vis[now.first][now.second] = 1;
          q.push(now);
        }
      }
    }
  }
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &n, &m);
    int st;
    for (int i = 0; i < 3; i++) {
      scanf("%s", s[i]);
      if (s[i][0] == 's') st = i;
    }
    flag = false;
    bfs(st);
    if (!flag) puts("NO");
  }
  return 0;
}
