#include <bits/stdc++.h>
using namespace std;
const int MAXN = 205;
bool ok[MAXN], cur[MAXN], already[MAXN];
vector<int> res[MAXN];
vector<int> belong[MAXN];
vector<int> s[MAXN * MAXN];
int n, resCount;
void solve() {
  for (int value = 1; value <= 200; value++) {
    if (belong[value].size() == 0 || already[value]) continue;
    memset(ok, true, sizeof ok);
    for (int _value = 1; _value <= 200; _value++) ok[_value] = !already[_value];
    for (size_t j = 0; j < belong[value].size(); j++) {
      int setIndex = belong[value][j];
      memset(cur, false, sizeof cur);
      for (size_t k = 0; k < s[setIndex].size(); k++)
        cur[s[setIndex][k]] = true;
      for (int _value = 1; _value <= 200; _value++) ok[_value] &= cur[_value];
    }
    for (int _value = 1; _value <= 200; _value++)
      if (ok[_value]) {
        res[resCount].push_back(_value);
        already[_value] = true;
      }
    resCount++;
  }
  for (int i = 0; i < resCount; i++) {
    cout << res[i].size();
    for (size_t j = 0; j < res[i].size(); j++) cout << " " << res[i][j];
    cout << endl;
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    int numElements;
    cin >> numElements;
    for (int j = 0; j < numElements; j++) {
      int value;
      cin >> value;
      s[i].push_back(value);
      belong[value].push_back(i);
    }
  }
  if (n == 2) {
    cout << 1 << " " << s[0][0] << endl;
    cout << s[0].size() - 1;
    for (size_t i = 1; i < s[0].size(); i++) cout << " " << s[0][i];
    cout << endl;
    return 0;
  }
  solve();
  return 0;
}
