#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-9;
int FLAGS[1000];
int main(void) {
  int n;
  int nums;
  cin >> n;
  nums = n * (n - 1) / 2;
  int vindex = 0;
  vector<int> A[nums];
  vector<int> retA[n];
  memset(FLAGS, 0, sizeof(FLAGS));
  for (int i = 0; i < (int)(nums); i++) {
    A[i].clear();
  }
  for (int i = 0; i < (int)(n); i++) {
    retA[i].clear();
  }
  for (int i = 0; i < (int)(nums); i++) {
    int t, t2;
    cin >> t;
    for (int j = 0; j < (int)(t); j++) {
      cin >> t2;
      A[i].push_back(t2);
    }
    sort(A[i].begin(), A[i].end());
  }
  if (n == 2) {
    retA[0].push_back(A[0][0]);
    for (int j = 1; j < A[0].size(); j++) retA[1].push_back(A[0][j]);
  } else
    for (int i = 0; i < (int)(nums); i++) {
      int Ni = A[i].size();
      for (int j = 0; j < (int)(Ni); j++) {
        if (FLAGS[A[i][j]] == 0) {
          retA[vindex].push_back(A[i][j]);
          for (int k = 0; k < (int)(nums); k++) {
            if (k == i) continue;
            int Nk = A[k].size();
            int j2 = j;
            int f = 0;
            while (j2 < Ni) {
              for (int m = 0; m < (int)(Nk); m++) {
                if (A[i][j2] == A[k][m]) {
                  f = 1;
                  FLAGS[A[i][j2]] = 1;
                  if (j2 != j) retA[vindex].push_back(A[i][j2]);
                  break;
                }
              }
              if (f == 0) break;
              j2++;
            }
            if (f == 1) {
              vindex++;
              break;
            }
          }
        }
      }
    }
  for (int i = 0; i < (int)(n); i++) {
    int num = retA[i].size();
    cout << num;
    for (int j = 0; j < (int)(num); j++) {
      cout << " " << retA[i][j];
    }
    cout << endl;
  }
  return 0;
}
