#include <bits/stdc++.h>
using namespace std;
const int P = 13;
vector<int> v[205], ans;
int n, m, k, a, h[205];
bool cmp(int a, int b) { return h[a] < h[b]; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cout << boolalpha << setprecision(6) << fixed;
  clog.copyfmt(cout);
  cin >> n;
  m = n * (n - 1) / 2;
  for (int i = 0; i < m; ++i) {
    cin >> k;
    for (int j = 0; j < k; ++j) {
      cin >> a;
      v[a].push_back(i);
      ans.push_back(a);
    }
  }
  sort(ans.begin(), ans.end());
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  if (n == 2) {
    cout << 1 << " " << ans[0] << endl;
    cout << ans.size() - 1;
    for (int j = 1; j < ans.size(); ++j) cout << " " << ans[j];
    cout << endl;
  } else {
    for (int i = 0; i < ans.size(); ++i) {
      int num = ans[i];
      int tmp = 0;
      for (int j = 0, l = 1; j < v[num].size(); ++j, l *= P)
        tmp += v[num][j] * l;
      h[num] = tmp;
    }
    sort(ans.begin(), ans.end(), cmp);
    for (int i = 0; i < ans.size();) {
      vector<int> tmp;
      for (int j = i; i < ans.size() && h[ans[i]] == h[ans[j]]; ++i)
        tmp.push_back(ans[i]);
      cout << tmp.size();
      for (int j = 0; j < tmp.size(); ++j) cout << " " << tmp[j];
      cout << endl;
    }
  }
  return 0;
}
