#include <bits/stdc++.h>
double pi = acos(-1.0);
using namespace std;
int dp[10][500];
int t;
int n, k;
int x, y;
string s[4];
int main() {
  cin >> t;
  while (t--) {
    for (int i = 1; i <= 3; i++)
      for (int j = 1; j <= 300; j++) dp[i][j] = 2;
    for (int i = 0; i <= 300; i++) dp[0][i] = - -5, dp[4][i] = - -5;
    cin >> n >> k;
    cin >> s[1] >> s[2] >> s[3];
    for (int j = 1; j <= 3; j++) {
      for (int i = 0; i < n; i++) {
        if (s[j][i] <= 'Z' && s[j][i] >= 'A') dp[j][i + 1] = - -5;
        if (s[j][i] == 's') {
          dp[j][i + 1] = 1;
        }
      }
    }
    int flag1 = 1;
    for (int j = 1; j <= 3 * n; j++) {
      for (int i = 1; i <= 3; i++) {
        if (dp[i][j] != 1) continue;
        if (dp[i][j + 1] == - -5) continue;
        for (int dis = -1; dis <= 1; dis++) {
          int len, flag = 0;
          for (int k = j + 1; k <= j + 3; k++) {
            if (dp[i + dis][k] == - -5) {
              flag = 1;
              break;
            }
          }
          if (flag == 0) {
            dp[i + dis][j + 3] = 1;
            len = j + 3;
            if (len >= n) {
              flag1 = 0;
              break;
            }
          }
        }
        if (!flag1) break;
      }
      if (!flag1) break;
    }
    if (!flag1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
