#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
int T, n, m, k;
int d[maxn];
vector<int> G[maxn];
vector<int> getcircle(int n) {
  int tot = 0;
  vector<int> cir, dfn(n + 1);
  function<int(int, int)> dfs = [&](int x, int fa) -> int {
    dfn[x] = ++tot;
    int mx = 0;
    for (auto v : G[x])
      if (dfn[v] && v != fa) mx = max(mx, dfn[v]);
    if (mx) {
      cir.push_back(x);
      return mx;
    }
    for (auto v : G[x])
      if (!dfn[v]) {
        int ret = dfs(v, x);
        if (ret) {
          if (dfn[x] >= ret) cir.push_back(x);
          return ret;
        }
      }
    return 0;
  };
  for (int i = 1; i <= n; ++i)
    if (!dfn[i] && dfs(i, 0)) return cir;
  return cir;
}
vector<int> s[2];
void dfs2(int x, int fa, int col) {
  s[col ^ 1].push_back(x);
  for (auto v : G[x])
    if (v != fa) {
      dfs2(v, x, col ^ 1);
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  auto cir = getcircle(n);
  if (3 <= ((int)(cir).size())) {
    if (((int)(cir).size()) <= k) {
      cout << 2 << endl << ((int)(cir).size()) << endl;
      for (auto x : cir) {
        cout << x << " ";
      }
      cout << endl;
    } else {
      cout << 1 << endl;
      k = (k + 1) / 2;
      for (int i = 0; i < ((int)(cir).size()); i += 2) {
        if (!k) break;
        cout << cir[i] << " ";
        k--;
      }
      cout << endl;
    }
    return 0;
  }
  dfs2(1, 0, 0);
  vector<int> v;
  if (((int)(s[0]).size()) < ((int)(s[1]).size())) {
    v = s[1];
  } else
    v = s[0];
  cout << 1 << endl;
  for (int i = 1; i <= (k + 1) / 2; ++i) {
    cout << v[i - 1] << " ";
  }
  return 0;
}
