#include <bits/stdc++.h>
using namespace std;
int tests, trn, col, rows = 3, bgr, bgcol;
bool endit = false;
vector<string> grid;
map<int, set<int>> trains;
bool d[100][100][100];
bool round() {
  for (int i = 0; i < rows; i++) {
    for (int j = 0; j < col; j++) {
      if (grid[i][j] == 's')
        bgr = i, bgcol = j;
      else if (grid[i][j] == '.')
        ;
      else {
        trains[i].insert(j);
      }
    }
  }
  for (int j = 0; j < col; j++) {
    bool all = true;
    for (int i = 0; i < rows; i++) {
      if (grid[i][j] == '.' || grid[i][j] == 's') all = false;
    }
    if (all) return true;
  }
  return false;
}
bool check(int r, int c, int time) { return (trains[r].count(c + 2 * time)); }
void solve(int r, int c, int time) {
  if (d[r][c][time])
    return;
  else
    d[r][c][time] = true;
  if (c == col - 1) endit = true;
  if (!endit && c + 1 < col && r + 1 < rows && !check(r, c + 1, time - 1) &&
      !check(r + 1, c + 1, time - 1) && !check(r + 1, c + 1, time))
    solve(r + 1, c + 1, time + 1);
  if (!endit && c + 1 < col && r - 1 >= 0 && !check(r, c + 1, time - 1) &&
      !check(r - 1, c + 1, time - 1) && !check(r - 1, c + 1, time))
    solve(r - 1, c + 1, time + 1);
  if (!endit && c + 1 < col && !check(r, c + 1, time - 1) &&
      !check(r, c + 1, time))
    solve(r, c + 1, time + 1);
}
void test() {
  grid.clear();
  trains.clear();
  endit = false;
  cin >> col >> trn;
  for (int i = 0; i < rows; i++) {
    string st;
    cin >> st;
    grid.push_back(st);
  }
  for (int i = 0; i < 100; i++)
    for (int j = 0; j < 100; j++)
      for (int k = 0; k < 100; k++) d[i][j][k] = false;
  if (round()) {
    cout << "NO" << endl;
    return;
  }
  solve(bgr, bgcol, 1);
  if (endit)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  cin >> tests;
  for (int i = 0; i < tests; i++) test();
}
