#include<cstdio>
#include<cstring>
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef pair<int,string> P;
int n;
int D[31];
P C[21];
vector<int> d_dat[21];
int main(){
  while(1){
    cin >> n;
    if(!n) break;
    memset(D,0,sizeof(D));
    for(int i=0;i<n;i++){
      d_dat[i].clear();
      string s;
      int m;
      cin >> s >> m;
      for(int j=0;j<m;j++){
	int d;
	cin >> d;
	d_dat[i].push_back(d);
	D[d]++;
      }
      C[i]=P(0,s);
    }
    for(int i=0;i<n;i++){
      for(int j=0;j<(int)d_dat[i].size();j++){
	int p = n-D[d_dat[i][j]]+1;
	C[i].first += p;
      }
      //      cout << C[i].first << " " << C[i].second << "\n";
    }
    sort(C,C+n);
    cout << C[0].first << " " << C[0].second << "\n";
  }
}