#include <bits/stdc++.h>
using namespace std;
vector<int> g[100005];
int color[100001];
int ccnt[100001];
bool vis[100001];
bool used[100001];
bool f1;
int ans1;
int n, k, m;
stack<int> ans2;
bool vis2[100001];
void getColor() {
  queue<int> q;
  q.push(1);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    set<int> cs;
    vis[u] = true;
    for (int v : g[u]) {
      if (!vis[v]) {
        if (!used[v]) {
          q.push(v);
          used[v] = true;
        }
      } else {
        cs.insert(color[v]);
      }
    }
    int prev = 0;
    for (int c : cs) {
      if (c != prev + 1) {
        break;
      }
      prev = c;
    }
    color[u] = prev + 1;
    ccnt[color[u]]++;
    if (ccnt[color[u]] >= (k + 1) / 2) {
      f1 = true;
      ans1 = u;
    }
  }
}
bool dfs(int u, int p, int s) {
  vis2[u] = true;
  ans2.push(u);
  for (int v : g[u]) {
    if (v != p && v == s) {
      cout << "2\n" << ans2.size() << "\n";
      while (!ans2.empty()) {
        int t = ans2.top();
        ans2.pop();
        cout << t << " ";
      }
      cout << endl;
      return true;
    } else if (color[v] <= 2 && !vis2[v]) {
      int found = dfs(v, u, s);
      if (found) {
        return true;
      }
    }
  }
  ans2.pop();
  return false;
}
void getCycle() {
  for (int i = 1; i <= n; ++i) {
    if (color[i] == 3) {
      dfs(i, 0, i);
      return;
    }
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  getColor();
  if (f1) {
    cout << "1\n";
    int cnt = 0;
    for (int i = 1; i <= n && cnt < (k + 1) / 2; ++i) {
      if (color[i] == color[ans1]) {
        cout << i << " ";
        cnt++;
      }
    }
    cout << endl;
  } else {
    getCycle();
  }
  return 0;
}
