ll@N,@K,@Q,i,c,d,M=0,m;string A[Q*6],s;rep(Q){ll@t;if(t<2)rd(s),A[M++]=s;else{i=c=0;m=M;rep(6){rd(s,d);if(OR[j,max(m-N,0),m](A[j]==s))d