#include #define All(x) x.begin(),x.end() #define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); using namespace std; using ll=long long; void solve(){ int n; cin>>n; map mpx,mpy; for(int i=1;i<=2*n;++i){ int x,y; char ch; cin>>x>>y>>ch; if(ch=='x'){ mpx[y]++; } else{ mpy[x]++; } } int smx=0,smy=0,tx=0,ty=0; for(auto &[y,t]:mpx) smx+=t/2,tx+=t; for(auto &[x,t]:mpy) smy+=t/2,ty+=t; if(txty) cout<<"No\n"; else cout<<"Yes\n"; } signed main(){ IOS int T=1; cin>>T; while(T--){ solve(); } }