#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  map<int, int> m1;
  for (int i = 0; i < n; i++) {
    int var, x;
    cin >> var;
    for (int i = 0; i < var; i++) {
      cin >> x;
      m1[x]++;
    }
  }
  for (auto it = m1.begin(); it != m1.end(); it++) {
    if (it->second == n) cout << it->first << " ";
  }
}
