#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return x == 0 ? y : gcd(y % x, x); }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
int fx[] = {1, -1, 0, 0};
int fy[] = {0, 0, 1, -1};
long long big_mod(long long a, long long p) {
  if (p == 0) return 1LL;
  long long ret = big_mod(a, p / 2);
  ret = ((ret % 1000000009) * (ret % 1000000009)) % 1000000009;
  if (p % 2) ret = ((ret * a) % 1000000009) % 1000000009;
  return ret;
}
int main() {
  int t, t1;
  cin >> t;
  set<int> st;
  int s[1001];
  memset(s, 0, sizeof s);
  t1 = t;
  while (t--) {
    int n, a;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a;
      s[a]++;
    }
  }
  vector<int> v;
  for (int i = 1; i <= 101; i++) {
    if (s[i] == t1) {
      v.push_back(i);
    }
  }
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
