#include <bits/stdc++.h>
using namespace std;
vector<int> C[200 + 55];
vector<pair<vector<int>, int> > MM;
vector<int> ans;
int main() {
  int n;
  cin >> n;
  int i, j;
  for (i = 0; i < n * (n - 1) / 2; ++i) {
    cin >> j;
    int k;
    while (j--) {
      scanf("%d", &k);
      C[k].push_back(i);
      ans.push_back(k);
    }
  }
  if (n == 2) {
    cout << 1 << ' ' << ans[0] << endl;
    cout << ans.size() - 1;
    for (i = 1; i < ans.size(); ++i) cout << ' ' << ans[i];
    cout << endl;
    return 0;
  }
  for (i = 1; i <= 200; ++i)
    if (C[i].size()) {
      sort(C[i].begin(), C[i].end());
      MM.push_back(make_pair(C[i], i));
    }
  sort(MM.begin(), MM.end());
  for (i = 0; i < MM.size(); ++i) {
    j = 1;
    int k;
    for (k = i + 1; MM[k].first == MM[i].first; ++k, ++j)
      ;
    cout << j;
    for (j = i; j < k; ++j) printf(" %d", MM[j].second);
    puts("");
    i = k - 1;
  }
  return 0;
}
