#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using papers = bitset<20000>;
const int N = 200;
int n, m;
papers p[N + 1];
unordered_map<papers, vector<int>> g;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  cin >> n;
  m = n * (n - 1) / 2;
  if (n == 2) {
    for (int i = 0; i < m; i++) {
      int k, j;
      cin >> k >> j;
      k--;
      cout << "1 " << j << endl;
      cout << k;
      while (k-- > 0) cin >> j, cout << ' ' << j;
      cout << endl;
    }
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int k, j;
    cin >> k;
    while (k-- > 0) cin >> j, p[j][i] = true;
  }
  for (int i = 1; i <= 200; i++) {
    if (p[i].any()) g[p[i]].push_back(i);
  }
  for (auto& kv : g) {
    auto& ans = kv.second;
    cout << ans.size();
    for (int x : ans) cout << ' ' << x;
    cout << '\n';
  }
  return 0;
}
