#include <bits/stdc++.h>
using namespace std;
struct train {
  int start;
  int finish;
  int row;
  train(int s = 0, int f = 0, int r = 0) {
    start = s;
    finish = f;
    row = r;
  }
};
int columns;
vector<train> trains;
bool solved;
bool visited[101][3][1001];
void dfs(int x, int y, int time = 0) {
  bool canGoNext[101][3];
  memset(canGoNext, true, sizeof(canGoNext));
  visited[x][y][time] = true;
  if (x == columns - 1) solved = true;
  if (solved) return;
  if (time > 1000) return;
  for (int i = 0; i < trains.size(); ++i)
    for (int j = max(0, trains[i].start - time * 2);
         j <= trains[i].finish - time * 2; ++j)
      canGoNext[j][trains[i].row] = false;
  if (!canGoNext[x][y]) return;
  if (!canGoNext[x + 1][y]) return;
  if (y > 0 && !visited[x + 1][y - 1][time + 1] && canGoNext[x + 1][y - 1])
    dfs(x + 1, y - 1, time + 1);
  if (y < 2 && !visited[x + 1][y + 1][time + 1] && canGoNext[x + 1][y + 1])
    dfs(x + 1, y + 1, time + 1);
  if (!visited[x + 1][y][time + 1]) dfs(x + 1, y, time + 1);
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    memset(visited, false, sizeof(visited));
    solved = false;
    int tr;
    scanf("%d%d", &columns, &tr);
    trains.clear();
    char input[3][columns];
    int startColumn;
    for (int i = 0; i < 3; ++i) {
      int length = 0;
      for (int j = 0; j < columns; ++j) {
        scanf(" %c", &input[i][j]);
        if (input[i][j] == 's')
          startColumn = i;
        else if (input[i][j] != '.') {
          length++;
          if (j == columns - 1) {
            trains.push_back(train(j - length + 1, j, i));
            length = 0;
          }
        } else if (length > 0) {
          trains.push_back(train(j - length, j - 1, i));
          length = 0;
        }
      }
    }
    dfs(0, startColumn);
    if (solved)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
