#include <bits/stdc++.h>
using namespace std;
template <class T>
inline int size(T x) {
  return x.size();
}
inline bool contains(vector<int>& v, int x) {
  return find(v.begin(), v.end(), x) != v.end();
}
void print_set(vector<int>& v) {
  int sz = size(v);
  cout << sz;
  for (int i = 0; i < sz; i++) {
    cout << " " << v[i];
  }
  cout << endl;
}
int n;
vector<vector<int> > sets;
bool elem[205] = {};
int mi = 205;
int main() {
  cin >> n;
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    sets.push_back(vector<int>());
    int k_i;
    cin >> k_i;
    for (int j = 0; j < k_i; j++) {
      int a_ij;
      cin >> a_ij;
      sets[i].push_back(a_ij);
      elem[a_ij] = true;
      mi = min(mi, a_ij);
    }
  }
  if (n == 2) {
    int cnt = size(sets[0]) / 2;
    cout << cnt;
    int i;
    for (i = 0; i < cnt; i++) {
      cout << " " << sets[0][i];
    }
    cout << endl;
    cout << size(sets[0]) - cnt;
    for (; i < size(sets[0]); i++) {
      cout << " " << sets[0][i];
    }
    cout << endl;
  } else {
    vector<int> set0;
    set0.push_back(mi);
    vector<int> good_sets;
    for (int i = 0; i < n * (n - 1) / 2; i++) {
      if (contains(sets[i], mi)) {
        good_sets.push_back(i);
      }
    }
    int num_good = size(good_sets);
    assert(num_good == n - 1);
    for (int j = mi + 1; j <= 200; j++) {
      int count_j = 0;
      for (int i = 0; i < num_good; i++) {
        if (contains(sets[good_sets[i]], j)) {
          count_j++;
        }
      }
      if (count_j > 1) {
        set0.push_back(j);
      }
    }
    print_set(set0);
    bool in_0[205] = {};
    for (int i = 0; i < size(set0); i++) in_0[set0[i]] = true;
    vector<int> r;
    for (int i = 0; i < num_good; i++) {
      r.clear();
      vector<int>& s = sets[good_sets[i]];
      int sz = size(s);
      for (int k = 0; k < sz; k++) {
        int elem = s[k];
        if (!in_0[elem]) {
          r.push_back(elem);
        }
      }
      if (size(r) > 0) {
        print_set(r);
      }
    }
  }
}
