#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
using namespace std;

int n;
pair<int, string> p[20];
vector<int> v[30];

int main() {
  while(cin >> n && n) {
    for(int i = 0; i < 30; ++i) v[i].clear();
    for(int i = 0; i < n; ++i) {
      int m;
      cin >> p[i].second >> m;
      p[i].first = 0;
      for(int j = 0; j < m; ++j) {
	int d;
	cin >> d;
	v[d].push_back(i);
      }
    }

    for(int i = 0; i < 30; ++i) {
      for(int j = 0; j < v[i].size(); ++j) {
	if(v[i].size() == n) p[v[i][j]].first += 1;
	else p[v[i][j]].first += n+1-v[i].size();
      }
    }
    sort(p, p+n);
    cout << p[0].first << " " << p[0].second << endl;
  }
  return 0;
}