#include <bits/stdc++.h>
using namespace std;
int k;
vector<int> s[1000000];
vector<int> ans[1000000];
int j = 0;
bool used[1000000];
int c = 0;
void dfs(int i) {
  if (used[i]) {
    return;
  }
  used[i] = 1;
  if (c == k) {
    c = 0;
    j++;
  }
  c++;
  ans[j].push_back(i + 1);
  for (auto ii : s[i]) {
    dfs(ii);
    if (c == k) {
      c = 0;
      j++;
    }
    if (ans[j].size() != 0 && ans[j][ans[j].size() - 1] != i + 1) {
      c++;
      ans[j].push_back(i + 1);
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m >> k;
  int kk = k;
  k = (2 * n + k - 1) / k;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    s[a].push_back(b);
    s[b].push_back(a);
  }
  dfs(0);
  for (int i = 0; i < kk; i++) {
    if (ans[i].size() == 0) {
      cout << "1 1\n";
      continue;
    }
    cout << ans[i].size() << ' ';
    for (auto j : ans[i]) {
      cout << j << ' ';
    }
    cout << '\n';
  }
}
