#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main()
{
int n;
cin >> n;
int a[1001] = {0};
for(int i = 0; i < n; i++){
int temp;
cin >> temp;
for(int j = 0; j < temp; j++){
int t;
cin >> t;
a[t]++;
}
}
int max = 0, pos = 0;
for(int i = 0; i < 1001; i++){
if(a[i] >= max){
pos = i;
max = a[i];
}
}
cout << pos << " " << max <<endl;
return 0;
}
#include <iostream>
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
int main()
{
char a[100][13];
#include <iostream>
using namespace std;
int a,b;
int main (){
cin >> a >> b;
cout << a * b << endl;
return 0;
}
int i;
int sum=1;
for(i=1; ;i++)
{
scanf("%s",a[i]);
if(strcmp(a[i],".")==0)
{
break;
}
sum++;
}
if(sum>=14)
{
printf("%s and %s are inviting you to dinner...\n",a[2],a[14]);
}
else if(sum<14&&sum>=3)
{
printf("%s is the only one for you...\n",a[2]);
}
else if(sum<=2)
{
printf("Momo... No one is for you ...\n");
}
return 0;
}