#include <bits/stdc++.h>
using namespace std;
int n;
int N;
vector<vector<int> > matrix;
vector<int> totalUnique;
inline void read() {
  scanf("%d", &n);
  N = (n * (n - 1)) / 2;
  int a, tmp;
  matrix.assign(300, vector<int>());
  set<int> totalUnique_;
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &a);
    for (int j = 0; j < a; ++j) {
      scanf("%d", &tmp);
      tmp;
      matrix[tmp].push_back(i);
      totalUnique_.insert(tmp);
    }
  }
  totalUnique.clear();
  for (typeof((totalUnique_).begin()) it = (totalUnique_).begin();
       it != (totalUnique_).end(); it++)
    totalUnique.push_back(*it);
}
inline void proc() {
  vector<vector<int> > final_res;
  vector<bool> visited(300, 0);
  for (int i = 0; i < (int)(totalUnique).size(); ++i) {
    int tmp = totalUnique[i];
    if (visited[tmp]) continue;
    vector<int> res;
    res.push_back(tmp);
    visited[tmp] = true;
    for (int j = i + 1; j < (int)(totalUnique).size(); ++j) {
      int tmp2 = totalUnique[j];
      if (visited[tmp2]) continue;
      if ((int)(matrix[tmp]).size() != (int)(matrix[tmp2]).size()) continue;
      if (matrix[tmp] == matrix[tmp2]) {
        visited[tmp2] = true;
        res.push_back(tmp2);
      }
    }
    final_res.push_back(res);
  }
  if ((int)(final_res).size() == 1) {
    printf("1");
    printf(" %d\n", final_res[0][0]);
    printf("%d", (int)(final_res[0]).size() - 1);
    for (int i = 1; i < (int)(final_res[0]).size(); ++i) {
      printf(" %d", final_res[0][i]);
    }
    printf("\n");
  } else {
    for (int i = 0; i < (int)(final_res).size(); ++i) {
      printf("%d", (int)(final_res[i]).size());
      for (int j = 0; j < (int)(final_res[i]).size(); ++j) {
        printf(" %d", final_res[i][j]);
      }
      printf("\n");
    }
  }
}
int main() {
  read();
  proc();
  return 0;
}
