#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
using vint = vector<int>;
using vll = vector<ll>;
using v2int = vector<vint>;
using v2ll = vector<vll>;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  v2int m;
  unordered_set<int> A;
  int n;
  cin >> n;
  for (size_t i = 0; i < n; ++i) {
    int r;
    cin >> r;
    m.push_back(vint(r));
    for (size_t j = 0; j < r; ++j) {
      cin >> m[i][j];
      A.insert(m[i][j]);
    }
  }
  for (int x : A) {
    bool e = 1;
    for (size_t i = 0; i < n; ++i) {
      auto it = find(m[i].begin(), m[i].end(), x);
      e *= (it != m[i].end());
    }
    if (e == 1) cout << x << " ";
  }
  cout << endl;
}
