#include <bits/stdc++.h>
int head[200001], next[399999], to[399999], N, E, f[200001], M, K, W[400000], L,
    q[200001], fa[200001], ue[200001], D;
int F(int x) { return f[x] == x ? x : f[x] = F(f[x]); }
int main() {
  scanf("%d%d%d", &N, &M, &K);
  for (int i = 1; i <= N; i++) f[i] = i;
  for (int i = 1, u, v; i <= M; i++) {
    scanf("%d%d", &u, &v);
    int fu = F(u), fv = F(v);
    if (fu != fv) {
      next[++E] = head[u], to[E] = v, head[u] = E;
      next[++E] = head[v], to[E] = u, head[v] = E;
      f[fu] = fv;
    }
  }
  q[1] = 1;
  ue[1] = head[1];
  D = 1;
  W[L = 1] = 1;
  while (D) {
    if (ue[D] && to[ue[D]] == fa[q[D]]) ue[D] = next[ue[D]];
    if (ue[D]) {
      int To = to[ue[D]];
      ue[D] = next[ue[D]];
      fa[To] = q[D];
      q[++D] = To;
      ue[D] = head[To];
      W[++L] = To;
    } else if (--D)
      W[++L] = q[D];
  }
  int lim = (N + N + K - 1) / K, cur = 1;
  for (int i = 1; i <= K; i++)
    if (cur > L)
      puts("1 1");
    else {
      printf("%d", std::min(lim, L - cur + 1));
      for (int j = 1; j <= lim && cur <= L; j++) printf(" %d", W[cur++]);
      puts("");
    }
  return 0;
}
