#include <bits/stdc++.h>
using namespace std;
vector<int> vi[205];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= (n * (n - 1)) / 2; ++i) {
    int k;
    scanf("%d", &k);
    for (int j = 1; j <= k; ++j) {
      int t;
      scanf("%d", &t);
      vi[t].push_back(i);
    }
  }
  vector<pair<vector<int>, int> > vx;
  for (int i = 1; i <= 200; ++i)
    if (vi[i].size()) vx.push_back(make_pair(vi[i], i));
  sort(vx.begin(), vx.end());
  vector<vector<int> > v;
  int i = 0;
  int sz = vx.size();
  while (i < sz) {
    int cr = i;
    vector<int> t;
    while (i < sz && vx[i].first == vx[cr].first) {
      t.push_back(vx[i].second);
      i++;
    }
    if (t.size()) v.push_back(t);
  }
  if (v.size() == 1) {
    cout << 1 << " " << v[0][0] << endl;
    cout << v[0].size() - 1 << " ";
    for (int i = 1; i < v[0].size(); ++i) cout << v[0][i] << " ";
    cout << endl;
    exit(0);
  }
  for (int i = 0; i < v.size(); ++i) {
    cout << v[i].size() << " ";
    for (int j = 0; j < v[i].size(); ++j) cout << v[i][j] << " ";
    cout << endl;
  }
  return 0;
}
