#include <bits/stdc++.h>
enum { N = 201 };
int n;
int where[N][N];
int cnt[N] = {};
int what[N];
int set[N][N];
int sn[N] = {};
int eq(int i, int j) {
  int k;
  for (k = 0; k < n - 1; ++k) {
    if (where[i][k] != where[j][k]) return 0;
  }
  return 1;
}
int main(void) {
  scanf("%d", &n);
  int i, j, k, x;
  if (n == 2) {
    scanf("%d %d", &k, &x);
    printf("1 %d\n%d ", x, k - 1);
    for (i = 0; i < k - 1; ++i) {
      scanf("%d", &x);
      printf("%d ", x);
    }
    printf("\n");
    return 0;
  }
  int nn = n * (n - 1) / 2;
  for (i = 0; i < nn; ++i) {
    scanf("%d", &k);
    for (j = 0; j < k; ++j) {
      scanf("%d", &x);
      where[x][cnt[x]] = i;
      ++cnt[x];
    }
  }
  for (i = 1; i < N; ++i) {
    if (cnt[i] == 0) continue;
    what[i] = i;
    for (j = 1; j < i; ++j) {
      if (cnt[j] == 0) continue;
      if (eq(j, i)) {
        what[i] = j;
        break;
      }
    }
    set[what[i]][sn[what[i]]] = i;
    ++sn[what[i]];
  }
  for (i = 1; i < N; ++i) {
    if (sn[i] == 0) continue;
    printf("%d ", sn[i]);
    for (j = 0; j < sn[i]; ++j) {
      printf("%d ", set[i][j]);
    }
    printf("\n");
  }
  return 0;
}
