#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n;
set<int> v[N];
vector<int> g[N];
int vis[N];
vector<int> res[N];
int main() {
  cin >> n;
  for (int i = 1; i <= 200; i++) vis[i] = 1;
  for (int i = 1; i <= (n - 1) * n / 2; i++) {
    int num;
    cin >> num;
    while (num--) {
      int x;
      cin >> x;
      vis[x] = 0;
      v[i].insert(x);
      g[x].push_back(i);
    }
  }
  if (n == 2) {
    cout << v[1].size() - 1 << ' ';
    for (auto i = v[1].begin(); i != v[1].end(); i++) {
      if (i == v[1].begin()) continue;
      cout << *i << ' ';
    }
    cout << endl;
    cout << 1 << ' ' << *v[1].begin() << endl;
    return 0;
  }
  set<int> sum;
  int cnt = 0;
  for (int i = 1; i <= 200; i++) sum.insert(i);
  for (int i = 1; i <= 200; i++) {
    if (vis[i]) continue;
    set<int> now = sum;
    for (int j = 0; j < g[i].size(); j++) {
      set<int> tmp;
      set_intersection(now.begin(), now.end(), v[g[i][j]].begin(),
                       v[g[i][j]].end(), inserter(tmp, tmp.begin()));
      now = tmp;
    }
    cnt++;
    for (auto j : now) {
      vis[j] = 1;
      res[cnt].push_back(j);
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << res[i].size() << ' ';
    for (auto j : res[i]) cout << j << ' ';
    cout << endl;
  }
  return 0;
}
