#include <bits/stdc++.h>
using namespace std;
set<int> num;
vector<vector<int> > v;
set<vector<int> > ans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n * (n - 1) / 2; ++i) {
    int t;
    scanf("%d", &t);
    vector<int> cur(t);
    for (int i = 0; i < t; ++i) {
      scanf("%d", &cur[i]);
      num.insert(cur[i]);
    }
    v.push_back(cur);
  }
  if (n == 2) {
    printf("%d ", 1);
    printf("%d\n", v[0][0]);
    printf("%d ", v[0].size() - 1);
    for (int i = 1; i < v[0].size(); ++i) printf("%d ", v[0][i]);
    return 0;
  }
  vector<vector<int> > cur;
  for (set<int>::iterator it = num.begin(); it != num.end(); ++it) {
    cur.clear();
    int t = *it;
    for (int i = 0; i < n * (n - 1) / 2; ++i)
      for (int j = 0; j < v[i].size(); ++j)
        if (v[i][j] == t) {
          cur.push_back(v[i]);
          break;
        }
    map<int, int> mp;
    for (int i = 0; i < cur.size(); ++i)
      for (int j = 0; j < cur[i].size(); ++j)
        if (!mp.insert(make_pair(cur[i][j], 1)).second) ++mp[cur[i][j]];
    vector<int> a;
    for (map<int, int>::iterator it = mp.begin(); it != mp.end(); ++it)
      if (it->second == n - 1) a.push_back(it->first);
    sort(a.begin(), a.end());
    ans.insert(a);
  }
  for (set<vector<int> >::iterator it = ans.begin(); it != ans.end(); ++it) {
    printf("%d ", it->size());
    for (int i = 0; i < it->size(); ++i) printf("%d ", it->at(i));
    printf("\n");
  }
  return 0;
}
