#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
int n, k;
int a[1 << 8][1 << 8];
int b[1 << 8];
int was[1 << 8];
int has[1 << 8];
inline void init() {
  memset(has, 0, sizeof has);
  memset(was, 0, sizeof was);
  memset(a, 0, sizeof a);
  scanf("%d", &n);
  int nn = (n * (n - 1)) / 2;
  for (int it = 0; it < nn; ++it) {
    scanf("%d", &k);
    for (int j = 0; j < k; ++j) {
      scanf("%d", &b[j]);
      has[b[j]] = 1;
    }
    for (int i = 0; i < k; ++i)
      for (int j = i + 1; j < k; ++j) {
        ++a[b[i]][b[j]];
        ++a[b[j]][b[i]];
      }
  }
}
vector<int> ans;
void dfs(int x) {
  was[x] = 1;
  ans.push_back(x);
  for (int i = 1; i < 201; ++i) {
    if (a[x][i] + 1 != n) continue;
    if (was[i]) continue;
    if (!has[i]) continue;
    dfs(i);
  }
}
int main() {
  init();
  if (n == 2) {
    for (int i = 1; i < 201; ++i) {
      if (!has[i]) continue;
      was[i] = 1;
      printf("1 %d\n", i);
      break;
    }
  }
  for (int i = 1; i < 201; ++i) {
    if (!has[i]) continue;
    if (was[i]) continue;
    ans.clear();
    dfs(i);
    int k = (int)ans.size();
    printf("%d ", k);
    for (int j = 0; j < k; ++j) printf("%d ", ans[j]);
    puts("");
  }
  return 0;
}
