#include <bits/stdc++.h>
using namespace std;
int t;
bool reachable[3][100][4];
bool bd[3][100];
int n, k;
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> k;
    k = -100;
    memset(reachable, 0, sizeof(reachable));
    char cc;
    for (int i = 0; i < 3; i++)
      for (int c = 0; c < n; c++) {
        cin >> cc;
        int q;
        if (cc >= 'A' && cc <= 'Z')
          q = 0;
        else
          q = 1;
        if (cc == 's') reachable[i][c][0] = true;
        bd[i][c] = q;
      }
    for (int j = 0; j < n - 1; j++)
      for (int move = 0; move < 4; move++)
        for (int i = 0; i < 3; i++) {
          if (!reachable[i][j][move]) continue;
          if (move == 1) {
            if (i > 0 && bd[i - 1][j]) reachable[i - 1][j][2] = true;
            if (i < 2 && bd[i + 1][j]) reachable[i + 1][j][2] = true;
            reachable[i][j][2] = true;
          } else if (bd[i][j + 1])
            reachable[i][j + 1][(move + 1) % 4] = true;
        }
    bool yes = false;
    for (int i = 0; i < 3; i++)
      for (int move = 0; move < 4; move++)
        if (reachable[i][n - 1][move]) yes = true;
    cout << (yes ? "YES" : "NO") << endl;
  }
  return 0;
}
