#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int main() {
  bool** mas;
  int n;
  scanf("%d", &n);
  int t = n * (n - 1) >> 1;
  mas = new bool*[t];
  for (int i = 0; i < t; ++i) {
    mas[i] = new bool[200];
    for (int j = 0; j < 200; ++j) mas[i][j] = false;
  }
  int k;
  bool used[200];
  for (int j = 0; j < 200; ++j) used[j] = false;
  int tmp;
  vector<int>* ukaz = new vector<int>[200];
  for (int i = 0; i < t; ++i) {
    scanf("%d", &k);
    for (int j = 0; j < k; ++j) {
      scanf("%d", &tmp);
      --tmp;
      mas[i][tmp] = true;
      ukaz[tmp].push_back(i);
    }
  }
  if (n == 2) {
    int i;
    for (i = 0; !mas[0][i]; ++i)
      ;
    printf("1 %d\n%d", i + 1, k - 1);
    for (++i; i < 200; ++i)
      if (mas[0][i]) printf(" %d", i + 1);
    return 0;
  }
  vector<int>* answ = new vector<int>[n];
  int curr = 0;
  for (int i = 0; i < 200; ++i) {
    if (!used[i] && !ukaz[i].empty()) {
      for (int j = 0; j < 200; ++j) {
        if (mas[ukaz[i][0]][j] && mas[ukaz[i][1]][j]) {
          used[j] = true;
          answ[curr].push_back(j);
        }
      }
      ++curr;
    }
  }
  for (int i = 0; i < n; ++i) {
    printf("%d", (int)answ[i].size());
    for (int j = 0; j < answ[i].size(); ++j) printf(" %d", answ[i][j] + 1);
    printf("\n");
  }
  return 0;
}
