#include <bits/stdc++.h>
using namespace std;
vector<int> S[210];
int n, k, x;
int comb;
int nadj[210];
int adj[210][210];
vector<int> r;
bool visited[210];
int val[210];
int num[210], N;
void dfs(int u) {
  visited[u] = true;
  r.push_back(u);
  for (int i = 0; i < nadj[u]; i++)
    if (!visited[adj[u][i]]) dfs(adj[u][i]);
}
int main() {
  N = 0;
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i <= 200; i++) S[i].clear();
    comb = (n * (n - 1)) / 2;
    memset(val, 0xff, sizeof(val));
    for (int i = 0; i < comb; i++) {
      scanf("%d", &k);
      for (int j = 0; j < k; j++) {
        scanf("%d", &x);
        if (val[x] == -1) {
          val[x] = N++;
          num[N - 1] = x;
        }
        S[val[x]].push_back(i);
      }
    }
    memset(nadj, 0, N * sizeof(int));
    for (int i = 0; i < N; i++)
      for (int j = i + 1; j < N; j++) {
        if (S[i] == S[j]) {
          adj[i][nadj[i]++] = j;
          adj[j][nadj[j]++] = i;
        }
      }
    if (n == 2) {
      printf("1 %d\n", num[0]);
      printf("%d", N - 1);
      for (int i = 1; i < N; i++) printf(" %d", num[i]);
      printf("\n");
      continue;
    }
    memset(visited, false, N * sizeof(bool));
    for (int i = 0; i < N; i++)
      if (!visited[i]) {
        r.clear();
        dfs(i);
        printf("%d", (int)r.size());
        for (int i = 0; i < (int)r.size(); i++) printf(" %d", num[r[i]]);
        printf("\n");
      }
  }
  return 0;
}
