#include <bits/stdc++.h>
using namespace std;
void print(const vector<int> &v) {
  printf("%d", (int)v.size());
  for (int i = 0; i < (int)(v.size()); i++) printf(" %d", v[i]);
  puts("");
}
int main() {
  int N;
  while (1 == scanf("%d", &N)) {
    map<int, vector<int> > bel;
    int M = N * (N - 1) / 2;
    for (int i = 0; i < (int)(M); i++) {
      int k, a;
      scanf("%d", &k);
      for (int j = 0; j < (int)(k); j++) {
        scanf("%d", &a);
        bel[a].push_back(i);
      }
    }
    if (N == 2) {
      vector<int> nums;
      for (__typeof((bel).begin()) ite = (bel).begin(); ite != (bel).end();
           ++ite)
        nums.push_back(ite->first);
      printf("1 %d\n", nums.back());
      nums.pop_back();
      print(nums);
    } else {
      map<vector<int>, vector<int> > sets;
      for (__typeof((bel).begin()) ite = (bel).begin(); ite != (bel).end();
           ++ite)
        sets[ite->second].push_back(ite->first);
      for (__typeof((sets).begin()) ite = (sets).begin(); ite != (sets).end();
           ++ite) {
        const vector<int> &v = ite->second;
        print(v);
      }
    }
  }
  return 0;
}
