#include <bits/stdc++.h>
using namespace std;
const int MAXK = 205;
int N;
int A[MAXK], D[MAXK];
bool B[MAXK], C[MAXK];
bool Map[MAXK][MAXK];
int main() {
  scanf("%d", &N);
  int i, j, k, K;
  memset(Map, 1, sizeof(Map));
  for (i = (1); i <= (N * (N - 1) / 2); ++i) {
    scanf("%d", &K);
    memset(B, 0, sizeof(B));
    for (j = (1); j <= (K); ++j) {
      scanf("%d", A + j);
      B[A[j]] = 1;
      C[A[j]] = 1;
    }
    if (N == 2) {
      printf("1 %d\n", A[K]);
      printf("%d ", K - 1);
      for (int j = 1; j < K; j++)
        printf("%d%c", A[j], (j == N - 1) ? '\n' : ' ');
      return 0;
    }
    for (j = (1); j <= (K); ++j) {
      for (k = (1); k <= (MAXK - 1); ++k)
        if (!B[k]) {
          Map[A[j]][k] = Map[k][A[j]] = 0;
        }
    }
  }
  for (i = (1); i <= (MAXK - 1); ++i)
    if (C[i]) {
      bool Need = 1;
      for (j = (1); j <= (i - 1); ++j) {
        if (C[j] && Map[i][j]) Need = 0;
      }
      if (Need) {
        int T = 0;
        for (j = (i); j <= (MAXK - 1); ++j) {
          if (C[j] && Map[i][j]) D[++T] = j;
        }
        printf("%d ", T);
        for (j = (1); j <= (T); ++j) {
          printf("%d%c", D[j], (j == T) ? '\n' : ' ');
        }
      }
    }
  return 0;
}
