#include <bits/stdc++.h>
using namespace std;
int N, T[222], Ret[222];
bool H[222], A[22222][222];
int main() {
  scanf("%d", &N);
  for (int i = 0, TOT; i < N * (N - 1) / 2; i++) {
    scanf("%d", &TOT);
    for (int j = 0, k; j < TOT; j++) {
      scanf("%d", &k);
      A[i][k] = true;
    }
  }
  if (N == 2) {
    for (int i = 0; i <= 200; i++)
      if (A[0][i]) {
        cout << 1 << " " << i << endl;
        A[0][i] = false;
        break;
      }
    for (int i = 0; i <= 200; i++)
      if (A[0][i]) {
        Ret[++Ret[0]] = i;
      }
    cout << Ret[0];
    for (int j = 1; j <= Ret[0]; j++) cout << " " << Ret[j];
    cout << endl;
    return 0;
  }
  for (int i = 1; i <= 200; i++)
    if (!H[i]) {
      memset(T, 0, sizeof(T));
      for (int j = 0; j < N * (N - 1) / 2; j++)
        if (A[j][i]) {
          for (int k = 1; k <= 200; k++)
            if (A[j][k]) T[k]++;
        }
      if (!T[i]) continue;
      Ret[0] = 0;
      for (int j = 1; j <= 200; j++)
        if (T[j] == T[i]) {
          Ret[++Ret[0]] = j;
          H[j] = true;
        }
      cout << Ret[0];
      for (int j = 1; j <= Ret[0]; j++) cout << " " << Ret[j];
      cout << endl;
    }
  return 0;
}
