#include <bits/stdc++.h>
using namespace std;
vector<int> path, vis(200010, false);
vector<int> graph[200010];
int ctr = 0;
int n, m, k;
void dfs(int node) {
  vis[node] = true;
  path.push_back(node);
  ctr++;
  for (int i = 0; i < graph[node].size(); ++i) {
    if (!vis[graph[node][i]]) {
      vis[graph[node][i]] = true;
      dfs(graph[node][i]);
      if (ctr < n) path.push_back(node);
    }
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  map<pair<int, int>, int> mp;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    if (a == b) continue;
    if (mp.find(make_pair(a, b)) == mp.end()) {
      graph[a].push_back(b);
      graph[b].push_back(a);
      mp[make_pair(a, b)] = 1;
      mp[make_pair(b, a)] = 1;
    }
  }
  dfs(1);
  int div = ceil((2.0 * n) / k);
  vector<int> ans[k];
  int kk = 0;
  for (int i = 0; i < path.size(); ++i) {
    ans[kk].push_back(path[i]);
    if ((i + 1) % div == 0) kk++;
  }
  for (int i = 0; i < k; ++i) {
    if (ans[i].size() == 0) {
      cout << 1 << " " << 1 << endl;
    } else {
      cout << ans[i].size() << " ";
      for (int j = 0; j < ans[i].size(); ++j) {
        cout << ans[i][j] << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
