#include <bits/stdc++.h>
#pragma warning(disable : 4786)
using namespace std;
vector<int> v[205 * 205];
set<vector<int> > st;
void print_vec(vector<int> &v) {
  int i;
  for (i = 0; i < (v.size()); i++) printf(" %d", v[i]);
  printf("\n");
}
void find_common(vector<int> &v1, vector<int> &v2, vector<int> &com,
                 vector<int> &uncom) {
  int n1 = v1.size();
  int n2 = v2.size();
  int i, j;
  com.clear();
  uncom.clear();
  j = 0;
  for (i = 0; i < (n2); i++) {
    if (j >= n1) {
      uncom.push_back(v2[i]);
      continue;
    }
    if (v2[i] == v1[j]) {
      com.push_back(v2[i]);
    } else {
      if (v2[i] < v1[j]) {
        uncom.push_back(v2[i]);
        continue;
      }
      while (j < n1 && v2[i] > v1[j]) {
        j++;
      }
      if (j < n1 && v2[i] == v1[j]) {
        com.push_back(v2[i]);
      } else
        uncom.push_back(v2[i]);
    }
  }
}
int main() {
  int n, m, i, j, t, x;
  vector<int> common, uncommon, vec;
  while (scanf(" %d", &n) == 1) {
    m = (n * (n - 1)) / 2;
    for (i = 0; i < (m); i++) {
      scanf(" %d", &t);
      v[i].clear();
      for (j = 0; j < (t); j++) {
        scanf(" %d", &x);
        v[i].push_back(x);
      }
      sort(v[i].begin(), v[i].end());
    }
    if (n == 2) {
      printf("1 %d\n", v[0][0]);
      printf("%d", (int)v[0].size() - 1);
      for (i = 1; i < v[0].size(); i++) {
        printf(" %d", v[0][i]);
      }
      printf("\n");
      continue;
    }
    st.clear();
    for (i = 1; i < m; i++) {
      common.clear();
      find_common(v[0], v[i], common, uncommon);
      if (common.size() != 0) {
        st.insert(uncommon);
        st.insert(common);
      }
    }
    set<vector<int> >::iterator it;
    for (it = st.begin(); it != st.end(); it++) {
      vec = *it;
      printf("%d", vec.size());
      for (i = 0; i < (vec.size()); i++) printf(" %d", vec[i]);
      printf("\n");
    }
  }
  return 0;
}
