#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, p, abhi, z, x, sabbey;
  cin >> n;
  map<int, map<int, int> > m;
  map<int, bool> done;
  vector<int> temp;
  for (i = 0; i < n * (n - 1) / 2; i++) {
    cin >> k;
    for (j = 0; j < k; j++) {
      cin >> abhi;
      temp.push_back(abhi - 1);
    }
    for (j = 0; j < k; j++) {
      for (p = 0; p < k; p++) {
        if (p != j) {
          z = temp[j];
          x = temp[p];
          m[z][x]++;
        }
      }
    }
    temp.clear();
  }
  vector<vector<int> > ans;
  if (n > 2)
    for (auto itr2 = m.begin(); itr2 != m.end(); itr2++) {
      i = itr2->first;
      if (done[i] == false) {
        temp.clear();
        done[i] = true;
        temp.push_back(i + 1);
        for (auto itr = m[i].begin(); itr != m[i].end(); itr++) {
          if (itr->second == (n - 1)) {
            temp.push_back((itr->first) + 1);
            done[itr->first] = true;
          }
        }
        ans.push_back(temp);
      }
    }
  else {
    auto itr = m.begin();
    temp.push_back((itr->first) + 1);
    ans.push_back(temp);
    itr++;
    temp.clear();
    while (itr != m.end()) {
      temp.push_back((itr->first) + 1);
      itr++;
    }
    ans.push_back(temp);
  }
  for (i = 0; i < ans.size(); i++) {
    cout << ans[i].size() << " ";
    for (j = 0; j < ans[i].size(); j++) cout << ans[i][j] << " ";
    cout << endl;
  }
}
