#include <bits/stdc++.h>
using namespace std;
int c = 0;
int n, m, k;
vector<vector<int> > adjList(410510);
vector<int> stacka(410510);
bitset<410510> isVisited;
void dfsVisit(int s) {
  isVisited.set(s);
  stacka[c] = s;
  c++;
  for (int i = 0; i < adjList[s].size(); i++) {
    int v = adjList[s][i];
    if (!(isVisited.test(v))) {
      dfsVisit(v);
      stacka[c] = s;
      c++;
    }
  }
}
int main() {
  isVisited.reset();
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    adjList[x].push_back(y);
    adjList[y].push_back(x);
  }
  dfsVisit(1);
  int lenght = c;
  c = 0;
  int div = int(std::ceil(2.0 * n / k));
  for (int i = 0; i < k; i++) {
    if (lenght <= 0) {
      printf("1 %d\n", stacka[0]);
      continue;
    }
    if (div > lenght) {
      printf("%d", lenght);
    } else {
      printf("%d", div);
    }
    for (int j = 0; j < div; j++) {
      if (lenght > 0) {
        lenght--;
        printf(" %d", stacka[c]);
        c++;
      }
    }
    printf("\n");
  }
  return 0;
}
