#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MAXN = 210;
const int MOD = 1000000007;
int v[MAXN], c[MAXN][MAXN], ou[MAXN];
bool ex[MAXN];
int main() {
  int n, k, cnt;
  cin >> n;
  memset(ex, 0, sizeof ex);
  for (int i = 0; i < (n * (n - 1)) / 2; ++i) {
    cin >> k;
    for (int j = 0; j < k; ++j) {
      cin >> v[j];
      ex[v[j]] = 1;
      for (int l = 0; l < j; ++l) {
        c[v[l]][v[j]]++;
        c[v[j]][v[l]]++;
      }
    }
  }
  k = 1;
  for (int i = 1; i <= 200; ++i) {
    if (ex[i]) {
      cnt = 1;
      ou[0] = i;
      for (int j = i + 1; j <= 200; ++j) {
        if (ex[j] && c[i][j] == n - 1) ou[cnt++] = j;
      }
      if (n == 2 && k) {
        cnt = 1;
        k = 0;
      }
      cout << cnt << " ";
      for (int j = 0; j < cnt; ++j) {
        cout << ou[j] << " ";
        ex[ou[j]] = 0;
      }
      cout << endl;
    }
  }
  return 0;
}
