#include <bits/stdc++.h>
#pragma comment(linker, "/stack:225450978")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long long Mod = 1000000007LL, INF = 1e9, LINF = 1e18;
const long double Pi = 3.141592653589793116, EPS = 1e-9,
                  Gold = ((1 + sqrt(5)) / 2);
long long keymod[] = {1000000007LL, 1000000009LL, 1000000021LL, 1000000033LL};
long long keyCount = sizeof(keymod) / sizeof(long long);
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcountll(s);
}
auto TimeStart = chrono::steady_clock::now();
auto TimeEnd = chrono::steady_clock::now();
void ControlIO(int argc, char* argv[]);
void TimerStart();
void TimerStop();
void Exit();
long long n, k, xs, ys;
vector<vector<char>> a;
void Input() {
  cin >> n >> k;
  a.clear();
  a.resize(3, vector<char>(n, '.'));
  for (long long i = 0; i < 3; i++) {
    for (long long j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] == 's') {
        xs = i;
        ys = j;
      }
    }
  }
}
void Solve() {
  vector<vector<vector<long long>>> vis(
      n + 1, vector<vector<long long>>(3, vector<long long>(n, 0LL)));
  for (long long i = 0; i < 3; i++) {
    for (long long j = 0; j < n; j++) {
      if (a[i][j] == '.' || a[i][j] == 's') continue;
      long long k = j;
      while (k + 1 < n && a[i][k + 1] == a[i][j]) k++;
      for (long long x = 0; x < n + 1; x++) {
        long long y = max(j - 2 * x, 0LL), z = k - 2 * x;
        if (z < 0) break;
        vis[x][i][y]++;
        if (z != n - 1) vis[x][i][z + 1]--;
      }
      j = k;
    }
  }
  for (long long i = 0; i < n + 1; i++) {
    for (long long j = 0; j < 3; j++) {
      for (long long k = 1; k < n; k++) {
        vis[i][j][k] += vis[i][j][k - 1];
      }
    }
  }
  vector<vector<bool>> reachable(3, vector<bool>(n, false));
  reachable[xs][0] = true;
  for (long long i = 1; i < n; i++) {
    if (reachable[0][i - 1] && !vis[i - 1][0][i] && !vis[i][0][i])
      reachable[0][i] = true;
    if (reachable[1][i - 1] && !vis[i - 1][1][i] && !vis[i - 1][0][i] &&
        !vis[i][0][i])
      reachable[0][i] = true;
    if (reachable[0][i - 1] && !vis[i - 1][0][i] && !vis[i - 1][1][i] &&
        !vis[i][1][i])
      reachable[1][i] = true;
    if (reachable[1][i - 1] && !vis[i - 1][1][i] && !vis[i][1][i])
      reachable[1][i] = true;
    if (reachable[2][i - 1] && !vis[i - 1][2][i] && !vis[i - 1][1][i] &&
        !vis[i][1][i])
      reachable[1][i] = true;
    if (reachable[1][i - 1] && !vis[i - 1][1][i] && !vis[i - 1][2][i] &&
        !vis[i][2][i])
      reachable[2][i] = true;
    if (reachable[2][i - 1] && !vis[i - 1][2][i] && !vis[i][2][i])
      reachable[2][i] = true;
    if (!reachable[0][i] && !reachable[1][i] && !reachable[2][i]) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
}
int main(int argc, char* argv[]) {
  ControlIO(argc, argv);
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int T;
  cin >> T;
  TimerStart();
  while (T--) {
    Input();
    Solve();
  }
  TimerStop();
  return 0;
}
void ControlIO(int argc, char* argv[]) {}
void TimerStart() {}
void TimerStop() {}
void Exit() {
  TimerStop();
  exit(0);
}
