#include <bits/stdc++.h>
using namespace std;
string s[3];
int h = 3, w;
struct Point {
  int i, j;
  Point(int i, int j) {
    this->i = i;
    this->j = j;
  }
};
vector<Point> pos;
bool bfs(vector<Point> pos) {
  while (pos.size() > 0) {
    int cs = pos.size();
    for (int i = 0; i < cs; i++) {
      char cp = s[pos[i].i][pos[i].j];
      char np = s[pos[i].i][pos[i].j + 1];
      if (pos[i].j >= w - 1 && cp == '.') {
        return true;
      } else if (cp != '.' || np != '.') {
      } else {
        s[pos[i].i][pos[i].j] = '$';
        Point cp = pos[i];
        if (cp.i - 1 >= 0 && s[cp.i - 1][cp.j + 1] == '.') {
          Point np(cp.i - 1, cp.j + 3);
          if (s[cp.i - 1][cp.j + 1] == s[cp.i - 1][cp.j + 2]) pos.push_back(np);
        }
        if (cp.i + 1 < h && s[cp.i + 1][cp.j + 1] == '.') {
          Point np(cp.i + 1, cp.j + 3);
          if (s[cp.i + 1][cp.j + 1] == s[cp.i + 1][cp.j + 2]) pos.push_back(np);
        }
        Point np(cp.i, cp.j + 3);
        if (s[cp.i][cp.j + 1] == s[cp.i][cp.j + 2]) pos.push_back(np);
      }
    }
    for (int i = 0; i < cs; i++) {
      pos.erase(pos.begin());
    }
  }
  return false;
}
int main() {
  int t;
  std::ios::sync_with_stdio(false);
  cin >> t;
  int k;
  for (int i = 0; i < t; i++) {
    cin >> w >> k;
    cin >> s[0] >> s[1] >> s[2];
    for (int x = 0; x < h; x++) {
      s[x] += "..";
    }
    pos.clear();
    for (int x = 0; x < h; x++)
      for (int y = 0; y < w; y++)
        if (s[x][y] == 's') {
          s[x][y] = '.';
          Point p(x, y);
          pos.push_back(p);
        }
    string r = bfs(pos) ? "YES" : "NO";
    cout << r << endl;
  }
}
