#include <bits/stdc++.h>
using namespace std;
int n, nn;
int two[202 * 202][202];
int cnt[202 * 202];
bool used[202];
void init() {
  scanf("%d", &n);
  nn = n * (n - 1) / 2;
  for (int i = 0; i < nn; i++) {
    scanf("%d", &two[i][0]);
    for (int j = 1; j <= two[i][0]; j++) scanf("%d", &two[i][j]);
    sort(two[i] + 1, two[i] + two[i][0] + 1);
  }
}
int lst[202 * 202][202];
int head, tail;
int getand(int *x, int *y) {
  int h1 = 1, h2 = 1;
  lst[tail][0] = 0;
  while (h1 <= x[0] && h2 <= y[0]) {
    if (x[h1] == y[h2])
      lst[tail][++lst[tail][0]] = x[h1], h1++, h2++;
    else if (x[h1] < y[h2])
      h1++;
    else
      h2++;
  }
  if (lst[tail][0] == 0) return 0;
  if (used[lst[tail][1]]) return 0;
  printf("%d", lst[tail][0]);
  for (int i = 1; i <= lst[tail][0]; i++)
    printf(" %d", lst[tail][i]), used[lst[tail][i]] = true;
  puts("");
  return lst[tail++][0];
}
int getdiff(int *x, int *y) {
  int h1 = 1, h2 = 1;
  lst[tail][0] = 0;
  while (h1 <= x[0] && h2 <= y[0]) {
    if (x[h1] == y[h2])
      h1++, h2++;
    else if (x[h1] < y[h2])
      h1++;
    else
      lst[tail][++lst[tail][0]] = y[h2++];
  }
  while (h2 <= y[0]) lst[tail][++lst[tail][0]] = y[h2++];
  if (lst[tail][0] == y[0]) return 0;
  if (used[lst[tail][1]]) return 0;
  printf("%d", lst[tail][0]);
  for (int i = 1; i <= lst[tail][0]; i++)
    printf(" %d", lst[tail][i]), used[lst[tail][i]] = true;
  puts("");
  return lst[tail++][0];
}
void solve() {
  if (nn == 1) {
    printf("1 %d\n", two[0][1]);
    printf("%d", two[0][0] - 1);
    for (int i = 2; i <= two[0][0]; i++) printf(" %d", two[0][i]);
    puts("");
  }
  memset(used, 0, sizeof used);
  memset(cnt, 0, sizeof cnt);
  head = tail = 0;
  for (int i = 1; i < nn; i++)
    if (getand(two[0], two[i]) != 0) {
      cnt[0]++;
      cnt[i]++;
      break;
    }
  while (head < tail && tail < n) {
    for (int i = 0; i < nn; i++)
      if (cnt[i] < 2)
        if (getdiff(lst[head], two[i]) != 0) cnt[i]++;
    head++;
  }
}
int main() {
  init();
  solve();
  return 0;
}
