#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::system_clock::now().time_since_epoch().count());
const int maxn = (int)1e6 + 30;
const int inf = (int)1e9 + 5;
const int mod = 998244353;
const long long llinf = (long long)1e18 + 5;
const long double pi = acos(-1.0);
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<set<int> > x;
  for (int i = 0; i < n; ++i) {
    x.push_back(set<int>());
    int r;
    cin >> r;
    while (r--) {
      int z;
      cin >> z;
      x[i].insert(z);
    }
  }
  vector<int> ans;
  for (int z : x[0]) {
    bool ok = true;
    for (int i = 0; i < n; ++i) {
      ok &= x[i].count(z);
    }
    if (ok) ans.push_back(z);
  }
  sort(ans.begin(), ans.end());
  for (int x : ans) cout << x << ' ';
  return 0;
}
