#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
vector<int> a[100100];
vector<int> b[210];
bool use[210], use1[210];
int kol[210];
void calc(int v) {
  memset(kol, 0, sizeof(kol));
  vector<int> helper;
  for (int i = 0; i < b[v].size(); i++)
    for (int j = 0; j < a[b[v][i]].size(); j++) kol[a[b[v][i]][j]]++;
  for (int i = 0; i < 210; i++)
    if (kol[i] > 1) {
      helper.push_back(i);
      use[i] = true;
    }
  printf("%d ", helper.size());
  for (int i = 0; i < helper.size(); i++) printf("%d ", helper[i]);
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  if (n == 2) {
    int k;
    cin >> k;
    int t;
    cin >> t;
    printf("1 %d\n", t);
    cout << k - 1 << ' ';
    for (int i = 0; i < k - 1; i++) {
      scanf("%d", &t);
      cout << t << ' ';
    }
    return 0;
  }
  for (int i = 0; i < (n * (n - 1)) / 2; i++) {
    int k;
    scanf("%d", &k);
    for (int j = 0; j < k; j++) {
      int t;
      scanf("%d", &t);
      use1[t] = true;
      b[t].push_back(i);
      a[i].push_back(t);
    }
  }
  for (int i = 0; i < 210; i++)
    if (!use[i] && use1[i]) calc(i);
  return 0;
}
