#include <bits/stdc++.h>
using namespace std;
string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
const long double pie = 3.1415926535897932384626;
const long long mod = 1e9 + 7;
const int N = 2e5 + 10;
vector<int> g[N];
int n, m, k;
void read() {
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
}
int indx = 0;
int order[N + N + 10];
bool vis[N];
void dfs(int node) {
  order[indx++] = node;
  vis[node] = 1;
  for (auto &i : g[node]) {
    if (vis[i]) continue;
    ;
    dfs(i);
    order[indx++] = node;
  }
}
void solve(int test_case) {
  read();
  dfs(1);
  int limit = 1 + ((2 * n - 1) / k);
  int i = 0;
  int to_place = k;
  while (i < indx && (to_place != 0)) {
    int maxx = min(i + limit, indx);
    vector<int> temp;
    while (i < maxx) {
      temp.push_back(order[i]);
      i++;
    }
    to_place--;
    int z = temp.size();
    cout << z << " ";
    for (auto &i : temp) cout << i << " ";
    cout << "\n";
    ;
  }
  while (to_place--) cout << 1 << " " << 1, cout << "\n";
  ;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve(i);
  }
  return 0;
}
