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

int main() {
    int n,m;

    while(cin>>n, n) {
        map<int,int> dap;

        string name[21];
        int d[21][31], m[21];
        for(int i=0; i<n; ++i) {
            cin>>name[i]>>m[i];
            for(int j=0; j<m[i]; ++j) {
                cin>>d[i][j];
                if(dap.find(d[i][j]) == dap.end()) dap[d[i][j]] = 1;
                else dap[d[i][j]]++;
            }
        }


        int minp = 1<<29;
        string ans = "";
        for(int i=0; i<n; ++i) {
            int tp = 0;
            for(int j=0; j<m[i]; ++j) {
                tp += n - dap[d[i][j]] + 1;
            }
            if(tp < minp) {
                ans = name[i];
            }else if(tp == minp && ans > name[i]) {
                ans = name[i];
            }
            minp = min(minp, tp);
        }

        cout<<minp<<" "<<ans<<endl;
    }
}