#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) {
  if (a > b)
    return a;
  else
    return b;
}
long long int min(long long int a, long long int b) {
  if (a < b)
    return a;
  else
    return b;
}
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
int XX[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int YY[] = {-1, 0, 1, -1, 1, -1, 0, 1};
map<pair<long long int, long long int>, set<long long int> > mpp;
char arr[3][105];
long long int n, k;
long long int dp[105][105][105];
bool func(long long int row, long long int col, long long int count) {
  if (col == n - 1) return 1;
  if (dp[row][col][count] != -1) return dp[row][col][count];
  long long int maxi = 0;
  if (mpp[make_pair(row, col + 1)].find(count) ==
      mpp[make_pair(row, col + 1)].end()) {
    if (mpp[make_pair(row, col + 1)].find(count + 1) ==
        mpp[make_pair(row, col + 1)].end()) {
      if (func(row, col + 1, count + 1)) {
        return true;
      }
    }
    if (row - 1 >= 0 &&
        mpp[make_pair(row - 1, col + 1)].find(count + 1) ==
            mpp[make_pair(row - 1, col + 1)].end() &&
        mpp[make_pair(row - 1, col + 1)].find(count) ==
            mpp[make_pair(row - 1, col + 1)].end()) {
      if (func(row - 1, col + 1, count + 1)) {
        return true;
      }
    }
    if (row + 1 < 3 &&
        mpp[make_pair(row + 1, col + 1)].find(count + 1) ==
            mpp[make_pair(row + 1, col + 1)].end() &&
        mpp[make_pair(row + 1, col + 1)].find(count) ==
            mpp[make_pair(row + 1, col + 1)].end()) {
      if (func(row + 1, col + 1, count + 1)) {
        return true;
      }
    }
  }
  return dp[row][col][count] = false;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int i, j, t, l, r, d, w, a, b, c, v, x1, x2, y1, y2, h, u, x, y;
  cin >> t;
  while (t--) {
    memset(dp, -1, sizeof(dp));
    mpp.clear();
    cin >> n >> k;
    long long int row = -1, col = -1;
    for (i = 0; i < 3; i++) {
      for (j = 0; j < n; j++) {
        cin >> arr[i][j];
        if (arr[i][j] == 's') {
          row = i;
          col = j;
        }
      }
    }
    for (i = 0; i < 3; i++) {
      for (j = 0; j < n;) {
        if (arr[i][j] != '.' && arr[i][j] != 's') {
          char ch = arr[i][j];
          long long int start = j, end;
          while (j < n && arr[i][j] == ch) j++;
          end = j - 1;
          long long int count = 0;
          while (end >= 0) {
            for (l = max(start, 0); l <= end; l++) {
              mpp[make_pair(i, l)].insert(count);
            }
            count++;
            start -= 2;
            end -= 2;
          }
        } else
          j++;
      }
    }
    long long int ans = func(row, col, 0);
    if (ans == 1) {
      cout << "YES"
           << "\n";
    } else
      cout << "NO"
           << "\n";
  }
}
