#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 50;
vector<int> p, E[MAXN], col[2];
deque<int> cicrle;
int u[MAXN], v[MAXN], pos[MAXN];
bool in_cicrle[MAXN];
void dfs(int x, int fa = 0) {
  pos[x] = p.size();
  p.push_back(x);
  col[p.size() % 2].push_back(x);
  for (auto &go : E[x]) {
    if (go == fa) continue;
    if (pos[go] == -1)
      dfs(go, x);
    else {
      if (cicrle.empty()) {
        for (int i = pos[go]; i <= pos[x]; ++i) {
          cicrle.push_back(p[i]);
          in_cicrle[p[i]] = true;
        }
      }
    }
  }
  p.pop_back();
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  memset(pos, -1, sizeof(pos));
  p.clear();
  cicrle.clear();
  for (int i = 0; i <= n; ++i) E[i].clear();
  for (int i = 0; i < m; ++i) {
    cin >> u[i] >> v[i];
    E[u[i]].push_back(v[i]);
    E[v[i]].push_back(u[i]);
  }
  dfs(1);
  if (cicrle.empty()) {
    cout << "1" << endl;
    if (col[0].size() < col[1].size()) swap(col[0], col[1]);
    for (int i = 0; i < ((k + 1) / 2); ++i) cout << col[0][i] << " ";
    cout << endl;
    return 0;
  }
  for (int i = 0; i < m; ++i) {
    if (in_cicrle[v[i]] && in_cicrle[u[i]] && abs(pos[v[i]] - pos[u[i]]) != 1) {
      while (cicrle.front() != v[i] && cicrle.front() != u[i]) {
        in_cicrle[cicrle.front()] = false;
        cicrle.pop_front();
      }
      while (cicrle.back() != v[i] && cicrle.back() != u[i]) {
        in_cicrle[cicrle.back()] = false;
        cicrle.pop_back();
      }
    }
  }
  if (cicrle.size() <= k) {
    cout << "2" << endl;
    cout << cicrle.size() << endl;
    for (int i = 0; i < cicrle.size(); ++i) cout << cicrle[i] << " ";
    cout << endl;
  } else {
    cout << "1" << endl;
    for (int i = 0; i < ((k + 1) / 2); ++i) {
      cout << cicrle[2 * i] << " ";
    }
    cout << endl;
  }
}
