#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
static void amax(T &x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
static void amin(T &x, U y) {
  if (x > y) x = y;
}
const int N = 2e5 + 9;
vector<int> graph[N];
vector<int> visit(N);
vector<int> way;
void dfs(int u) {
  visit[u] = 1;
  way.push_back(u);
  for (auto v : graph[u]) {
    if (!visit[v]) {
      dfs(v);
      way.push_back(u);
    }
  }
}
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < (m); i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  dfs(1);
  int ptr = 0;
  for (int i = 0; i < (k); i++) {
    int cnt = 0;
    int sw = way.size();
    vector<int> ans;
    while (ptr < sw && cnt < (2 * n + k - 1) / k)
      ans.push_back(way[ptr++]), ++cnt;
    if (ans.size() == 0) ans.push_back(1);
    printf("%d ", ans.size());
    for (int i = 0; i < (ans.size()); i++) printf("%d ", ans[i]);
    printf("\n");
  }
  return 0;
}
