#include <bits/stdc++.h>
using namespace std;
const int maxn = 200 + 10;
const int inf = (-1u) >> 1;
bool vis[maxn];
vector<int> v[maxn];
int n;
int main() {
  while (scanf("%d", &n) != EOF) {
    int tot = n * (n - 1) / 2;
    for (int i = (1); i <= (200); ++i) {
      v[i].clear();
      vis[i] = false;
    }
    for (int i = 0; i < (tot); ++i) {
      int num;
      scanf("%d", &num);
      for (int j = 0; j < (num); ++j) {
        int t;
        scanf("%d", &t);
        v[t].push_back(i);
        if (tot == 1) {
          if (j == 0) {
            printf("1 %d\n", t);
          } else if (j == 1) {
            printf("%d %d", num - 1, t);
          } else {
            printf(" %d", t);
          }
        }
      }
      puts("");
    }
    if (tot == 1) {
      continue;
    }
    for (int i = (1); i <= (200); ++i) {
      sort(v[i].begin(), v[i].end());
    }
    for (int i = (1); i <= (200); ++i) {
      if (!vis[i] && ((int)((v[i]).size())) != 0) {
        vector<int> ans;
        for (int j = (1); j <= (200); ++j) {
          if (v[i] == v[j]) {
            vis[j] = true;
            ans.push_back(j);
          }
        }
        printf("%d", ((int)((ans).size())));
        for (int k = 0; k < (((int)((ans).size()))); ++k) printf(" %d", ans[k]);
        puts("");
      }
    }
  }
  return 0;
}
