#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x;
  cin >> n;
  if (n == 2) {
    cin >> m >> x;
    cout << "1 " << x << endl;
    cout << m - 1;
    for (int i = 1; i < m; i++) {
      cin >> x;
      cout << ' ' << x;
    }
    cout << endl;
    return 0;
  }
  vector<vector<int> > P(201);
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    cin >> m;
    for (int j = 0; j < m; j++) {
      cin >> x;
      P[x].push_back(i);
    }
  }
  vector<bool> used(201, false);
  for (int i = 1; i <= 200; i++) {
    if (!used[i] && !P[i].empty()) {
      vector<int> S(1, i);
      used[i] = true;
      for (int j = i + 1; j <= 200; j++) {
        if (P[j] == P[i]) {
          S.push_back(j);
          used[j] = true;
        }
      }
      cout << S.size();
      for (int i = 0; i < S.size(); i++) {
        cout << ' ' << S[i];
      }
      cout << endl;
    }
  }
}
