#include <bits/stdc++.h>
using namespace std;
set<int> nums[50000];
set<int> ans[50000];
int main() {
  int n, k;
  for (int i = 0; i < (int)(50000); i++) {
    nums[i].clear();
    ans[i].clear();
  }
  cin >> n;
  int nn = n * (n - 1) / 2;
  set<int> ini;
  for (int pos = 0; pos < nn; pos++) {
    int aux;
    cin >> k;
    for (int i = 0; i < (int)(k); i++) {
      cin >> aux;
      nums[pos].insert(aux);
      ini.insert(aux);
    }
  }
  int id = 0;
  for (int i = 1; i <= 200; i++) {
    if (!ini.count(i)) continue;
    int cnt = 0;
    set<int> possiveis = ini;
    for (int j = 0; cnt <= 1 && j < nn; j++) {
      if (nums[j].count(i)) {
        for (int k = 1; k <= 200; k++) {
          if (!nums[j].count(k) && possiveis.count(k)) {
            possiveis.erase(k);
          }
        }
        cnt++;
      }
    }
    ans[id++] = possiveis;
    for (set<int>::iterator it = possiveis.begin(); it != possiveis.end();
         it++) {
      if (ini.count(*it)) ini.erase(*it);
    }
  }
  if (n == 1)
    cout << "1 1" << endl;
  else if (n == 2) {
    cout << "1 " << *ans[0].begin() << endl;
    ans[0].erase(ans[0].begin());
    cout << (int)(ans[0]).size();
    for (set<int>::iterator it = ans[0].begin(); it != ans[0].end(); it++) {
      cout << " " << *it;
    }
    cout << endl;
  } else {
    for (int i = 0; i < (int)(n); i++) {
      cout << (int)(ans[i]).size();
      for (set<int>::iterator it = ans[i].begin(); it != ans[i].end(); it++) {
        cout << " " << *it;
      }
      cout << endl;
    }
  }
  return 0;
}
