#include <bits/stdc++.h>
using namespace std;
const int N = 300000;
int n, m, k;
int used[N];
int l, d;
vector<int> g[N], tr[N];
vector<int> ans[N];
void dfs1(int v, int p = -1) {
  used[v] = 1;
  for (auto u : g[v]) {
    if (used[u]) continue;
    tr[v].push_back(u);
    dfs1(u, v);
  }
}
void dfs2(int v, int p = -1) {
  used[v] = 1;
  ans[l].push_back(v);
  if (ans[l].size() == d) l++;
  for (auto u : tr[v]) {
    if (u == p) continue;
    dfs2(u, v);
    ans[l].push_back(v);
    if (ans[l].size() == d) l++;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs1(1);
  d = (n + n) / k + 1 - ((n + n) % k == 0);
  dfs2(1);
  int l = 0;
  for (int i = 0; i < k; i++) {
    if (ans[i].size() == 0) ans[i].push_back(1);
    cout << ans[i].size() << endl;
    for (auto j : ans[i]) {
      cout << j << " ";
    }
    cout << endl;
  }
}
