#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  if (n == 2) {
    int k;
    scanf("%d", &k);
    for (int i = 0; i < k; i++) {
      int a;
      scanf("%d", &a);
      if (i == 0)
        printf("1 %d\n%d", a, k - 1);
      else
        printf(" %d", a);
    }
    return 0;
  }
  vector<vector<int> > d(n * (n - 1) / 2);
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    int k;
    scanf("%d", &k);
    for (int j = 0; j < k; j++) {
      int c;
      scanf("%d", &c);
      d[i].push_back(c);
    }
    sort(d[i].begin(), d[i].end());
  }
  sort(d.begin(), d.end());
  vector<int> t;
  for (int i = 0; i < d[0].size(); i++)
    for (int j = 0; j < d[1].size(); j++)
      if (d[0][i] == d[1][j]) t.push_back(d[0][i]);
  vector<int> p(201, 0);
  cout << t.size();
  for (int i = 0; i < t.size(); i++) {
    cout << " " << t[i];
    p[t[i]] = 1;
  }
  cout << endl;
  for (int i = 0; i < n - 1; i++) {
    cout << d[i].size() - t.size();
    for (int j = 0; j < d[i].size(); j++)
      if (p[d[i][j]] == 0) {
        cout << " " << d[i][j];
      }
    cout << endl;
  }
}
