#include <bits/stdc++.h>
using namespace std;
int numbers[201][201];
vector<int> tmp;
int n, k, t;
int main() {
  cin >> n;
  if (n == 2) {
    cin >> k;
    cout << k - 1 << " ";
    for (int i = 0; i < k - 1; i++) {
      cin >> t;
      cout << t << " ";
    }
    cout << endl << 1 << " ";
    cin >> t;
    cout << t;
    return 0;
  }
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    cin >> k;
    tmp.clear();
    for (int j = 0; j < k; j++) {
      cin >> t;
      tmp.push_back(t);
    }
    for (int j = 0; j < tmp.size(); j++)
      for (k = 0; k < tmp.size(); k++) numbers[tmp[j]][tmp[k]]++;
  }
  for (int i = 0; i < 201; i++)
    if (numbers[i][i] > 0) {
      tmp.clear();
      for (int j = 0; j < 201; j++)
        if (numbers[i][i] == numbers[i][j]) {
          tmp.push_back(j);
          if (i != j) numbers[j][j] = 0;
        }
      cout << tmp.size() << " ";
      for (int j = 0; j < tmp.size(); j++) cout << tmp[j] << " ";
      cout << endl;
    }
}
