#include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
template <typename first>
inline first abs(const first& a) {
  return a < 0 ? -a : a;
}
template <typename first>
inline first sqr(const first& a) {
  return a * a;
}
const int INF = INT_MAX / 2;
const long double EPS = 1e-9;
const long double PI = 3.1415926535897932384626433832795;
const int N = 200 + 13;
vector<int> pos[N];
int sz = 0;
int res[N];
vector<int> ans[N];
int main() {
  int n;
  cin >> n;
  int cnt = (n * (n - 1)) / 2;
  for (int i = 0; i < int(cnt); i++) {
    int k;
    cin >> k;
    for (int j = 0; j < int(k); j++) {
      int x;
      scanf("%d", &x);
      x--;
      if (int((pos[x]).size()) < 2) pos[x].push_back(i);
    }
  }
  memset(res, -1, sizeof(res));
  for (int i = 0; i < int(N); i++)
    for (int j = 0; j < int(N); j++) {
      if (int((pos[i]).size()) == 0) continue;
      if (int((pos[j]).size()) == 0) continue;
      if (res[i] == -1) {
        res[i] = sz;
        ans[sz].push_back(i);
        sz++;
      }
      if (pos[i] == pos[j]) {
        if (res[j] != -1)
          assert(res[j] == res[i]);
        else {
          ans[res[i]].push_back(j);
          res[j] = res[i];
        }
      }
    }
  if (n == 2) {
    assert(sz == 1);
    assert(int((ans[0]).size()) >= 2);
    int y = ans[0].back();
    ans[0].pop_back();
    ans[sz].push_back(y);
    sz++;
  }
  assert(sz == n);
  for (int i = 0; i < int(n); i++) {
    printf("%d ", int((ans[i]).size()));
    for (int j = 0; j < int(int((ans[i]).size())); j++)
      printf("%d ", ans[i][j] + 1);
    printf("\n");
  }
  return 0;
}
