#include<iostream>
using namespace std;
int main()
{
int N,b;
int str[1000][10] = { 0,0 }, arry[10000] = {0,0};
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> b;
for (int j = 0; j < b; j++)
{
cin >> str[i][j];
arry[str[i][j]]++;
}
}
int a, o;
a = str[0][0];
o = arry[str[0][0]];
for (int i = 0; i < 10000; i++)
{
if (arry[i] > o)
{
o = arry[i]; a = i;
}
else if (arry[i] == o && i > a)
a = i;
}
cout << a << ' ' << o;
}
08-12
1120
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-13
559
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-09
2200
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)