#include <bits/stdc++.h>
using namespace std;
int n, k;
char g[3][101];
bool vis[3][100];
vector<pair<int, int> > tr;
vector<int> row;
bool DFS(int r, int c, int t) {
  for (int i = 0; i < tr.size(); ++i) {
    int s = tr[i].first - 2 * t;
    int e = s + tr[i].second - 1;
    if (r == row[i] && c >= s && c <= e) return false;
  }
  if (c == n - 1) return true;
  if (vis[r][c]) return false;
  vis[r][c] = true;
  bool q[3] = {};
  for (int i = 0; i < tr.size(); ++i) {
    int s = tr[i].first - 2 * t;
    int e = s + tr[i].second - 1;
    if (c + 1 >= s && c + 1 <= e) q[row[i]] = true;
  }
  for (int i = -1; i <= 1; ++i)
    if (r + i >= 0 && r + i < 3 && !q[r + i] && !q[r] &&
        DFS(r + i, c + 1, t + 1))
      return true;
  return false;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d", &n, &k);
    for (int i = 0; i < 3; ++i) scanf("%s", g[i]);
    tr.clear();
    int q[26] = {};
    int at[26] = {};
    int len[26] = {};
    memset(q, -1, sizeof(q));
    int sr, sc;
    row.clear();
    for (int i = 0; i < 3; ++i) {
      for (int j = 0; j < n; ++j)
        if (g[i][j] != '.' && g[i][j] != 's') {
          if (q[g[i][j] - 'A'] == -1) q[g[i][j] - 'A'] = j;
          at[g[i][j] - 'A'] = i;
          ++len[g[i][j] - 'A'];
        } else if (g[i][j] == 's') {
          sr = i;
          sc = j;
          g[i][j] = '.';
        }
    }
    for (int i = 0; i < 26; ++i)
      if (q[i] != -1) {
        tr.push_back(make_pair(q[i], len[i]));
        row.push_back(at[i]);
      }
    memset(vis, 0, sizeof(vis));
    if (DFS(sr, sc, 0))
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
