#include <bits/stdc++.h>
using namespace std;
struct seq {
  int num;
  vector<int> a;
};
bool by_a(seq x, seq y) {
  if (x.a.size() != 2 || y.a.size() != 2) return (x.a.size() < y.a.size());
  if (x.a[0] == y.a[0]) return (x.a[1] < y.a[1]);
  return (x.a[0] < y.a[0]);
}
int n, k, z;
seq a[200];
int main() {
  cin >> n;
  for (int i = 0; i < 200; i++) a[i].num = i + 1;
  if (n == 2) {
    cin >> k;
    cin >> z;
    cout << "1 " << z << endl;
    cout << k - 1;
    for (int i = 1; i < k; i++) {
      cin >> z;
      cout << ' ' << z;
    }
    return 0;
  }
  for (int i = 1; i <= n * (n - 1) / 2; i++) {
    cin >> k;
    for (int j = 0; j < k; j++) {
      cin >> z;
      z--;
      if (a[z].a.size() != 2) a[z].a.push_back(i);
    }
  }
  sort(a, a + 200, by_a);
  int start = 0;
  while (!a[start].a.size()) start++;
  for (int i = start; i < 200; i++) {
    int j = i;
    while (j + 1 < 200 && a[j + 1].a[0] == a[j].a[0] &&
           a[j + 1].a[1] == a[j].a[1])
      j++;
    cout << j - i + 1;
    for (int u = i; u <= j; u++) cout << ' ' << a[u].num;
    cout << endl;
    i = j;
  }
}
