#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
vector<int> son[N];
int fa[N];
int dep[N];
int num[N];
int d;
int n, m;
int jjj;
vector<int> ans;
int mi, st;
void dfs(int x) {
  if (ans.size()) return;
  for (int i = 0; i < son[x].size(); i++) {
    if (son[x][i] != fa[x]) {
      if (dep[son[x][i]]) {
        int s = abs(dep[x] - dep[son[x][i]]) + 1;
        if (mi > s) mi = s, st = x;
        if (s <= jjj && ans.size() == 0) {
          int h = x;
          while (h != son[x][i]) {
            ans.push_back(h);
            h = fa[h];
          }
          ans.push_back(h);
          return;
        }
        continue;
      }
      fa[son[x][i]] = x;
      dep[son[x][i]] = dep[x] + 1;
      dfs(son[x][i]);
    }
  }
}
int main() {
  cin >> n >> m >> jjj;
  mi = n + 1;
  for (int i = 0; i < m; i++) {
    int a1, a2;
    cin >> a1 >> a2;
    son[a1].push_back(a2);
    son[a2].push_back(a1);
  }
  dep[1] = 1;
  dfs(1);
  if (ans.size()) {
    cout << 2 << endl << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++) cout << ans[i] << ' ';
    cout << endl;
    return 0;
  }
  if (mi == n + 1) {
    vector<int> kk[2];
    for (int i = 1; i <= n; i++) {
      kk[dep[i] % 2].push_back(i);
    }
    for (int i = 0; i < 2; i++) {
      if (kk[i].size() >= (jjj + 1) / 2) {
        cout << 1 << endl;
        for (int j = 0; j < (jjj + 1) / 2; j++) cout << kk[i][j] << ' ';
        cout << endl;
        return 0;
      }
    }
  }
  int vis[N] = {0};
  vector<int> ind;
  for (int i = 0; i < son[st].size(); i++) {
    if (son[st][i] != fa[st]) vis[son[st][i]] = 1;
  }
  int h = st;
  ind.push_back(h);
  while (vis[h] == 0) {
    h = fa[h];
    ind.push_back(h);
  }
  puts("1");
  int d4 = (jjj + 1) / 2;
  int ddd = 0;
  for (int i = 0; i < ind.size(); i += 2) {
    cout << ind[i] << ' ';
    ddd++;
    if (ddd == d4) break;
  }
  cout << endl;
}
