#include using namespace std; using lint=long long; #define rep(i,n) for(int i=0;i>n; vectors(n); vectorcnt(3); set>ss; rep(i,n){ string tmp; char c; lint j; cin>>tmp>>j; c=tmp[0]; j--; if(ss.count(make_pair(j,c))){ assert(0); } ss.emplace(j,c); assert(0<=j&j>t; while(t--)solve(); }