#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")
using namespace std;
const long long INF = 2e9 + 13;
const long long MOD = 1e9 + 7;
int T, cnt[300005];
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  memset(cnt, 0, sizeof(cnt));
  cin >> T;
  for (int i = 0; i < T; i++) {
    int n;
    cin >> n;
    for (int j = 0; j < n; j++) {
      int x;
      cin >> x;
      cnt[x]++;
    }
  }
  vector<int> v;
  for (int i = 0; i < 300005; i++)
    if (cnt[i] == T) v.push_back(i);
  for (int x : v) cout << x << ' ';
  cout << endl;
}
