#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-10;
const double pi = acos(-1);
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
set<int> app[19900];
set<int> ans[200];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (int)n * (n - 1) / 2; ++i) {
    int k;
    cin >> k;
    while (k--) {
      int t;
      cin >> t;
      app[i].insert(t);
    }
  }
  if (n == 2) {
    set<int>::iterator siter = app[0].begin();
    cout << 1 << ' ' << *siter << endl;
    cout << (int(app[0].size())) - 1;
    while (++siter != app[0].end()) cout << ' ' << *siter;
    cout << endl;
    return 0;
  }
  int t = *app[0].begin();
  int sz = 1;
  int ne;
  for (int i = 1; i < n * (n - 1) / 2; i++) {
    if (app[i].count(t)) {
      for (__typeof((app[0]).begin()) siter = (app[0]).begin();
           siter != (app[0]).end(); ++siter) {
        if (app[i].count(*siter)) ans[0].insert(*siter);
      }
      ne = i + 1;
      break;
    }
  }
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    if (app[i].count(t)) {
      for (__typeof((app[i]).begin()) siter = (app[i]).begin();
           siter != (app[i]).end(); ++siter) {
        if (ans[0].count(*siter) == 0) ans[sz].insert(*siter);
      }
      ++sz;
    }
  }
  for (int i = 0; i < (int)n; ++i) {
    cout << (int(ans[i].size()));
    for (__typeof((ans[i]).begin()) siter = (ans[i]).begin();
         siter != (ans[i]).end(); ++siter)
      cout << ' ' << *siter;
    cout << endl;
  }
}
