#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long N = 2e6 + 3;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
long long n, m;
long long a, t[106], mx;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> m;
    while (m--) cin >> a, t[a]++;
  }
  for (int i = 1; i <= 100; i++) {
    if (mx <= t[i]) mx = t[i];
  }
  for (int i = 1; i <= 100; i++)
    if (t[i] == mx) cout << i << ' ';
}
