#include <bits/stdc++.h>
using namespace std;
int n, m, k, step;
vector<bool> used;
vector<vector<int> > g, v;
;
int it, cur;
inline void dfs(int node) {
  used[node] = true;
  cur--;
  if (cur < 0) {
    cur = step - 1;
    it++;
  }
  v[it].push_back(node);
  for (int i = 0; i < (int)g[node].size(); i++) {
    int to = g[node][i];
    if (!used[to]) {
      dfs(to);
      if (cur > 0) v[it].push_back(node);
      cur--;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  cin >> n >> m >> k;
  step = (2 * n + k - 1) / k;
  used.resize(n + 1, false);
  g.resize(n + 1);
  v.resize(n + 1);
  for (int i = 0; i < m; i++) {
    int from, to;
    cin >> from >> to;
    g[from].push_back(to);
    g[to].push_back(from);
  }
  it = 1, cur = step;
  bool checkdfs = false;
  for (int i = 1; i <= n; i++)
    if ((int)g[i].size() == 1) {
      dfs(i);
      checkdfs = true;
      break;
    }
  if (!checkdfs) dfs(1);
  for (int i = 1; i <= k; i++) {
    if ((int)v[i].size() == 0)
      cout << "1 1\n";
    else {
      cout << (int)v[i].size() << ' ';
      for (int j = 0; j < (int)v[i].size(); j++) cout << v[i][j] << ' ';
      cout << '\n';
    }
  }
  return 0;
}
