#include <bits/stdc++.h>
using namespace std;
int i, j, k, x, a, b, c, d, n, m, q, t, l, r, ans, temp, T = 1;
void solve() {
  cin >> n;
  bitset<105> bst(0);
  cin >> a;
  while (a--) {
    cin >> b;
    bst[b] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> a;
    bitset<105> tmp;
    while (a--) {
      cin >> b;
      tmp[b] = 1;
    }
    bst = (tmp & bst);
  }
  for (int i = 0; i < 105; i++)
    if (bst[i] == 1) cout << i << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  while (T--) {
    solve();
  }
  return 0;
}
