#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > a(209);
vector<vector<int> > ans(209);
bool u[209];
int main() {
  int i, j, k, m, n, x, y, ok;
  scanf("%d", &n);
  if (n == 2) {
    scanf("%d", &k);
    scanf("%d", &x);
    printf("1 %d\n%d ", x, k - 1);
    for (j = 1; j < k; j++) {
      scanf("%d", &x);
      printf("%d ", x);
    }
    return 0;
  }
  m = (n - 1) * n / 2;
  for (i = 1; i <= m; i++) {
    scanf("%d", &k);
    for (j = 0; j < k; j++) {
      scanf("%d", &x);
      a[x].push_back(i);
    }
  }
  for (i = 1; i <= 200; i++) {
    sort(a[i].begin(), a[i].end());
  }
  for (i = k = 1; i <= 200; i++) {
    x = a[i].size();
    if (x > 0 && u[i] == 0) {
      ans[k].push_back(i);
      u[i] = 1;
      for (j = i + 1; j <= 200; j++) {
        y = a[j].size();
        if (u[j] == 0 && x == y) {
          ok = 1;
          for (m = 0; m < x; m++) {
            if (a[i][m] != a[j][m]) {
              ok = 0;
              break;
            }
          }
          if (ok) {
            ans[k].push_back(j);
            u[j] = 1;
          }
        }
      }
      k++;
    }
  }
  for (i = 1; i <= 200; i++) {
    x = ans[i].size();
    if (x > 0) {
      printf("%d ", x);
      for (j = 0; j < x; j++) printf("%d ", ans[i][j]);
      puts("");
    }
  }
  return 0;
}
