#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200 + 5;
const int MAX_M = MAX_N * MAX_N + 5;
vector<int> A[MAX_M];
vector<int> ans[MAX_N];
bool used[MAX_N], nus1[MAX_N], nus2[MAX_N], valid[MAX_N];
int main() {
  int n;
  cin >> n;
  int m = n * (n - 1) / 2;
  int N = -1;
  for (int i = 0; i < m; ++i) {
    int k;
    scanf("%d", &k);
    A[i].reserve(k);
    for (int j = 0; j < k; ++j) {
      int x;
      scanf("%d", &x);
      A[i].push_back(x);
      N = max(N, x);
      valid[x] = 1;
    }
  }
  int ans_cnt = 0;
  for (int i = 1; i <= N; ++i) {
    if (used[i] || !valid[i]) continue;
    memset(nus2, 0, sizeof(nus2));
    for (int j = 0; j < m; ++j) {
      bool good = 0;
      for (int l = 0; l < A[j].size(); ++l)
        if (A[j][l] == i) {
          good = 1;
          break;
        }
      if (!good) continue;
      memset(nus1, 0, sizeof(nus1));
      for (int l = 0; l < A[j].size(); ++l) nus1[A[j][l]] = 1;
      for (int l = 1; l <= N; ++l)
        if (!nus1[l]) nus2[l] = 1;
    }
    for (int l = 1; l <= N; ++l)
      if (!nus2[l] && valid[l]) ans[ans_cnt].push_back(l), used[l] = 1;
    ++ans_cnt;
  }
  if (n == 2) {
    cout << ans[0].size() - 1 << " ";
    for (int i = 0; i < ans[0].size() - 1; ++i) cout << ans[0][i] << " ";
    cout << endl;
    cout << 1 << " " << ans[0].back();
    return 0;
  }
  for (int i = 0; i < ans_cnt; ++i) {
    cout << ans[i].size() << " ";
    for (int j = 0; j < ans[i].size(); ++j) printf("%d ", ans[i][j]);
    printf("\n");
  }
  return 0;
}
