#include <bits/stdc++.h>
using namespace std;
template <class T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cout << *i << " ";
  cout << endl;
}
template <class T>
void chmin(T &t, T f) {
  if (t > f) t = f;
}
template <class T>
void chmax(T &t, T f) {
  if (t < f) t = f;
}
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
int main() {
  int n;
  cin >> n;
  vector<vector<int> > s, sets;
  for (int i = 0; i < (n * (n - 1) / 2); i++) {
    int k = in();
    vector<int> set;
    for (int j = 0; j < (k); j++) {
      set.push_back(in());
    }
    sort(set.begin(), set.end());
    s.push_back(set);
  }
  if (n == 2) {
    cout << "1 " << s[0][0] << endl;
    cout << s[0].size() - 1;
    for (int i = 0; i < (s[0].size() - 1); i++) cout << " " << s[0][i + 1];
    cout << endl;
    return 0;
  }
  int minimum = 100100100;
  for (int i = 0; i < (n * (n - 1) / 2); i++) chmin(minimum, s[i][0]);
  for (int i = 0; i < (n * (n - 1) / 2); i++)
    if (s[i][0] == minimum) sets.push_back(s[i]);
  int a[210] = {};
  for (int i = 0; i < (sets[0].size()); i++) ++a[sets[0][i]];
  for (int i = 0; i < (sets[1].size()); i++) ++a[sets[1][i]];
  vector<int> one;
  for (int i = 0; i < (210); i++)
    if (a[i] == 2) one.push_back(i);
  vector<vector<int> > results;
  results.push_back(one);
  for (int i = 0; i < (n - 1); i++) {
    memset(a, 0, sizeof(a));
    for (int j = 0; j < (sets[i].size()); j++) {
      ++a[sets[i][j]];
    }
    for (int j = 0; j < (one.size()); j++) {
      ++a[one[j]];
    }
    vector<int> result;
    for (int j = 0; j < (210); j++) {
      if (a[j] == 1) result.push_back(j);
    }
    results.push_back(result);
  }
  for (int i = 0; i < (n); i++) {
    cout << results[i].size();
    for (int j = 0; j < (results[i].size()); j++) {
      cout << " " << results[i][j];
    }
    cout << endl;
  }
  return 0;
}
