#include <bits/stdc++.h>
using namespace std;
int num[110];
int w;
int se(char str[][110], int i, int js, int je);
int main() {
  int n, t, p, l = 0;
  char str[5][110];
  scanf("%d", &n);
  while (n--) {
    w = 0;
    scanf("%d %d", &t, &p);
    getchar();
    for (int i = 1; i <= 3; i++) {
      scanf("%s", str[i]);
      if (str[i][0] == 's') l = i;
    }
    int k = 1, nu[110];
    for (int i = 1; i < 4; i++) {
      nu[i] = 0;
    }
    nu[l] = l;
    int m, j = 1, q = 0;
    if (str[l][k] != '.')
      printf("NO\n");
    else {
      while (1) {
        if (j + 3 >= t) {
          m = t - 1;
        } else {
          m = j + 3;
        }
        for (int i = 1; i < 4; i++) {
          if (nu[i] == 1) {
            if (se(str, i, j, m) == 1) {
              nu[1] = 1;
            } else
              nu[1] = 0;
            if (se(str, i + 1, j, m) == 1) {
              nu[2] = 2;
            }
          } else if (nu[i] == 2) {
            if (se(str, i - 1, j, m) == 1) {
              nu[1] = 1;
            } else
              nu[1] = 0;
            if (se(str, i, j, m) == 1) {
              nu[2] = 2;
            } else
              nu[2] = 0;
            if (se(str, i + 1, j, m) == 1) {
              nu[3] = 3;
            }
          } else if (nu[i] == 3) {
            if (se(str, i - 1, j, m) == 1) {
              nu[2] = 2;
            } else
              nu[2] = 0;
            if (se(str, i, j, m) == 1) {
              nu[3] = 3;
            } else
              nu[3] = 0;
          }
        }
        j = m;
        if (j == t - 1) break;
      }
      if (j == t - 1) {
        if (nu[1] == 1 || nu[2] == 2 || nu[3] == 3)
          printf("YES\n");
        else
          printf("NO\n");
      } else
        printf("NO\n");
    }
  }
  return 0;
}
int se(char str[][110], int i, int js, int je) {
  for (int k = js; k <= je; k++) {
    if (str[i][k] != '.') return 0;
  }
  return 1;
}
