#include <bits/stdc++.h>
using namespace std;
bool canbein[200][4];
struct train {
  int line;
  int st;
  int en;
  train() { st = 500; }
};
string s[3];
vector<train> data;
int main() {
  int n;
  cin >> n;
  for (int t = 0; t < n; ++t) {
    int c, k;
    cin >> c >> k;
    data.assign(26, train());
    k = 26;
    for (int i = 0; i <= c; ++i)
      canbein[i][0] = canbein[i][1] = canbein[i][2] = false;
    cin >> s[0] >> s[1] >> s[2];
    int stx = -1, sty = -1;
    for (int i = 0; i < 3; ++i) {
      for (int j = 0; j < c; ++j) {
        if (s[i][j] == 's') {
          stx = i;
          sty = j;
        } else if (s[i][j] >= 'A' && s[i][j] <= 'Z') {
          data[s[i][j] - 'A'].line = i;
          data[s[i][j] - 'A'].st = min(j, data[s[i][j] - 'A'].st);
          data[s[i][j] - 'A'].en = j;
        }
      }
    }
    canbein[sty][stx] = true;
    int shift = 0;
    for (int i = sty; i < c; ++i) {
      for (int j = 0; j < 3; ++j) {
        if (canbein[i][j]) {
          bool next = true;
          for (int p = 0; p < k; ++p) {
            if (data[p].line == j) {
              int st = data[p].st;
              int en = data[p].en;
              if (i + 1 >= st - shift * 2 && i + 1 <= en - shift * 2)
                next = false;
            }
          }
          if (next) {
            if (j - 1 >= 0) {
              bool next1 = true;
              for (int p = 0; p < k; ++p) {
                if (data[p].line == j - 1) {
                  int st = data[p].st;
                  int en = data[p].en;
                  if (i + 1 >= st - shift * 2 && i + 1 <= en - shift * 2 ||
                      i + 1 >= st - shift * 2 - 1 &&
                          i + 1 <= en - shift * 2 - 1 ||
                      i + 1 >= st - shift * 2 - 2 &&
                          i + 1 <= en - shift * 2 - 2)
                    next1 = false;
                }
              }
              if (next1) canbein[i + 1][j - 1] = true;
            }
            bool next2 = true;
            for (int p = 0; p < k; ++p) {
              if (data[p].line == j) {
                int st = data[p].st;
                int en = data[p].en;
                if (i + 1 >= st - shift * 2 - 1 &&
                        i + 1 <= en - shift * 2 - 1 ||
                    i + 1 >= st - shift * 2 - 2 && i + 1 <= en - shift * 2 - 2)
                  next2 = false;
              }
            }
            if (next2) canbein[i + 1][j] = true;
            if (j + 1 <= 2) {
              bool next3 = true;
              for (int p = 0; p < k; ++p) {
                if (data[p].line == j + 1) {
                  int st = data[p].st;
                  int en = data[p].en;
                  if (i + 1 >= st - shift * 2 && i + 1 <= en - shift * 2 ||
                      i + 1 >= st - shift * 2 - 1 &&
                          i + 1 <= en - shift * 2 - 1 ||
                      i + 1 >= st - shift * 2 - 2 &&
                          i + 1 <= en - shift * 2 - 2)
                    next3 = false;
                }
              }
              if (next3) canbein[i + 1][j + 1] = true;
            }
          }
        }
      }
      ++shift;
    }
    bool ans = false;
    for (int i = 0; i < 3; ++i)
      if (canbein[c][i]) ans = true;
    if (ans)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
