#include <bits/stdc++.h>
using namespace std;
const int N = (int)(1e5) + 1;
bool v[N];
int n, m, x, y, k, path[N], timer, d[N], ans[N], c;
vector<int> g[N];
void DFS(int x) {
  path[++timer] = x, d[x] = timer;
  for (int i = 0; i < g[x].size(); i++)
    if (!d[g[x][i]])
      DFS(g[x][i]);
    else if (d[x] - d[g[x][i]] + 1 <= k and d[x] - d[g[x][i]] + 1 > 2) {
      cout << "2" << endl;
      cout << d[x] - d[g[x][i]] + 1 << endl;
      for (int j = d[g[x][i]]; j <= d[x]; j++) cout << path[j] << ' ';
      exit(0);
    }
  if (!v[x]) {
    ans[++c] = x;
    for (int i = 0; i < g[x].size(); i++) v[g[x][i]] = true;
  }
  timer--;
}
int main() {
  cin >> n >> m >> k;
  while (m-- and cin >> x >> y) {
    g[x].push_back(y);
    g[y].push_back(x);
  }
  DFS(1);
  k = (k + 1) / 2;
  cout << "1" << endl;
  for (int i = 1; i <= k; i++) cout << ans[i] << ' ';
  return 0;
}
