#include <bits/stdc++.h>
using namespace std;
vector<int> use[201];
vector<int> ans[201];
int f[201];
int n;
int maxn;
int main() {
  for (int j = 0; j < 201; ++j) {
    use[j].clear();
    ans[j].clear();
  }
  maxn = 1;
  scanf("%d", &n);
  if (n == 2) {
    int tt;
    int hav;
    scanf("%d", &hav);
    scanf("%d", &tt);
    printf("1 %d\n", tt);
    printf("%d ", hav - 1);
    for (int j = 1; j < hav - 1; ++j) {
      scanf("%d", &tt);
      printf("%d ", tt);
    }
    scanf("%d", &tt);
    printf("%d\n", tt);
  } else {
    for (int j = 1; j <= n * (n - 1) / 2; ++j) {
      int hav, tmp;
      scanf("%d", &hav);
      for (int k = 0; k < hav; ++k) {
        scanf("%d", &tmp);
        use[tmp].push_back(j);
        if (tmp > maxn) maxn = tmp;
      }
    }
    for (int j = 1; j <= maxn; ++j) {
      sort(use[j].begin(), use[j].end());
    }
    memset(f, 0, sizeof(f));
    for (int j = 1; j <= maxn; ++j)
      if (use[j].size() == 0) f[j] = 1;
    for (int j = 1; j <= n; ++j) {
      int k = 1;
      while (k <= maxn && f[k]) ++k;
      for (int i = 1; i <= maxn; ++i) {
        if (use[i].size() == 0) continue;
        int ww = 0;
        for (ww = 0; ww < n - 1; ++ww)
          if (use[k][ww] != use[i][ww]) break;
        if (ww == n - 1) {
          ans[j].push_back(i);
          f[i] = 1;
        }
      }
      printf("%d", ans[j].size());
      for (int i = 0; i < ans[j].size(); ++i) printf(" %d", ans[j][i]);
      puts("");
    }
  }
  return 0;
}
