#include <bits/stdc++.h>
using namespace std;
struct tint {
  int start, row, end;
} train[210000];
int n, m, t, i, j, sz, ix, iy;
int x[210000], y[210000];
int l, r;
bool used[200][200];
int d[200][200];
char a[200][200];
void add(int i, int x, int y) {
  if (train[i].start == 0) {
    train[i].start = y;
    train[i].row = x;
  }
  train[i].end = y;
}
int ADD[7] = {0, -1, 1};
bool valid(int u, int v, int t) {
  if (u && v && u <= 3 && v <= n) {
    for (int i = 1; i <= sz; i++)
      if (train[i].row == u) {
        if (max(0, train[i].start - t * 2) <= v &&
            v <= max(0, train[i].end - t * 2))
          return false;
      }
    return true;
  }
  return false;
}
string bfs(int ix, int iy) {
  l = r = 1;
  for (int i = 1; i <= 3; i++)
    for (int j = 1; j <= n; j++) d[i][j] = 1000000000, used[i][j] = false;
  x[l] = ix;
  y[l] = iy;
  d[ix][iy] = 0;
  used[ix][iy] = true;
  while (l <= r) {
    if (valid(x[l], y[l] + 1, d[x[l]][y[l]]))
      for (int i = 2; i < 3; i++)
        for (int j = 0; j < 3; j++) {
          int u = x[l] + ADD[j];
          int v = y[l] + ADD[i];
          if (valid(u, v, d[x[l]][y[l]]) && valid(u, v, d[x[l]][y[l]] + 1) &&
              d[u][v] > d[x[l]][y[l]] + 1 && !used[u][v]) {
            r++;
            x[r] = u;
            y[r] = v;
            d[u][v] = d[x[l]][y[l]] + 1;
            used[u][v] = true;
          }
        }
    l++;
  }
  for (int i = 1; i <= 3; i++)
    if (d[i][n] != 1000000000) return "YES";
  return "NO";
}
void clear() {
  for (int i = 1; i <= sz; i++) {
    train[i].start = train[i].end = train[i].row = 0;
  }
}
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> m;
    for (i = 1; i <= 3; i++)
      for (j = 1; j <= n; j++) {
        cin >> a[i][j];
        if (a[i][j] == 's') ix = i, iy = j;
      }
    sz = 1;
    for (i = 1; i <= 3; i++)
      for (j = 1; j <= n; j++)
        if (a[i][j] != '.' && a[i][j] != 's') {
          if (a[i][j] == a[i][j + 1])
            add(sz, i, j);
          else {
            add(sz, i, j);
            ++sz;
          }
        }
    sz--;
    cout << bfs(ix, iy) << endl;
    clear();
  }
  return 0;
}
