#include <bits/stdc++.h>
using namespace std;
inline int nextint() {
  int res = 0;
  char c = 0;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    res = res * 10 + c - '0';
    c = getchar();
  }
  return res;
}
int data[250][250];
vector<int> tmp;
bool used[250];
int main() {
  int n = nextint();
  for (int i = 0; i < (int)(n * (n - 1) / 2); ++i) {
    int k = nextint();
    tmp.resize(k);
    for (int j = 0; j < (int)(k); ++j) tmp[j] = nextint() - 1;
    for (int j1 = 0; j1 < (int)(k); ++j1)
      for (int j2 = 0; j2 < (int)(k); ++j2) ++data[tmp[j1]][tmp[j2]];
  }
  if (n == 2) {
    tmp.clear();
    for (int i = 0; i < (int)(200); ++i)
      if (data[i][i]) tmp.push_back(i + 1);
    cout << 1 << " " << tmp[0] << endl;
    cout << (tmp.size() - 1);
    for (int i = 0; i < (int)(tmp.size()); ++i)
      if (i) cout << " " << tmp[i];
    cout << endl;
    return 0;
  }
  for (int i = 0; i < (int)(200); ++i)
    if (data[i][i]) {
      if (used[i]) continue;
      tmp.clear();
      used[i] = true;
      tmp.push_back(i + 1);
      int m = data[i][i];
      for (int j = 0; j < (int)(200); ++j)
        if (data[i][j] == m && j != i) {
          assert(!used[j]);
          used[j] = true;
          tmp.push_back(j + 1);
        }
      cout << tmp.size();
      for (int j = 0; j < (int)(tmp.size()); ++j) cout << " " << tmp[j];
      cout << endl;
    }
  return 0;
}
