#include <bits/stdc++.h>
using namespace std;
vector<int> v[220];
bool equal(int a, int b) {
  if (v[a].size() != v[b].size()) return false;
  for (int i = 0; i < int(v[a].size()); ++i)
    if (v[a][i] != v[b][i]) return false;
  return true;
}
int main() {
  int n;
  cin >> n;
  if (n == 2) {
    int k, t;
    cin >> k;
    for (int i = 0; i < int(k); ++i) {
      cin >> t;
      if (!i)
        printf("1 %d\n%d", t, k - 1);
      else
        printf(" %d", t);
    }
    cout << endl;
    return 0;
  }
  for (int i = 0; i < int(n * (n - 1) / 2); ++i) {
    int k;
    scanf("%d", &k);
    for (int j = 0; j < int(k); ++j) {
      int t;
      scanf("%d", &t);
      v[t].push_back(i);
    }
  }
  for (int i = 0; i < int(201); ++i)
    if (!v[i].empty()) {
      vector<int> ans;
      ans.push_back(i);
      for (int j = i + 1; j <= 200; j++)
        if (equal(i, j)) {
          ans.push_back(j);
          v[j].clear();
        }
      cout << ans.size();
      for (int j = 0; j < int(ans.size()); ++j) cout << " " << ans[j];
      cout << endl;
    }
  return 0;
}
