#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
vector<int> ans;
vector<bool> vis;
void dfs(int i) {
  vis[i] = true, ans.push_back(i + 1);
  for (int j : g[i])
    if (!vis[j]) dfs(j), ans.push_back(i + 1);
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  g.resize(n), vis.assign(n, false);
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    g[x].push_back(y), g[y].push_back(x);
  }
  dfs(0);
  vector<vector<int>> tmp(k);
  int mx = (2 * n - 1) / k + 1;
  for (int i = 0; i < ans.size(); ++i) tmp[i / mx].push_back(ans[i]);
  for (auto i : tmp) {
    if (i.empty()) i.push_back(1);
    cout << i.size();
    for (int j : i) cout << ' ' << j;
    cout << '\n';
  }
}
