#include <bits/stdc++.h>
using namespace std;
const int maxn = 1100;
const long long inf = 1e18;
char mp[5][maxn];
int n;
struct node {
  int x, y;
};
bool bfs(int x) {
  queue<node> q;
  q.push({x, 1});
  mp[x][1] = '1';
  while (!q.empty()) {
    node p = q.front();
    q.pop();
    p.y++;
    if (p.y >= n) return 1;
    if (mp[p.x][p.y] >= 'A' && mp[p.x][p.y] <= 'Z') continue;
    for (int i = -1; i <= 1; i++) {
      int nowx = p.x + i;
      if (1 > nowx || 3 < nowx) continue;
      if ((mp[nowx][p.y] >= 'A' && mp[nowx][p.y] <= 'Z') ||
          mp[nowx][p.y] == '1' ||
          (mp[nowx][p.y + 1] >= 'A' && mp[nowx][p.y + 1] <= 'Z') ||
          mp[nowx][p.y + 1] == '1' ||
          (mp[nowx][p.y + 2] >= 'A' && mp[nowx][p.y + 2] <= 'Z') ||
          mp[nowx][p.y + 2] == '1')
        continue;
      int nowy = p.y + 2;
      if (nowy >= n) return 1;
      mp[nowx][nowy] = '1';
      q.push({nowx, nowy});
    }
  }
  return 0;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int k;
    scanf("%d%d", &n, &k);
    for (int i = 1; i <= 3; i++) scanf("%s", mp[i] + 1);
    int sx;
    for (int i = 1; i <= 3; i++) {
      if (mp[i][1] == 's') sx = i;
    }
    if (bfs(sx))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
