#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int t;
  cin >> t;
  bool isFirstTime = true;
  int mainR = 0;
  int arr[100];
  vector<int> v;
  vector<int> v2;
  bool isFound = false;
  int size;
  while (t--) {
    int r;
    cin >> r;
    if (isFirstTime) {
      isFirstTime = false;
      mainR = r;
      int in;
      for (int i = 0; i < mainR; i++) {
        cin >> in;
        v.push_back(in);
      }
      sort(v.begin(), v.end());
      size = v.size();
      for (int i = 0; i < size; i++) {
        v2.push_back(v[i]);
      }
    } else {
      for (int i = 0; i < r; i++) {
        cin >> arr[i];
      }
      sort(arr, arr + r);
      size = v.size();
      for (int i = 0; i < size; i++) {
        isFound = false;
        for (int j = 0; j < r; j++) {
          if (v[i] == arr[j]) {
            isFound = true;
            break;
          }
        }
        if (!isFound) {
          for (auto it = v2.begin(); it != v2.end(); it++) {
            if ((*it) == v[i]) {
              v2.erase(it);
              break;
            }
          }
        }
      }
    }
  }
  for (auto x : v2) {
    cout << x << endl;
  }
}
