#include <bits/stdc++.h>
using namespace std;
inline string get_string() {
  char ch[1000000];
  scanf("%s", ch);
  return ch;
}
inline int get_Int() {
  int x;
  scanf("%d", &x);
  return x;
}
inline string get_String() {
  string x;
  cin >> x;
  return x;
}
inline long long get_long() {
  long long x;
  cin >> x;
  return x;
}
vector<string> Position(3);
void solve() {
  int n, k;
  scanf("%d %d", &n, &k);
  bool condition = true;
  for (int i = 0; i < 3; i++) {
    cin >> Position[i];
    if (Position[i][0] == 's') Position[i][0] = '1';
    for (int j = 1; j < n; j++)
      if (Position[i][j] != '.') Position[i][j] = '0';
  }
  bool canGo = false;
  while (condition && canGo == false) {
    condition = false;
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < n - 1; j++) {
        if (Position[i][j] == '1') {
          condition = true;
          i = 5;
          break;
        }
      }
    }
    int Index = -1;
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < n; j++) {
        if ((Position[i][j] == '1' && Index == -1) ||
            (j == Index && Position[i][j] == '1')) {
          if (Index == -1) Index = j;
          if (j == n - 1) {
            canGo = true;
            i = 5;
            break;
          }
          Position[i][j] = '.';
          for (int NextRow = 0; NextRow < 3; NextRow++) {
            if (Position[NextRow][j + 1] != '0' && abs(NextRow - i) <= 1) {
              if (NextRow < i && Position[i][j + 1] == '0') continue;
              if (NextRow > i && Position[i][j + 1] == '0') continue;
              Position[NextRow][j + 1] = '1';
            }
          }
        }
      }
    }
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < n; j++) {
        if (Position[i][j] == '0') {
          Position[i][j] = '.';
          if (j >= 2) Position[i][j - 2] = '0';
        }
      }
    }
  }
  if (canGo)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) solve();
}
