#include <bits/stdc++.h>
using namespace std;
char train[3][200];
bool isTrain(char t) { return 'A' <= t && t <= 'Z'; }
void nextSt(int n) {
  int i;
  for (i = n - 2; i >= 0; i--) {
    if (train[0][i] == 's') {
      if (!isTrain(train[0][i + 1])) train[0][i + 1] = 's';
      train[0][i] = '.';
    }
    if (train[1][i] == 's') {
      if (!isTrain(train[1][i + 1])) train[1][i + 1] = 's';
      train[1][i] = '.';
    }
    if (train[2][i] == 's') {
      if (!isTrain(train[2][i + 1])) train[2][i + 1] = 's';
      train[2][i] = '.';
    }
  }
  for (i = 0; i < n; i++) {
    char t0 = train[0][i];
    char t1 = train[1][i];
    char t2 = train[2][i];
    if (!isTrain(t0) && t1 == 's') train[0][i] = 's';
    if (!isTrain(t1) && (t0 == 's' || t2 == 's')) train[1][i] = 's';
    if (!isTrain(t2) && t1 == 's') train[2][i] = 's';
  }
}
void trainRun(int n) {
  int i;
  for (i = n - 3; i >= 0; i--) {
    if (train[0][i] == 's') {
      if (!isTrain(train[0][i + 2])) train[0][i + 2] = 's';
      train[0][i] = '.';
    }
    if (train[1][i] == 's') {
      if (!isTrain(train[1][i + 2])) train[1][i + 2] = 's';
      train[1][i] = '.';
    }
    if (train[2][i] == 's') {
      if (!isTrain(train[2][i + 2])) train[2][i + 2] = 's';
      train[2][i] = '.';
    }
  }
}
int findAns(int n) {
  int i;
  if (train[0][n - 1] == 's') return 1;
  if (train[1][n - 1] == 's') return 1;
  if (train[2][n - 1] == 's') return 1;
  for (i = 0; i < n; i++) {
    if (train[0][i] == 's') return 0;
    if (train[1][i] == 's') return 0;
    if (train[2][i] == 's') return 0;
  }
  return -1;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, k;
    scanf("%d%d", &n, &k);
    scanf("%s", &train[0]);
    scanf("%s", &train[1]);
    scanf("%s", &train[2]);
    int res = 0, cnt = 0;
    while (res == 0) {
      if (cnt % 2 == 0)
        nextSt(n);
      else
        trainRun(n);
      cnt++;
      res = findAns(n);
    }
    if (res == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
