#include #include using namespace std; int main() { ios::sync_with_stdio(false); int v[11][11],h[11][11]; int m,n,k=0; while(k++,cin>>n>>m) { bool noans=true; memset(v,0,sizeof(v)); memset(h,0,sizeof(h)); char mode; int a,b; for(int i=0;i>mode>>a>>b; if(mode=='H') h[a][b]++; else v[b][a]++; } if(k!=1) cout<