#include using namespace std; int n,m,k,l,s,t,r; string pa,pb; int pp[100][100]; int vis[100]; vectorp[100]; vectorans; int main() { ios::sync_with_stdio(false); int T; cin>>T; while (T--) { memset(pp,0, sizeof(pp)); for(int i=0;i<100;i++) p[i].clear(); cin>>n>>m; for(int _=1;_<=n;_++) { cin>>pa; cin>>pb; for(int i=0;i