#include <bits/stdc++.h>
using namespace std;
int n;
int C[222][222];
int K[222], N[222];
int S[222][222], t[222];
int repre[222];
int rep(int a) {
  if (repre[a] == a)
    return a;
  else
    return repre[a] = rep(repre[a]);
}
void join(int a, int b) {
  if (rep(a) < rep(b))
    repre[rep(b)] = rep(a);
  else
    repre[rep(a)] = rep(b);
}
int main() {
  scanf("%d", &n);
  int k;
  for (int i = 0; i < (n * (n - 1)) / 2; i++) {
    scanf("%d", &k);
    for (int j = 0; j < k; j++) {
      scanf("%d", &K[j]);
      N[K[j]]++;
    }
    for (int j = 0; j < k; j++) {
      for (int l = j + 1; l < k; l++) {
        C[K[j]][K[l]]++;
        C[K[l]][K[j]]++;
      }
    }
  }
  if (n == 2) {
    int ii;
    for (ii = 0; ii <= 200; ii++) {
      if (N[ii]) {
        cout << "1 " << ii << endl;
        break;
      }
    }
    cout << k - 1;
    ii++;
    while (ii <= 200) {
      if (N[ii]) cout << " " << ii;
      ii++;
    }
    cout << endl;
    return 0;
  }
  for (int i = 0; i <= 200; i++) repre[i] = i;
  for (int i = 0; i <= 200; i++) {
    for (int j = i + 1; j <= 200; j++) {
      if (C[i][j] == n - 1) {
        join(i, j);
      }
    }
  }
  for (int i = 0; i <= 200; i++) {
    int r = rep(i);
    if (r != i) {
      S[r][t[r]++] = i;
    }
  }
  for (int i = 0; i <= 200; i++)
    if (t[i]) {
      cout << t[i] + 1 << " " << i;
      for (int j = 0; j < t[i]; j++) {
        cout << " " << S[i][j];
      }
      cout << endl;
    }
  for (int i = 0; i <= 200; i++)
    if (N[i] != 0 && rep(i) == i && t[i] == 0) cout << "1 " << i << endl;
  return 0;
}
