#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    vector<vector<bool> >in(n,vector<bool>(30));
    vector<string>in1(n);
    rep(i,n){
      int d;
      cin>>in1[i]>>d;
      rep(j,d){
	int a;
	cin>>a;
	in[i][a]=true;
      }
    }
    vector<int>score(n);
    rep(i,30){
      int co=0;
      rep(j,n)if(in[j][i])co++;
      if(!co)continue;
      else rep(j,n)if(in[j][i])score[j]+=n-co+1;
    }
    int mini=1e9;
    rep(i,n)mini=min(mini,score[i]);
    vector<string>out;
    rep(i,n)if(mini==score[i])out.pb(in1[i]);
    sort(all(out));
    //rep(i,n)cout<<score[i]<<" "<<in1[i]<<endl;
    cout<<mini<<" "<<out[0]<<endl;
  }
}