#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, inf = 0x3f3f3f3f;
vector<int> e[N];
bool vis[N];
int dep[N], fa[N];
int n, m, k;
void dfs(int u, int f, int d) {
  dep[u] = d, fa[u] = f;
  for (auto v : e[u]) {
    if (!dep[v])
      dfs(v, u, d + 1);
    else {
      int len = dep[u] - dep[v] + 1;
      if (len > 2 && len <= k) {
        printf("2\n%d\n%d ", len, v);
        int x = u;
        while (x != v) {
          printf("%d ", x);
          x = fa[x];
        }
        exit(0);
      }
    }
  }
  if (!vis[u])
    for (auto v : e[u]) vis[v] = 1;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1, u, v; i <= m; i++) {
    scanf("%d%d", &u, &v);
    e[u].push_back(v), e[v].push_back(u);
  }
  dfs(1, 0, 1);
  k = (k + 1) / 2;
  printf("1\n");
  int cnt = 0;
  for (int i = 1; i <= n && cnt < k; i++) {
    if (!vis[i]) printf("%d ", i), cnt++;
  }
  return 0;
}
