#include <bits/stdc++.h>
using namespace std;
int n, m, k, uu, vv, vis[100100], dep[100100], uind[100100];
int istk[100100];
vector<int> stk;
vector<int> ga[100100];
void dfs(int u, int p) {
  vis[u] = istk[u] = 1;
  dep[u] = stk.size();
  stk.push_back(u);
  for (int v : ga[u]) {
    if (v == p) continue;
    if (!uind[u]) uind[v] = 1;
    if (vis[v]) {
      if (!istk[v]) continue;
      if (dep[u] - dep[v] + 1 <= k) {
        cout << 2 << endl << dep[u] - dep[v] + 1 << endl;
        for (int i = dep[v]; i <= dep[u]; i++) cout << stk[i] << ' ';
        cout << endl;
        exit(0);
      }
    } else {
      dfs(v, u);
    }
  }
  stk.pop_back();
  istk[u] = 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    cin >> uu >> vv;
    ga[uu].push_back(vv);
    ga[vv].push_back(uu);
  }
  vector<int> ind;
  int kk = (k + 1) / 2;
  memset(uind, 0, sizeof(uind));
  memset(vis, 0, sizeof(vis));
  memset(istk, 0, sizeof(istk));
  ind.clear();
  uind[1] = 1;
  dfs(1, -1);
  for (int i = 1; i <= n; i++) {
    if (uind[i])
      continue;
    else
      ind.push_back(i);
  }
  if (ind.size() >= kk) {
    cout << 1 << endl;
    for (int i = 0; i < kk; i++) cout << ind[i] << ' ';
    cout << endl;
    return 0;
  }
  memset(uind, 0, sizeof(uind));
  memset(vis, 0, sizeof(vis));
  memset(istk, 0, sizeof(istk));
  ind.clear();
  stk.clear();
  dfs(1, -1);
  for (int i = 1; i <= n; i++) {
    if (uind[i])
      continue;
    else
      ind.push_back(i);
  }
  if (ind.size() >= kk) {
    cout << 1 << endl;
    for (int i = 0; i < kk; i++) cout << ind[i] << ' ';
    cout << endl;
    return 0;
  }
  return 0;
}
