#include <bits/stdc++.h>
using namespace std;
int n, r, i, x;
map<int, int> m;
int main() {
  for (cin >> n; i < n; i++) {
    for (cin >> r; r--;) cin >> x, m[x]++;
    for (auto y : m)
      if (y.second == n) cout << y.first << " ";
  }
}
