#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int N = 4e4 + 666;
set<int> s[N], res[N];
int n, m;
void solve() {
  if (n == 2) {
    for (int t : s[0]) {
      if (res[0].empty())
        res[0].insert(t);
      else
        res[1].insert(t);
    }
    return;
  }
  vector<int> v = {0};
  int x = *s[0].begin();
  for (int i = 1; i < m; i++) {
    if (s[i].count(x)) v.push_back(i);
  }
  assert((int)(v).size() == n - 1);
  for (int t : s[0]) {
    bool has = true;
    for (int i : v) {
      if (!s[i].count(t)) {
        has = false;
        break;
      }
    }
    if (has) res[0].insert(t);
  }
  for (int i = 0; i < (int)(v).size(); i++) {
    for (int x : s[v[i]])
      if (!res[0].count(x)) res[i + 1].insert(x);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int k, x;
  cin >> n;
  m = n * (n - 1) / 2;
  for (int i = 0; i < m; i++) {
    cin >> k;
    while (k--) {
      cin >> x;
      s[i].insert(x);
    }
  }
  solve();
  for (int i = 0; i < n; i++) {
    cout << (int)(res[i]).size();
    for (int x : res[i]) cout << ' ' << x;
    cout << '\n';
  }
}
