#include <bits/stdc++.h>
using namespace std;
void setup() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
}
const int N = 1e5 + 228;
vector<int> G[N];
int s, f;
int used[N];
int pr[N];
int d[N];
bool dfs(int v, int p, int h) {
  used[v] = 1;
  d[v] = h;
  for (auto i : G[v]) {
    if (i == p) continue;
    if (used[i]) {
      s = i, f = v;
      return true;
    }
    pr[i] = v;
    auto z = dfs(i, v, h + 1);
    if (z) return true;
  }
  return false;
}
signed main() {
  setup();
  fill(used, used + N, 0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    G[a - 1].push_back(b - 1);
    G[b - 1].push_back(a - 1);
  }
  dfs(0, -1, 0);
  if (m == n - 1) {
    int kol1 = 0;
    for (int i = 0; i < n; ++i) kol1 += d[i] % 2;
    cout << 1 << '\n';
    if (kol1 >= (k + 1) / 2) {
      int kol = 0;
      for (int i = 0; i < n; ++i) {
        if (d[i] % 2 == 1) {
          cout << i + 1 << ' ';
          if ((k + 1) / 2 <= ++kol) return 0;
        }
      }
    } else {
      int kol = 0;
      for (int i = 0; i < n; ++i) {
        if (d[i] % 2 == 0) {
          cout << i + 1 << ' ';
          if ((k + 1) / 2 <= ++kol) return 0;
        }
      }
    }
  }
  vector<int> cyc;
  for (int i = f; i != s; i = pr[i]) cyc.push_back(i);
  cyc.push_back(s);
  vector<int> who(n);
  vector<int> c(n);
  for (int i = 0; i < cyc.size(); ++i) {
    who[cyc[i]] = i;
    c[cyc[i]] = 1;
  }
  vector<int> now;
  for (int i = 0; i < cyc.size(); ++i) {
    now.push_back(cyc[i]);
    int j = i;
    for (auto v : G[cyc[i]]) {
      if (i == 0 && who[v] == cyc.size() - 1) continue;
      if (c[v]) j = max(j, who[v] - 1);
    }
    i = j;
  }
  if (now.size() <= k) {
    cout << 2 << '\n';
    cout << now.size() << '\n';
    for (auto i : now) cout << i + 1 << ' ';
    cout << '\n';
  } else {
    cout << 1 << '\n';
    for (int i = 0; i < (k + 1) / 2; ++i) cout << now[i * 2] + 1 << ' ';
    cout << '\n';
  }
}
