#include <bits/stdc++.h>
using namespace std;
int R[205];
int findset(int u) {
  if (R[u] < 0)
    return u;
  else {
    R[u] = findset(R[u]);
    return R[u];
  }
}
void Union(int u, int v) {
  if (R[u] < R[v]) {
    R[u] += R[v];
    R[v] = u;
  } else {
    R[v] += R[u];
    R[u] = v;
  }
}
class ss {
 public:
  vector<int> z;
};
int F[205][205];
int e[205];
ss tt[205];
int main() {
  int n;
  cin >> n;
  for (int i = (1); i <= (200); i++) tt[i].z.clear();
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    int k;
    cin >> k;
    int a[205];
    for (int j = 0; j < k; j++) cin >> a[j];
    for (int j = 0; j < k; j++) {
      e[a[j]] = 1;
      tt[a[j]].z.push_back(i);
    }
    for (int j = (0); j <= (k - 2); j++)
      for (int t = (j + 1); t <= (k - 1); t++) {
        F[a[j]][a[t]]++;
        F[a[t]][a[j]]++;
      }
  }
  int m = 0;
  for (int i = (1); i <= (200); i++)
    if (e[i]) {
      R[i] = -1;
      m++;
    }
  while (m > n) {
    int ok = 0;
    for (int i = (1); i <= (200); i++) {
      if (e[i])
        for (int j = (1); j <= (200); j++)
          if (e[j] && i != j) {
            if (tt[i].z.size() != tt[j].z.size()) continue;
            if (F[i][j] != F[j][i]) continue;
            int x = findset(i);
            int y = findset(j);
            if (x == y) continue;
            int ok1 = 1;
            for (int i1 = (0); i1 <= (tt[i].z.size() - 1); i1++)
              if (tt[i].z[i1] != tt[j].z[i1]) {
                ok1 = 0;
                break;
              }
            if (ok1 == 0) continue;
            Union(x, y);
            m--;
            ok = 1;
            break;
          }
      if (ok) break;
    }
  }
  for (int i = (1); i <= (200); i++)
    if (e[i] && R[i] < 0) {
      cout << -R[i];
      for (int j = (1); j <= (200); j++)
        if (e[j] && findset(j) == i) cout << " " << j;
      cout << endl;
    }
  return 0;
}
