#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int P1 = 1e9 + 7;
int P2 = 1e9 + 9;
int pw[(int)4e4 + 100], pw2[(int)4e4 + 100];
vector<int> pos[300];
int main() {
  int n;
  scanf("%d", &n);
  int N = n * (n - 1) / 2;
  if (n == 2) {
    int k, x;
    scanf("%d%d", &k, &x);
    printf("1 %d\n%d", x, k - 1);
    for (int i = 0; i < k - 1; i++) {
      scanf("%d", &x);
      printf(" %d", x);
    }
    printf("\n");
    return 0;
  }
  pw[0] = pw2[0] = 1;
  for (int i = 1; i <= N; i++)
    pw[i] = (pw[i - 1] * 10007LL) % P1, pw2[i] = (pw2[i - 1] * 10007LL) % P2;
  int k, x;
  for (int i = 0; i < N; i++) {
    scanf("%d", &k);
    for (int j = 0; j < k; j++) {
      scanf("%d", &x);
      pos[x].push_back(i);
    }
  }
  map<pair<int, int>, vector<int> > ans;
  for (int i = 1; i <= 200; i++) {
    if (pos[i].empty()) continue;
    int cur = 0, cur2 = 0;
    for (auto x : pos[i]) {
      cur = (cur + pw[x]) % P1;
      cur2 = (cur2 + pw2[x]) % P2;
    }
    ans[make_pair(cur, cur2)].push_back(i);
  }
  for (auto x : ans) {
    printf("%d", x.second.size());
    for (auto num : x.second) printf(" %d", num);
    printf("\n");
  }
  return 0;
}
