#include <bits/stdc++.h>
using namespace std;
const int maxn = 200 + 10;
int n;
vector<int> ret, v[maxn * maxn], q[maxn * maxn];
bool mark[maxn * maxn];
int ted[maxn * maxn];
void find(int x) {
  memset(ted, 0, sizeof ted);
  ret.clear();
  mark[x] = true;
  ret.push_back(x);
  for (int i = 0; i < q[x].size(); i++) {
    int y = q[x][i];
    for (int j = 0; j < v[y].size(); j++) {
      int cur = v[y][j];
      if (cur == x) continue;
      ted[cur]++;
      if (ted[cur] > 1 and !mark[cur]) mark[cur] = true, ret.push_back(cur);
    }
  }
  cout << ret.size() << " ";
  for (int i = 0; i < ret.size(); i++) cout << ret[i] << " ";
  cout << endl;
}
set<int> s;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n * (n - 1) / 2; i++) {
    int ted;
    cin >> ted;
    while (ted--) {
      int x;
      cin >> x;
      v[i].push_back(x);
      q[x].push_back(i);
      s.insert(x);
    }
  }
  if (n == 2) {
    cout << 1 << " " << *s.begin() << endl;
    cout << s.size() - 1 << " ";
    for (set<int>::iterator it = s.begin(); it != s.end(); ++it)
      if (it != s.begin()) cout << *it << " ";
    return 0;
  }
  for (int i = 1; i <= n * (n - 1) / 2; i++)
    for (int j = 0; j < v[i].size(); j++) {
      int x = v[i][j];
      if (!mark[x]) find(x);
    }
}
