#include <bits/stdc++.h>
using namespace std;
vector<int> v[210];
int mark[210], num[210];
bool same(int a, int b) {
  int i, len;
  if (v[a].size() != v[b].size()) return false;
  len = v[a].size();
  for (i = 0; i < len; i++)
    if (v[a][i] != v[b][i]) return false;
  return true;
}
int main() {
  int n, m, i, j, k, id, temp;
  int a, b;
  while (~scanf("%d", &n)) {
    memset(mark, 0, sizeof(mark));
    memset(num, 0, sizeof(num));
    for (i = 0; i < 210; i++) v[i].clear();
    m = n * (n - 1) / 2;
    if (n == 2) {
      scanf("%d%d", &k, &a);
      printf("1 %d\n", a);
      printf("%d", k - 1);
      for (i = 2; i <= k; i++) {
        scanf("%d", &b);
        printf(" %d", b);
      }
      puts("");
      continue;
    }
    for (i = 1; i <= m; i++) {
      scanf("%d", &k);
      for (j = 0; j < k; j++) {
        scanf("%d", &temp);
        v[temp].push_back(i);
      }
    }
    id = 1;
    for (i = 1; i <= 200; i++) {
      if (v[i].size() == 0 || mark[i] != 0) continue;
      mark[i] = id;
      num[id]++;
      for (j = i + 1; j <= 200; j++)
        if (mark[j] == 0 && same(i, j)) {
          mark[j] = id;
          num[id]++;
        }
      id++;
    }
    for (i = 1; i <= n; i++) {
      printf("%d", num[i]);
      for (j = 1; j <= 200; j++)
        if (mark[j] == i) printf(" %d", j);
      puts("");
    }
  }
  return 0;
}
