#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int N = 2e5 + 3;
vector<int> g[N];
vector<int> ans[N];
bool mark[N];
vector<int> order;
void dfs(int u) {
  order.push_back(u);
  mark[u] = 1;
  for (auto v : g[u]) {
    if (mark[v]) continue;
    dfs(v);
    order.push_back(u);
  }
}
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1);
  int each = (order.size() + k - 1) / k;
  int rem = order.size(), pos = order.size() - 1;
  for (int i = k; i >= 1; --i) {
    if (1LL * each * (i - 1) < rem) {
      int dif = rem - each * (i - 1);
      rem -= dif;
      for (int j = 0; j < dif; ++j) ans[i].push_back(order[pos--]);
      break;
    }
    ans[i].push_back(order[pos--]);
    --rem;
  }
  for (int i = 1; i <= rem / each; ++i)
    for (int j = 0; j < each; ++j) ans[i].push_back(order[i * each - each + j]);
  for (int i = 1; i <= k; ++i) {
    cout << ans[i].size() << ' ';
    for (auto u : ans[i]) cout << u << ' ';
    cout << '\n';
  }
}
void InputSetup() {
  ios::sync_with_stdio(false);
  cin.tie(0);
}
int main(void) {
  auto start = chrono::high_resolution_clock::now();
  InputSetup();
  solve();
  auto finish = chrono::high_resolution_clock::now();
  cerr << "Time elapsed: "
       << (chrono::duration<long double>(finish - start)).count() << "s\n";
}
