#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, n, t, ch = 0;
  vector<vector<int> > sets;
  vector<vector<int> > out;
  vector<int> theOne;
  vector<int> in;
  map<int, int> mp;
  cin >> x;
  t = x * (x - 1) / 2;
  if (x == 2) {
    cin >> n;
    for (int r = 0; r < n; r++) {
      cin >> y;
      in.push_back(y);
    }
    cout << 1 << " " << in[0] << endl;
    cout << n - 1 << " ";
    for (int r = 1; r < n; r++) cout << in[r] << " ";
    return 0;
  }
  cin >> n;
  for (int r = 0; r < n; r++) {
    cin >> y;
    mp[y]++;
    in.push_back(y);
  }
  sets.push_back(in);
  in.clear();
  for (int i = 0; i < t - 1; i++) {
    cin >> n;
    for (int r = 0; r < n; r++) {
      cin >> y;
      in.push_back(y);
      if (mp[y] == 1 && ch == 0) ch = 1;
    }
    if (ch == 1) {
      ch = 3;
      for (int r = 0; r < n; r++) {
        if (mp[in[r]] != 1) theOne.push_back(in[r]);
      }
      mp.clear();
      for (int r = 0; r < theOne.size(); r++) mp[theOne[r]]++;
      out.push_back(theOne);
      theOne.clear();
    }
    sets.push_back(in);
    in.clear();
  }
  for (int i = 0; i < t; i++) {
    for (int r = 0; r < sets[i].size(); r++) {
      if (mp[sets[i][r]] == 1) {
        for (int j = 0; j < sets[i].size(); j++) {
          if (mp[sets[i][j]] != 1) theOne.push_back(sets[i][j]);
        }
        out.push_back(theOne);
        theOne.clear();
        break;
      }
    }
  }
  cout << endl;
  for (int i = 0; i < x; i++) {
    cout << out[i].size() << " ";
    for (int r = 0; r < out[i].size(); r++) cout << out[i][r] << " ";
    cout << endl;
  }
}
