#include <bits/stdc++.h>
using namespace std;
char a[1005][1005];
pair<int, int> S[1005 * 1005];
int n, k, T, dd[4][1005], ok[4][1005];
bool Check(int x, int y) { return x >= 1 && x <= 3 && y >= 1 && y <= n + 2; }
void Solve() {
  memset(dd, 0, sizeof(dd));
  pair<int, int> b;
  cin >> n >> k;
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (a[i][j] == 's') {
        b = make_pair(i, j);
        a[i][j] = '.';
      }
      ok[i][j] = (a[i][j] == '.');
    }
    a[i][n + 1] = a[i][n + 2] = '.';
    ok[i][n + 1] = ok[i][n + 2] = 1;
  }
  int d = 1, c = 0;
  S[++c] = b;
  while (d <= c) {
    pair<int, int> p = S[d];
    d++;
    int x = p.first;
    int y = p.second;
    if (y >= n) {
      cout << "YES" << endl;
      return;
    }
    if (dd[x][y]) continue;
    dd[x][y] = 1;
    if (Check(x, y + 3) && ok[x][y + 1] && ok[x][y + 2] && ok[x][y + 3])
      S[++c] = make_pair(x, y + 3);
    if (Check(x + 1, y + 3) && ok[x][y + 1] && ok[x + 1][y + 1] &&
        ok[x + 1][y + 2] && ok[x + 1][y + 3])
      S[++c] = make_pair(x + 1, y + 3);
    if (Check(x - 1, y + 3) && ok[x][y + 1] && ok[x - 1][y + 1] &&
        ok[x - 1][y + 2] && ok[x - 1][y + 3])
      S[++c] = make_pair(x - 1, y + 3);
  }
  cout << "NO" << endl;
}
int main() {
  cin >> T;
  while (T--) Solve();
}
