#include <bits/stdc++.h>
using namespace std;
string R[5];
int n, k;
void solve() {
  for (int i = 1; i < n; i++) {
    if (i % 3 == 1) {
      for (int j = 1; j < 4; j++) {
        if (R[j][i - 1] == 's' && R[j][i] == '.') {
          R[j][i] = 's';
        }
      }
      for (int j = 1; j < 4; j++) {
        if (R[j][i] == 's') continue;
        if ((R[j - 1][i] == 's' || R[j + 1][i] == 's') && R[j][i] == '.') {
          R[j][i] = '`';
        }
      }
      for (int j = 1; j < 4; j++) {
        if (R[j][i] == '`') R[j][i] = 's';
      }
    } else {
      for (int j = 1; j < 4; j++) {
        if (R[j][i - 1] == 's' && R[j][i] == '.') {
          R[j][i] = 's';
        }
      }
      i++;
      if (i == n) break;
      for (int j = 1; j < 4; j++) {
        if (R[j][i - 1] == 's' && R[j][i] == '.') {
          R[j][i] = 's';
        }
      }
    }
  }
  bool ff = false;
  for (int i = 0; i < 4; i++) {
    if (R[i][n - 1] == 's') {
      ff = true;
    }
  }
  if (ff) {
    puts("YES");
  } else {
    puts("NO");
  }
}
int main(int argc, char const *argv[]) {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    cin >> n >> k;
    cin >> R[1];
    cin >> R[2];
    cin >> R[3];
    R[0] = R[1];
    R[4] = R[1];
    for (int i = 0; i < n; i++) {
      R[0][i] = R[4][i] = '#';
    }
    solve();
  }
  return 0;
}
