#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
template <typename T>
inline T sqr(T a) {
  return a * a;
}
template <typename T>
inline void relax_min(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
inline void relax_max(T &a, T b) {
  if (b > a) a = b;
}
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
const long double EPS = 1E-8;
const long double PI = 3.1415926535897932384626433832795;
bitset<210> vv[210 * 210];
vector<vector<int> > vv2(210);
int used[210];
int used1[210];
void solve() {
  int n;
  cin >> n;
  int m = n * (n - 1) / 2;
  int last;
  for (int i = 0, _n(m); i < _n; i++) {
    int k;
    cin >> k;
    for (int j = 0, _n(k); j < _n; j++) {
      cin >> last;
      vv[i].set(last);
      vv2[last].push_back(i);
      used1[last] = 1;
    }
  }
  if (n == 2) {
    cout << 1 << " " << last << endl;
    cout << vv[0].count() - 1 << " ";
    for (int i = 0, _n(210); i < _n; i++)
      if (used1[i] && i != last) cout << i << " ";
    return;
  }
  for (int i = 0, _n(210); i < _n; i++) {
    if (used1[i] && !used[i]) {
      int a = vv2[i].back();
      vv2[i].pop_back();
      int b = vv2[i].back();
      vv2[i].pop_back();
      bitset<210> t = vv[a] & vv[b];
      cout << t.count() << " ";
      for (int j = 0, _n(210); j < _n; j++)
        if (t.test(j)) {
          cout << j << " ";
          used[j] = 1;
        }
      cout << endl;
    }
  }
}
int main() {
  solve();
  return 0;
}
