#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 30);
int Rand() { return (rand() << 16) | rand(); }
int i, j, k, row, N, n, x[201 * 202 / 100], len, last[201 * 202],
    cnt[201 * 202];
vector<int> v[201 * 202];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  N = n * (n - 1) / 2;
  if (n == 2) {
    cin >> k;
    for (i = 1; i <= k; i++) {
      cin >> j;
      if (i & 1)
        v[1].push_back(j);
      else
        v[2].push_back(j);
    }
    for (i = 1; i <= 2; i++)
      if ((int)(v[i]).size()) {
        int len = (int)(v[i]).size();
        cout << len << " ";
        for (j = 0; j < len; j++) cout << v[i][j] << " ";
        cout << endl;
      }
    return 0;
  }
  for (row = 1; row <= N; row++) {
    cin >> k;
    for (i = 1; i <= k; i++) cin >> x[i];
    for (i = 1; i <= k; i++) {
      cnt[x[i]]++;
      if (cnt[x[i]] == n - 1) v[last[x[i]]].push_back(x[i]);
    }
    for (i = 1; i <= k; i++)
      if ((int)(v[last[x[i]]]).size()) {
        int len = (int)(v[last[x[i]]]).size();
        cout << len << " ";
        for (j = 0; j < len; j++) cout << v[last[x[i]]][j] << " ";
        cout << endl;
        v[last[x[i]]].clear();
      }
    for (i = 1; i <= k; i++) last[x[i]] = row;
  }
  return 0;
}
