#include using namespace std; using Int=long long; using Real=long double; templateinline bool chmin(T&A,S B){return(A>B?A=B,1:0);} templateinline bool chmax(T&A,S B){return(Amp; string S; void sol() { cin>>N; REP(i,N) { cin>>S>>C; mp[S]=C; } for(auto e:mp)++ans[e.second]; REP(i,8)cout<>T; while(T--)sol(); }