#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int t; cin >> t; while (t--) { int n; cin >> n; set sx; set sy; int cx = 0, cy = 0; int px = 0, py = 0; rep(i, 2 * n) { int x, y; char c; cin >> x >> y >> c; if (c == 'x') { cx++; if (sx.contains(y)) { sx.erase(y); px++; } else { sx.insert(y); } } else { cy++; if (sy.contains(x)) { sy.erase(x); py++; } else { sy.insert(x); } } } if (cx > cy) { cout << ((cx - cy) / 2 <= px ? "Yes" : "No") << endl; } else { cout << ((cy - cx) / 2 <= py ? "Yes" : "No") << endl; } } return 0; }