#include <bits/stdc++.h>
using namespace std;
bool found;
void doDFS(pair<int, int> status, vector<vector<string>> &states, int n,
           vector<vector<bool>> &visited) {
  if (status.first > n - 1 or found) return;
  vector<string> current = states[status.first];
  if (current[status.second][status.first] != '.') return;
  if (status.first == n - 1) {
    found = true;
    return;
  }
  if (current[status.second][status.first + 1] == '.') {
    if (!visited[status.second][status.first + 1] and
        (status.first + 2 > n - 1 or
         current[status.second][status.first + 2] == '.')) {
      visited[status.second][status.first + 1] = true;
      doDFS({status.first + 1, status.second}, states, n, visited);
    }
    if (status.second + 1 < 3 and
        current[status.second + 1][status.first + 1] == '.' and
        (status.first + 2 > n - 1 or
         current[status.second + 1][status.first + 2] == '.') and
        !visited[status.second + 1][status.first + 1]) {
      visited[status.second + 1][status.first + 1] = true;
      doDFS({status.first + 1, status.second + 1}, states, n, visited);
    }
    if (status.second - 1 >= 0 and
        current[status.second - 1][status.first + 1] == '.' and
        (status.first + 2 > n - 1 or
         current[status.second - 1][status.first + 2] == '.') and
        !visited[status.second - 1][status.first + 1]) {
      visited[status.second - 1][status.first + 1] = true;
      doDFS({status.first + 1, status.second - 1}, states, n, visited);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    found = false;
    int n, k;
    pair<int, int> currentPos = {0, 0};
    cin >> n >> k;
    vector<vector<string>> states(n, vector<string>(3));
    vector<vector<bool>> visited(3, vector<bool>(n, false));
    for (int i = 0; i < 3; i++) {
      cin >> states[0][i];
      if (states[0][i][0] == 's') {
        currentPos.second = i;
        states[0][i][0] = '.';
      }
    }
    for (int i = 1; i < n; i++)
      for (int j = 0; j < 3; j++) {
        states[i][j] = states[i - 1][j].substr(2);
        states[i][j] += "..";
      }
    doDFS(currentPos, states, n, visited);
    cout << (found ? "YES\n" : "NO\n");
  }
  return 0;
}
