#include <bits/stdc++.h>
int main() {
  int c, j, i, t, n, k, a[4][101], kt, j1;
  char s[101];
  scanf("%d", &t);
  for (c = 0; c < t; c++) {
    scanf("%d%d%*c", &n, &k);
    for (i = 1; i <= 3; i++) {
      gets(s);
      for (j = 1; j <= n; j++)
        if (s[j - 1] == 's')
          a[i][j] = 1;
        else if (s[j - 1] == '.')
          a[i][j] = 0;
        else
          a[i][j] = 2;
    }
    kt = 1;
    for (j = 1; j <= n - 1; j++) {
      if ((a[1][j] != 1) && (a[2][j] != 1) && (a[3][j] != 1)) {
        kt = 0;
        break;
      }
      if (a[1][j] == 1) {
        if ((a[2][j + 1] < 2) && (a[1][j + 1] < 2)) a[2][j + 1] = 1;
        if (a[1][j + 1] < 2) a[1][j + 1] = 1;
      }
      if (a[3][j] == 1) {
        if ((a[2][j + 1] < 2) && (a[3][j + 1] < 2)) a[2][j + 1] = 1;
        if (a[3][j + 1] < 2) a[3][j + 1] = 1;
      }
      if (a[2][j] == 1) {
        if ((a[2][j + 1] < 2) && (a[3][j + 1] < 2)) a[3][j + 1] = 1;
        if ((a[1][j + 1] < 2) && (a[2][j + 1] < 2)) a[1][j + 1] = 1;
        if (a[2][j + 1] < 2) a[2][j + 1] = 1;
      }
      for (i = 1; i <= 3; i++)
        for (j1 = 1; j1 <= n; j1++)
          if (a[i][j1] == 2) {
            a[i][j1] = 0;
            if (j1 > 1) a[i][j1 - 1] = 0;
            if (j1 > 2) a[i][j1 - 2] = 2;
          }
    }
    if ((a[1][n] != 1) && (a[2][n] != 1) && (a[3][n] != 1)) kt = 0;
    if (kt == 0)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
