#include <bits/stdc++.h>
using namespace std;
int n, m, k, x;
vector<int> arr[20000];
set<int> ans[205];
bool done[205] = {false};
bool yeah[20000][205] = {false};
int main() {
  scanf("%d", &n);
  m = n * (n - 1) / 2;
  for (int(i) = 0, _n = (m); (i) < _n; (i)++) {
    scanf("%d", &k);
    for (int(_) = 0, _n = (k); (_) < _n; (_)++) {
      scanf("%d", &x);
      arr[i].push_back(x);
      yeah[i][x] = true;
    }
    sort(arr[i].begin(), arr[i].end());
  }
  if (n == 2) {
    printf("1 %d\n", arr[0][0]);
    printf("%d", arr[0].size() - 1);
    for (int(i) = (1), _n = (arr[0].size() - 1); (i) <= _n; (i)++)
      printf(" %d", arr[0][i]);
    puts("");
    return 0;
  }
  for (int(t) = 0, _n = (n); (t) < _n; (t)++) {
    int i = 0, key;
    set<int> a, b;
    while (true) {
      for (int(j) = 0, _n = (arr[i].size()); (j) < _n; (j)++)
        if (!done[arr[i][j]]) a.insert(arr[i][j]);
      if (!a.empty()) {
        key = *a.begin();
        break;
      }
      i++;
    }
    int j = i + 1;
    while (j < m) {
      if (yeah[j][key]) {
        for (int(k) = 0, _n = (arr[j].size()); (k) < _n; (k)++)
          if (a.find(arr[j][k]) != a.end()) b.insert(arr[j][k]);
        break;
      }
      j++;
    }
    for (__typeof((b).begin()) it = (b).begin(); it != (b).end(); it++)
      done[*it] = true;
    ans[t] = b;
  }
  for (int(i) = 0, _n = (n); (i) < _n; (i)++) {
    printf("%d", ans[i].size());
    for (__typeof((ans[i]).begin()) it = (ans[i]).begin(); it != (ans[i]).end();
         it++)
      printf(" %d", *it);
    puts("");
  }
  return 0;
}
