#include <bits/stdc++.h>
using namespace std;

int n;
vector<int> v[31];
pair<int, string> ch[20];

int main()
{
	while (scanf("%d", &n), n){
		for (int i = 0; i <= 30; i++) v[i].clear();
		for (int i = 0; i < n; i++) ch[i].first = 0;
		for (int i = 0; i < n; i++){
			cin >> ch[i].second;
			int m;
			scanf("%d", &m);
			while (m--){
				int d;
				scanf("%d", &d);
				v[d].push_back(i);
			}
		}
		for (int i = 0; i <= 30; i++){
			for (int j = 0; j < v[i].size(); j++){
				ch[v[i][j]].first += n - v[i].size() + 1;
			}
		}
		sort(ch, ch + n);
		cout << ch[0].first << " " << ch[0].second << endl;
	}
}