#include <bits/stdc++.h>
using namespace std;
long long int n, i, j, k, m, has[205], vis[205][205], ans[205];
vector<long long int> arr[40005];
int main() {
  cin >> n;
  if (n == 2) {
    cin >> k;
    cin >> m;
    cout << "1 " << m << endl;
    cout << k - 1 << " ";
    for (i = 1; i < k; i++) {
      cin >> m;
      cout << m << " ";
    }
    return 0;
  }
  for (i = 0; i < (n * (n - 1)) / 2; i++) {
    cin >> k;
    for (j = 0; j < k; j++) {
      cin >> m;
      has[m] = 1;
      arr[i].push_back(m);
    }
  }
  for (i = 0; i < (n * (n - 1)) / 2; i++) {
    for (j = 0; j < arr[i].size(); j++) {
      for (k = 0; k < arr[i].size(); k++) {
        if (j == k) continue;
        vis[arr[i][j]][arr[i][k]]++;
      }
    }
  }
  for (i = 1; i <= 200; i++) {
    if (has[i] && !ans[i]) {
      vector<long long int> ret;
      ret.push_back(i);
      ans[i] = 1;
      for (j = 1; j <= 200; j++) {
        if (vis[i][j] == n - 1) {
          ret.push_back(j);
          ans[j] = 1;
        }
      }
      cout << ret.size() << " ";
      for (j = 0; j < ret.size(); j++) cout << ret[j] << " ";
      cout << endl;
    }
  }
  return 0;
}
