#include <bits/stdc++.h>
using namespace std;
const int NMAX = 200 * 200;
vector<set<int>> s;
set<set<int>> ans;
set<int> intersect(set<int>& a, set<int>& b) {
  set<int> ans;
  for (set<int>::iterator it = a.begin(); it != a.end(); ++it) {
    if (b.count(*it)) {
      ans.insert(*it);
    }
  }
  return ans;
}
int main() {
  int n = 200;
  scanf("%d", &n);
  int cnt = n * (n - 1) / 2;
  s.resize(cnt, set<int>());
  for (int i = 0; i < (int)cnt; ++i) {
    int k;
    scanf("%d", &k);
    for (int j = 0; j < (int)k; ++j) {
      int x;
      scanf("%d", &x);
      s[i].insert(x);
    }
  }
  if (n == 2) {
    printf("1 %d\n", *s[0].begin());
    printf("%d ", int(s[0].size()) - 1);
    set<int>::iterator it = s[0].begin();
    ++it;
    for (; it != s[0].end(); ++it) {
      printf("%d ", *it);
    }
    printf("\n");
    return 0;
  }
  sort(s.begin(), s.end());
  set<int> cur;
  for (int i = 0; i < (int)cnt; ++i) {
    if (!cur.empty()) break;
    for (int j = 0; j < (int)i; ++j) {
      cur = intersect(s[i], s[j]);
      if (!cur.empty()) break;
    }
  }
  ans.insert(cur);
  for (int i = 0; i < (int)cnt; ++i) {
    int sz = s[i].size();
    for (set<int>::iterator it = cur.begin(); it != cur.end(); ++it) {
      s[i].erase(*it);
    }
    if (sz != s[i].size()) {
      ans.insert(s[i]);
    }
  }
  for (set<set<int>>::iterator it = ans.begin(); it != ans.end(); ++it) {
    printf("%d ", it->size());
    for (set<int>::iterator jt = it->begin(); jt != it->end(); ++jt) {
      printf("%d ", *jt);
    }
    printf("\n");
  }
  return 0;
}
