#include <bits/stdc++.h>
using namespace std;
const int p = 1e8 + 7;
int ans1;
int ans2;
int ans3;
int n, m, x, y, k;
vector<int> v[1001000], ans;
int d[100010], vis[100100], nd;
void dfs(int x, int fa) {
  ans.push_back(x);
  d[x] = ans.size();
  for (auto i : v[x]) {
    if (i == fa) continue;
    if (!d[i])
      dfs(i, x);
    else if (d[x] - d[i] + 1 <= k && d[x] - d[i] + 1 >= 0) {
      printf("2\n%d\n", d[x] - d[i] + 1);
      for (int j = d[i] - 1; j < d[x]; j++) printf("%d ", ans[j]);
      printf("\n");
      exit(0);
    }
  }
  if (!vis[x])
    for (auto i : v[x]) vis[i] = 1;
  ans.pop_back();
}
int main() {
  cin >> n >> m >> k;
  nd = k / 2;
  if (k % 2) nd++;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    v[x].push_back(y), v[y].push_back(x);
  }
  dfs(1, 0);
  printf("1\n");
  for (int i = 1; i <= n && nd; i++)
    if (!vis[i]) printf("%d ", i), nd--;
}
