#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int possible[105];
  fill(possible, possible + 105, true);
  for (int i = 0; i < n; ++i) {
    int r;
    cin >> r;
    set<int> s;
    for (int j = 0; j < r; ++j) {
      int num;
      cin >> num;
      s.insert(num);
    }
    for (int j = 0; j < 105; ++j) {
      if (s.count(j) == 0) possible[j] = false;
    }
  }
  for (int j = 1; j <= 100; ++j) {
    if (possible[j]) cout << j << " ";
  }
  cout << "\n";
  return 0;
}
