#include <bits/stdc++.h>
using namespace std;
vector<int> subs[1000];
vector<int> app[1000];
bool as[1000];
int main() {
  memset(as, true, sizeof as);
  int i, j, k, n, m, num;
  cin >> n;
  m = (n * (n - 1)) / 2;
  for (i = 0; i < m; i++) {
    cin >> k;
    for (j = 0; j < k; j++) {
      cin >> num;
      subs[num].push_back(i);
    }
  }
  int cnt = 0;
  if (n == 2) {
    for (i = 0; i < 300; i++) {
      if (subs[i].size()) {
        cout << 1 << " " << i << endl;
        break;
      }
    }
    i++;
    cout << k - 1;
    for (; i < 300; i++) {
      if (subs[i].size()) {
        cout << " " << i;
      }
    }
    cout << endl;
  } else {
    for (i = 0; i <= 200; i++) {
      if (as[i] && subs[i].size()) {
        for (j = i; j <= 200; j++) {
          if (as[j] && subs[j].size()) {
            if (subs[i][0] == subs[j][0] && subs[i][1] == subs[j][1]) {
              as[j] = false;
              app[cnt].push_back(j);
            }
          }
        }
        cnt++;
      }
    }
    for (i = 0; i < n; i++) {
      cout << app[i].size();
      for (j = 0; j < app[i].size(); j++) {
        cout << " " << app[i][j];
      }
      cout << endl;
    }
  }
}
