#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
int n;
int m;
int cnt[N];
int a[23001][201], s;
bool vis[N];
int f[N];
int ans[N];
void solve(int k) {
  f[k] = true;
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < m; ++i) {
    if (a[i][k]) {
      for (int j = 1; j <= 200; ++j)
        if (a[i][j]) cnt[j]++;
    }
  }
  s = 0;
  for (int i = 1; i <= 200; ++i)
    if (cnt[i] == n - 1) {
      ans[s++] = i;
      f[i] = 1;
    }
  printf("%d", s);
  for (int i = 0; i < s; ++i) printf(" %d", ans[i]);
  puts("");
}
int main() {
  scanf("%d", &n);
  m = n * (n - 1) / 2;
  memset(a, 0, sizeof(a));
  memset(vis, 0, sizeof(vis));
  memset(f, 0, sizeof(f));
  for (int i = 0; i < m; ++i) {
    int t;
    scanf("%d", &s);
    for (int j = 0; j < s; ++j) {
      scanf("%d", &t);
      a[i][t] = 1;
      vis[t] = 1;
    }
  }
  if (n == 2) {
    s = 0;
    int t;
    for (int i = 1; i <= 200; ++i)
      if (vis[i]) {
        t = i;
        break;
      }
    printf("1 %d\n", t);
    for (int i = 0; i <= 200; ++i)
      if (vis[i] && i != t) {
        ans[s++] = i;
      }
    printf("%d", s);
    for (int i = 0; i < s; ++i) printf(" %d", ans[i]);
    puts("");
    return 0;
  }
  for (int i = 1; i <= 200; ++i) {
    if (vis[i] && !f[i]) {
      solve(i);
    }
  }
}
