#include #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; void solve() { int n; cin >> n; n *= 2; map cnt1, cnt2; int tot1 = 0, tot2 = 0; rep(i, n) { int x, y; char c; cin >> x >> y >> c; if (c == 'x') { ++tot1; ++cnt1[y]; } else { ++tot2; ++cnt2[x]; } } int ox = 0, oy = 0; for (auto& p : cnt1) { if (p.second&1) ++ox; } for (auto& p : cnt2) { if (p.second&1) ++oy; } if (max(ox, oy) <= min(tot1, tot2)) puts("Yes"); else puts("No"); } int main() { int t; cin >> t; while (t--) solve(); return 0; }