#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(const T &a) {
  return a * a;
}
template <typename T>
inline int nread(vector<T> &a) {
  int n;
  cin >> n;
  a.clear();
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  return n;
}
int main() {
  int n;
  cin >> n;
  if (n == 2) {
    int a, b, c;
    cin >> a >> b;
    cout << "1 " << b << endl << a - 1 << ' ';
    for (int i = 1; i < a; i++) {
      cin >> c;
      cout << c << ' ';
    }
    return 0;
  }
  vector<pair<string, int> > ss(201);
  vector<int> used(201, 0);
  for (int i = 0; i <= 200; i++)
    ss[i] = make_pair(string(n * (n - 1) / 2, '0'), i);
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    int k;
    cin >> k;
    for (int j = 0; j < k; j++) {
      int l;
      cin >> l;
      used[l] = 1;
      ss[l].first[i] = '1';
    }
  }
  sort(ss.begin(), ss.end());
  vector<int> res;
  string pred;
  for (int i = 0; i <= 200; i++) {
    if (!used[ss[i].second]) continue;
    if (pred == "" || ss[i].first == pred) {
      res.push_back(ss[i].second);
    } else {
      cout << res.size();
      for (int j = 0; j < res.size(); j++) cout << ' ' << res[j];
      cout << endl;
      res.clear();
      res.push_back(ss[i].second);
    }
    pred = ss[i].first;
  }
  if (res.size() != 0) {
    cout << res.size();
    for (int j = 0; j < res.size(); j++) cout << ' ' << res[j];
    cout << endl;
  }
}
