#include <bits/stdc++.h>
using namespace std;
int n, k;
string field[3];
bool vis[3][103];
int dr[3] = {-1, 0, 1};
bool dfs(int r, int c) {
  vis[r][c] = true;
  if (c >= n - 1) {
    return true;
  } else {
    bool ans = false;
    for (int i = 0; i < 3; i++) {
      int nr = r + dr[i];
      if (0 <= nr && nr < 3 && !vis[nr][c + 3] &&
          (c + 1 >= n || field[r][c + 1] == '.') &&
          (c + 1 >= n || field[nr][c + 1] == '.') &&
          (c + 2 >= n || field[nr][c + 2] == '.') &&
          (c + 3 >= n || field[nr][c + 3] == '.')) {
        ans |= dfs(r + dr[i], c + 3);
      }
    }
    return ans;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> n >> k;
    int r, c;
    for (int i = 0; i < 3; i++) {
      cin >> field[i];
      for (int j = 0; j < n; j++) {
        if (field[i][j] == 's') {
          r = i, c = j;
          field[i][j] = '.';
        }
      }
    }
    memset(vis, false, sizeof vis);
    cout << (dfs(r, c) ? "YES" : "NO") << endl;
  }
  return 0;
}
