#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
vector<int> adj[N];
bool vis[N];
int num = 0, path[N * 2];
void dfs(int x) {
  int u, i;
  path[++num] = x;
  vis[x] = 1;
  for (i = 0; i < adj[x].size(); ++i) {
    u = adj[x][i];
    if (!vis[u]) {
      dfs(u);
      path[++num] = x;
    }
  }
}
int main() {
  int u, j, rem, t, m, k, n, i, x, y;
  cin >> n >> m >> k;
  for (i = 0; i < m; ++i)
    scanf("%d%d", &x, &y), adj[x].push_back(y), adj[y].push_back(x);
  dfs(1);
  u = 1;
  rem = num % k;
  for (i = 0; i < k; ++i) {
    t = num / k;
    if (i < rem) ++t;
    printf("%d ", t);
    for (j = 0; j < t; ++j) printf("%d ", path[u++]);
    cout << endl;
  }
}
