#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > ans;
int main() {
  int n;
  cin >> n;
  bool mark[201] = {false};
  for (int i = 0; i < n * (n - 1) / 2; i += 2) {
    int arr[201];
    for (int j = 0; j < 201; j++) arr[j] = 0;
    int s1;
    cin >> s1;
    int a1[s1];
    for (int j = 0; j < s1; j++) cin >> a1[j];
    if (n == 2) {
      cout << 1 << " " << a1[0] << endl << s1 - 1 << " ";
      for (int j = 1; j < s1; j++) cout << a1[j] << " ";
      return 0;
    }
    int s2;
    cin >> s2;
    int a2[s2];
    for (int j = 0; j < s2; j++) cin >> a2[j];
    sort(a1, a1 + s1), sort(a2, a2 + s2);
    for (int j = 0; j < s1; j++) {
      arr[a1[j]]++;
    }
    for (int j = 0; j < s2; j++) {
      arr[a2[j]]++;
    }
    vector<int> a, b, c;
    for (int j = 1; j < 201; j++) {
      if (arr[j] == 2 && !mark[j]) a.push_back(j);
    }
    for (int j = 0; j < s1; j++) {
      if (arr[a1[j]] == 1 && !mark[a1[j]]) b.push_back(a1[j]);
    }
    for (int j = 0; j < s2; j++) {
      if (arr[a2[j]] == 1 && !mark[a2[j]]) c.push_back(a2[j]);
    }
    if (a.size() != 0) {
      for (int j = 0; j < a.size(); j++) mark[a[j]] = true;
      ans.push_back(a);
    }
    if (b.size() != 0) {
      for (int j = 0; j < b.size(); j++) mark[b[j]] = true;
      ans.push_back(b);
    }
    if (c.size() != 0) {
      for (int j = 0; j < c.size(); j++) mark[c[j]] = true;
      ans.push_back(c);
    }
    if (ans.size() == n) break;
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].size() << " ";
    for (int j = 0; j < ans[i].size(); j++) cout << ans[i][j] << " ";
    cout << endl;
  }
  return 0;
}
