#include <bits/stdc++.h>
using namespace std;
string i2s(int x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
int main() {
  int n;
  scanf("%d", &n);
  string mapa[201];
  for (int i = 0; i < 201; i++) mapa[i] = "";
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    int nro;
    scanf("%d", &nro);
    for (int j = 0; j < nro; j++) {
      int t;
      scanf("%d", &t);
      mapa[t] += i2s(i) + ",";
    }
  }
  if (n == 2) {
    bool bo = false;
    vector<int> numb;
    for (int i = 1; i <= 200; i++) {
      if (mapa[i] == "") continue;
      if (!bo) {
        cout << "1 " << i << endl;
        bo = true;
        continue;
      }
      numb.push_back(i);
    }
    int sz = numb.size();
    cout << sz << " ";
    for (int i = 0; i < numb.size(); i++) {
      if (i != 0) cout << " ";
      cout << numb[i];
    }
    cout << endl;
  } else {
    for (int i = 1; i <= 200; i++) {
      if (mapa[i] == "") continue;
      string p = mapa[i];
      mapa[i] = "";
      vector<int> numb;
      numb.push_back(i);
      for (int j = i + 1; j <= 200; j++) {
        if (p == mapa[j]) {
          numb.push_back(j);
          mapa[j] = "";
        }
      }
      int sz = numb.size();
      cout << sz << " ";
      for (int i = 0; i < numb.size(); i++) {
        if (i != 0) cout << " ";
        cout << numb[i];
      }
      cout << endl;
    }
  }
  return 0;
}
