#include <bits/stdc++.h>
using namespace std;
template <class T>
void pr(T x) {
  cerr << x;
}
template <class T>
void pr(vector<T> v) {
  pr('[');
  for (__typeof(v.begin()) it = v.begin(); it != v.end(); ++it)
    pr(it == v.begin() ? "" : ","), pr(*it);
  pr(']');
  ;
}
template <class T1, class T2>
void pr(pair<T1, T2> x) {
  pr(x.first);
  pr(':');
  pr(x.second);
}
template <class T>
void pr(set<T> v) {
  pr('{');
  for (__typeof(v.begin()) it = v.begin(); it != v.end(); ++it)
    pr(it == v.begin() ? "" : ","), pr(*it);
  pr('}');
  ;
}
template <class T1, class T2>
void pr(map<T1, T2> v) {
  pr('{');
  for (__typeof(v.begin()) it = v.begin(); it != v.end(); ++it)
    pr(it == v.begin() ? "" : ","), pr(*it);
  pr('}');
  ;
}
vector<int> A[300];
int main() {
  int n;
  scanf("%d", &n);
  int m = n * (n - 1) / 2;
  for (int i = 0; i < m; ++i) {
    int k;
    scanf("%d", &k);
    for (int j = 0; j < k; ++j) {
      int x;
      scanf("%d", &x);
      A[x].push_back(i);
    }
  }
  map<vector<int>, vector<int> > t;
  for (int i = 0; i < 300; ++i) {
    if (((int)((A[i]).size())) == 0) continue;
    t[A[i]].push_back(i);
  }
  queue<vector<int> > q;
  for (map<vector<int>, vector<int> >::iterator it = t.begin(); it != t.end();
       ++it) {
    vector<int> v = it->second;
    sort((v).begin(), (v).end());
    q.push(v);
  }
  while (((int)((q).size())) != n) {
    vector<int> v = q.front();
    q.pop();
    if (((int)((v).size())) == 1) {
      q.push(v);
    } else {
      int x = v.back();
      v.pop_back();
      q.push(v);
      q.push(vector<int>(1, x));
    }
  }
  while (!q.empty()) {
    vector<int> v = q.front();
    q.pop();
    int s = ((int)((v).size()));
    printf("%d", s);
    for (int i = 0; i < ((int)((v).size())); ++i) {
      printf(" %d", v[i]);
    }
    printf("\n");
  }
  return 0;
}
