#include<cstdio>
#include<cstring>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	for(int n;scanf("%d",&n),n;){
		int pt[30]={};
		rep(i,30) pt[i]=n+1;

		char name[20][11];
		int m[20],d[20][30];
		rep(i,n){
			scanf("%s%d",name[i],m+i);
			rep(j,m[i]){
				scanf("%d",d[i]+j);
				pt[d[i][j]]--;
			}
		}

		int ans,ians;
		rep(i,n){
			int sum=0;
			rep(j,m[i]) sum+=pt[d[i][j]];
			if(i==0 || ans>sum || ans==sum && strcmp(name[ians],name[i])>0){
				ans=sum;
				ians=i;
			}
		}
		printf("%d %s\n",ans,name[ians]);
	}

	return 0;
}