#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long Inf = 1e18 + 9;
const int N = 200001;
int key[N * 2], Next[N * 2], pos = 0;
int key2[N * 2], Next2[N * 2], pos2 = 0;
int n, m, k, c, c1, p;
int v[N], v2[N];
int ans[N];
bool was[N];
void go(int t) {
  c1--;
  ans[p]++;
  Next2[pos2] = v2[p];
  key2[pos2] = t;
  v2[p] = pos2++;
  if (c1 == 0) {
    c1 = c;
    p++;
  }
}
void dfs(int t) {
  was[t] = true;
  go(t);
  for (int i = v[t]; i != -1; i = Next[i]) {
    int j = key[i];
    if (was[j]) continue;
    dfs(j);
    go(t);
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) v[i] = -1;
  for (int i = 1; i <= k; i++) v2[i] = -1;
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    Next[pos] = v[a];
    key[pos] = b;
    v[a] = pos++;
    Next[pos] = v[b];
    key[pos] = a;
    v[b] = pos++;
  }
  c = (2 * n) / k + int((2 * n) % k != 0);
  p = 1, c1 = c;
  dfs(1);
  for (int i = 1; i <= k; i++) {
    if (v2[i] == -1) {
      cout << "1 1\n";
      continue;
    }
    printf("%d ", ans[i]);
    for (int j = v2[i]; j != -1; j = Next2[j]) printf("%d ", key2[j]);
    cout << "\n";
  }
  return 0;
}
