#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define pb push_back 
#define fr first
#define sc second
#define Rep(i,n) for(int i=0;i<(n);i++)
#define All(v) v.begin(),v.end()
#define Uniq(v) v.erase(unique(All(v)),v.end())
typedef pair<int, int> Pii; 
typedef pair<int, Pii> Pip;
typedef pair<string, int> Psi;
const int INF = (1<<30);
const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};
typedef pair<string, vector<int> > Psv;
typedef pair<int, string> Pis;

int main()
{
  int n;
  while( cin >> n, n ) {
    int times[31] = {0};
    Psv p[21];
    Rep(i, n) {
      string name; cin >> name;
      int d;
      vector<int> v;
      cin >> d;
      Rep(j, d) {
	int a; cin >> a;
	times[a]++;
	v.pb( a );
      }
      p[i] = Psv(name, v); 
    }

    vector<Pis> v2;
    Rep(i, n) {
      int sum = 0;
      vector<int> tmp = p[i].sc;
      Rep(j, tmp.size()) {
	sum += n - times[tmp[j]] + 1;
      }
      v2.pb( Pis(sum, p[i].fr) );
    }

    sort( All(v2) );
    cout << v2[0].fr << " " << v2[0].sc << endl;
  }

}