#include <bits/stdc++.h>
using namespace std;
int n, m[210 * 210], i, j, k;
int val[210 * 210][205];
int answer, ans[205];
bool is1[205], is2[205];
int cnt[205];
int main() {
  scanf("%d", &n);
  for (i = 0; i < (n * (n - 1)) / 2; i++) {
    scanf("%d", &m[i]);
    for (j = 0; j < m[i]; j++) {
      scanf("%d", &val[i][j]);
      is1[val[i][j]] = 1;
    }
  }
  if (n == 2) {
    printf("1 %d\n", val[0][0]);
    printf("%d", m[0] - 1);
    for (i = 1; i < m[0]; i++) {
      printf(" %d", val[0][i]);
    }
    printf("\n");
    return 0;
  }
  for (i = 0; i < 205; i++) {
    if (is1[i]) {
      for (j = 0; j < 205; j++) {
        cnt[j] = 0;
      }
      for (j = 0; j < (n * (n - 1)) / 2; j++) {
        for (k = 0; k < m[j]; k++) {
          if (val[j][k] == i) break;
        }
        if (k != m[j]) {
          for (k = 0; k < m[j]; k++) {
            cnt[val[j][k]]++;
          }
        }
      }
      answer = 0;
      for (j = 0; j < 205; j++) {
        if (cnt[j] == cnt[i]) {
          ans[answer] = j;
          answer++;
        }
      }
      printf("%d ", answer);
      for (j = 0; j < answer; j++) {
        printf("%d ", ans[j]);
        is1[ans[j]] = 0;
      }
      printf("\n");
    }
  }
  return 0;
}
