#include <bits/stdc++.h>
using namespace std;
const int maxx = 200010;
const double pi = acos(-1.0);
const double eps = 1e-15;
map<pair<int, int>, int> hh;
vector<int> g[maxx], h[maxx];
int t, n, m, k, u, v;
int ans = 0, total = 0, sum = 0, cnt = 0, l = 1;
int a[maxx], vis[maxx];
void dfs(int x) {
  h[l].push_back(x), vis[x] = 1;
  if (h[l].size() == total) l++;
  for (int i = 0; i < g[x].size(); i++) {
    int to = g[x][i];
    if (vis[to]) continue;
    dfs(to);
    h[l].push_back(x);
    if (h[l].size() == total) l++;
  }
  return;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  if (2 * n % k)
    total = 2 * n / k + 1;
  else
    total = 2 * n / k;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    if (hh.count(make_pair(u, v))) continue;
    hh[make_pair(u, v)] = hh[make_pair(v, u)] = 1, g[u].push_back(v),
                    g[v].push_back(u);
  }
  dfs(1);
  for (int i = 1; i <= k; i++) {
    if (h[i].size() == 0)
      printf("1 1");
    else {
      printf("%d ", h[i].size());
      for (int j = 0; j < h[i].size(); j++) printf("%d ", h[i][j]);
    }
    printf("\n");
  }
  return 0;
}
