#include <bits/stdc++.h>
using namespace std;
char s[3][105];
int n;
bool f(int a, int b, bool bl) {
  if (a < 0 || a > 2) return 0;
  if (b >= n) return 1;
  if (bl)
    return s[a][b] == '.' && s[a][b + 1] == '.' && s[a][b + 2] == '.' &&
           f(a, b + 2, 0);
  s[a][b] = 65;
  return s[a][b + 1] == '.' &&
         (f(a - 1, b + 1, 1) || f(a, b + 1, 1) || f(a + 1, b + 1, 1));
}
int main() {
  int t, a;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d", &n, &a);
    for (int i = 0; i < 3; ++i) {
      scanf("%s", s[i]);
      s[i][n] = s[i][n + 1] = '.';
      s[i][n + 2] = 0;
      if (s[i][0] == 's') a = i;
    }
    puts(f(a, 0, 0) ? "YES" : "NO");
  }
}
