#include <bits/stdc++.h>
using namespace std;
int x, y, z, i, j, n, m, k, s1, s2, s3, s4, mod, l, r, N, t, maxx, minn;
double w, v, h, hh, ww1, ww2;
long long a[100045];
long long b[100045];
long long c[100045];
pair<string, int> aa[100045];
string s;
string p;
string q;
string ss[1045];
int main() {
  scanf("%d", &n);
  if (n == 2) {
    scanf("%d", &z);
    scanf("%d", &x);
    printf("1 %d\n", x);
    printf("%d ", z - 1);
    for (i = 2; i <= z; i++) {
      scanf("%d", &x);
      printf("%d ", x);
    }
    exit(0);
  }
  s = "";
  for (i = 1; i <= 40000; i++) {
    s += '0';
  }
  for (i = 1; i <= 200; i++) {
    aa[i].first = s;
    aa[i].second = i;
  }
  for (i = 1; i <= n * (n - 1) / 2; i++) {
    scanf("%d", &x);
    for (j = 1; j <= x; j++) {
      scanf("%d", &y);
      aa[y].first[i - 1] = '1';
    }
  }
  sort(aa + 1, aa + 201);
  for (i = 1; i <= 200; i++) {
    x = 0;
    for (j = 1; j <= 40000; j++) {
      if (aa[i].first[j] == '1') x++;
    }
    if (x == 0) continue;
    y = 1;
    for (l = i + 1; l <= 200; l++) {
      if (aa[i].first == aa[l].first) {
        y++;
      } else
        break;
    }
    printf("%d ", y);
    for (l = i; l <= i + y - 1; l++) {
      printf("%d ", aa[l].second);
    }
    printf("\n");
    i = i + y - 1;
  }
}
