#include <bits/stdc++.h>
using namespace std;
int n, m, i, c[100005], a, b, v, k, t[100005];
set<int> g[100005];
vector<int> first_half;
vector<int> second_half;
vector<int> total;
int par[209], group[209];
vector<long long int> points;
map<char, long long int> vis_c;
map<long long int, long long int> trams;
vector<long long int> election;
vector<pair<long long int, long long int> > vect;
long long int PaB[10009];
long long int arra[39][39];
long long int ans1[39][39];
long long int ans2[39][39];
int main() {
  long long int a, b, k, c = 0, i, j, n, l = 2, r = 0, m;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> m;
    for (j = 0; j < m; j++) {
      cin >> a;
      trams[a]++;
      c = max(c, trams[a]);
    }
  }
  for (i = 1; i <= 100; i++) {
    if (c == trams[i]) cout << i << " ";
  }
}
