#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double PI = acos(-1.0);
template <class T>
inline T SQR(T a) {
  return a * a;
}
struct data {
  vector<int> vec;
  int ind;
};
bool operator<(const data& a, const data& b) { return a.vec > b.vec; }
int main() {
  int n;
  cin >> n;
  if (n == 2) {
    int k;
    cin >> k;
    int a;
    cin >> a;
    printf("1 %d\n%d", a, k - 1);
    for (int i = (1), ei = (k); i < ei; i++) {
      scanf("%d", &a);
      printf(" %d", a);
    }
    return 0;
  }
  int B[201];
  vector<int>* A = new vector<int>[n * n];
  data Cnt[201];
  for (int i = (0), ei = (n * (n - 1) >> 1); i < ei; i++) {
    int k;
    scanf("%d", &k);
    A[i].reserve(k);
    for (int j = (0), ej = (k); j < ej; j++) {
      int b;
      scanf("%d", &b);
      A[i].push_back(b);
      Cnt[b].vec.push_back(i);
      Cnt[b].ind = b;
    }
  }
  sort(Cnt, Cnt + 201);
  int res = 0;
  vector<int> ans[201];
  for (int i = (0), ei = (201); i < ei; i++)
    if (Cnt[i].vec.size() != 0) {
      if (i != 0 && Cnt[i].vec != Cnt[i - 1].vec) res++;
      ans[res].push_back(Cnt[i].ind);
    }
  res++;
  for (int i = (0), ei = (res); i < ei; i++) {
    printf("%d", ans[i].size());
    for (int j = (0), ej = (ans[i].size()); j < ej; j++)
      printf(" %d", ans[i][j]);
    printf("\n");
  }
  return 0;
}
