#include <bits/stdc++.h>
using namespace std;
const int MN = 200009;
vector<int> g[MN];
vector<int> tree[MN];
int n, k, mlen;
bool used[MN];
void build_dfs(int v) {
  used[v] = 1;
  for (int to : g[v]) {
    if (used[to]) continue;
    tree[v].push_back(to);
    build_dfs(to);
  }
}
void build_tree() { build_dfs(1); }
struct Rob {
  vector<int> vs;
  int rest;
};
vector<Rob> ans;
Rob* dfs(int v, Rob* r) {
  if (!(*r).rest) {
    Rob nw;
    nw.rest = mlen;
    if (ans.size() == k) return r;
    ans.push_back(nw);
    r = &ans[ans.size() - 1];
  }
  (*r).vs.push_back(v);
  (*r).rest--;
  bool first = true;
  for (int to : tree[v]) {
    if (!first) {
      if (!(*r).rest) {
        if (ans.size() == k) return r;
        Rob nw;
        nw.rest = mlen;
        ans.push_back(nw);
        r = &ans[ans.size() - 1];
      }
      (*r).vs.push_back(v);
      (*r).rest--;
    }
    r = dfs(to, r);
    first = false;
  }
  if ((*r).rest && !first) {
    (*r).vs.push_back(v);
    (*r).rest--;
  }
  return r;
}
int main() {
  ios::sync_with_stdio(0);
  int m;
  cin >> n >> m >> k;
  while (m--) {
    int u, v;
    cin >> u >> v;
    if (u == v) continue;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  build_tree();
  mlen = (2 * n) / k + ((2 * n) % k > 0);
  Rob start;
  start.rest = 0;
  dfs(1, &start);
  for (Rob r : ans) {
    cout << r.vs.size() << " ";
    for (int to : r.vs) {
      cout << to << " ";
    }
    cout << endl;
  }
  for (int i = ans.size(); i < k; i++) {
    cout << "2 1 " << tree[1][0] << endl;
    ;
  }
}
