#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
const long double eps = 1e-9;
const long double pi = 3.14159265358979323846;
int n, k;
bool ans;
char str[4][200];
int dp[4][200];
queue<pair<int, int> > Q;
int mv[3][2] = {{-1, 1}, {1, 1}, {0, 1}};
int row[30], hd[30], tl[30];
int cnt;
map<char, int> num;
void init() {
  Q = queue<pair<int, int> >();
  for (int i = 0; i < k; i++) row[i] = 5, hd[i] = 200, tl[i] = -200;
  memset(dp, 0, sizeof(dp));
  ans = false;
  cnt = 0;
  num.clear();
}
void input() {
  cin >> n >> k;
  for (int i = 0; i < 3; i++) cin >> str[i];
}
int qn(char ch) {
  if (num.find(ch) == num.end()) num[ch] = cnt++;
  return num[ch];
}
void preDo() {
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < n; j++) {
      if (str[i][j] == 's')
        Q.push(make_pair(i, j));
      else if (str[i][j] != '.') {
        int now = qn(str[i][j]);
        row[now] = i;
        hd[now] = min(hd[now], j);
        tl[now] = max(tl[now], j);
      }
    }
  }
}
bool isTrainCollide(pair<int, int> loc, int tim) {
  for (int i = 0; i < k; i++)
    if (row[i] == loc.first && (hd[i] - 2 * tim) <= loc.second &&
        loc.second <= (tl[i] - 2 * tim))
      return true;
  return false;
}
int main() {
  int tn;
  cin >> tn;
  while (tn--) {
    input();
    init();
    preDo();
    while ((int((Q).size())) && !ans) {
      int tim = Q.front().second;
      pair<int, int> now = Q.front();
      Q.pop();
      for (int i = 0; i < 3; i++) {
        pair<int, int> tar =
            pair<int, int>(now.first + mv[i][0], now.second + mv[i][1]);
        pair<int, int> passMove = make_pair(now.first, now.second + 1);
        bool bombF = false;
        if (tar.first > 2 || tar.first < 0 || tar.second > n) continue;
        if (isTrainCollide(tar, tim) || isTrainCollide(tar, tim + 1) ||
            isTrainCollide(passMove, tim))
          bombF = true;
        if (bombF == false && dp[tar.first][tar.second] == 0) {
          dp[tar.first][tar.second] = 1;
          Q.push(tar);
        }
        if (tar.second >= n) {
          ans = true;
          break;
        }
      }
    }
    printf("%s\n", ans ? "YES" : "NO");
  }
  return 0;
}
