#include <bits/stdc++.h>
using namespace std;
vector<int> c[500];
int numbers[500];
int used[500];
int d[300][300];
int main() {
  int n;
  cin >> n;
  if (n == 2) {
    int k;
    cin >> k;
    int a;
    cin >> a;
    cout << "1 " << a << endl;
    cout << k - 1;
    for (int i = 0; i < k - 1; ++i) {
      cin >> a;
      cout << " " << a;
    }
    cout << endl;
    return 0;
  }
  memset(numbers, 0, sizeof(numbers));
  memset(d, 0, sizeof(d));
  for (int i = 0; i < n * (n - 1) / 2; ++i) {
    int k;
    cin >> k;
    for (int j = 0; j < k; ++j) {
      int a;
      cin >> a;
      numbers[a] = 1;
      c[a].push_back(i);
    }
  }
  for (int i = 0; i < 500; ++i) {
    if (numbers[i]) {
      used[i] = 0;
      for (int j = i + 1; j < 500; ++j) {
        if (numbers[j]) {
          if (c[i] == c[j]) {
            d[i][j] = d[j][i] = 1;
          }
        }
      }
    }
  }
  for (int i = 0; i < 300; ++i) {
    if (numbers[i] && !used[i]) {
      used[i] = 1;
      vector<int> res;
      res.push_back(i);
      for (int j = 0; j < 300; ++j) {
        if (d[i][j]) {
          res.push_back(j);
          used[j] = 1;
        }
      }
      cout << res.size();
      for (int j = 0; j < res.size(); ++j) {
        cout << " " << res[j];
      }
      cout << endl;
    }
  }
  return 0;
}
