#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
template <typename T>
T binpow(T a, T b, T modi) {
  T res = 1;
  while (b) {
    if (b & 1) {
      res = (res * a) % modi;
    }
    b /= 2;
    (a *= a) %= modi;
  }
  return res;
}
template <typename T>
T binpow(T a, T b) {
  T res = 1;
  while (b) {
    if (b & 1) {
      res = (res * a);
    }
    b /= 2;
    a *= a;
  }
  return res;
}
template <typename T>
T add(T a, T b) {
  return (a + b) % mod;
}
template <typename T>
T sub(T a, T b) {
  return add(a, mod - b);
}
template <typename T>
T mul(T a, T b) {
  return (a * b) % mod;
}
long long make_int(string s) {
  long long x = 0;
  reverse(s.begin(), s.end());
  string tmp = s;
  for (long long i = 0; i < s.length(); ++i) {
    x *= 10;
    x += (long long)(tmp.back() - '0');
    tmp.pop_back();
  }
  return x;
}
string make_string(long long s) {
  string x;
  while (s) {
    x.push_back(char(s % 10 + '0'));
    s /= 10;
  }
  reverse(x.begin(), x.end());
  return x;
}
long long dx[] = {0, -1, 0, 1};
long long dy[] = {1, 0, -1, 0};
const long long inf = 1e18 + 5;
vector<long long> cyc;
vector<vector<long long> > adj, col;
vector<long long> pos, s;
bool dfs(long long root) {
  pos[root] = s.size();
  col[pos[root] % 2].push_back(root);
  s.push_back(root);
  long long low = -1;
  for (long long u : adj[root]) {
    if (pos[u] != -1 && (pos[root] - pos[u] > 1)) {
      low = max(low, pos[u]);
    }
  }
  if (low != -1) {
    for (long long i = low; i <= pos[root]; ++i) {
      cyc.push_back(s[i]);
    }
    return 1;
  }
  for (long long u : adj[root]) {
    if (pos[u] == -1) {
      if (dfs(u)) return 1;
    }
  }
  s.pop_back();
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, k;
  cin >> n >> m >> k;
  adj.resize(n);
  col.resize(2);
  pos.resize(n, -1);
  for (long long i = 0; i < (m); ++i) {
    long long x, y;
    cin >> x >> y;
    --x, --y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs(0);
  if (cyc.empty()) {
    if (col[0].size() < col[1].size()) swap(col[0], col[1]);
    cout << 1 << '\n';
    for (long long i = 0; i < (k + 1) / 2; ++i) {
      cout << col[0][i] + 1 << ' ';
    }
  } else {
    if (cyc.size() <= k) {
      cout << 2 << '\n';
      cout << cyc.size() << '\n';
      for (long long i : cyc) {
        cout << i + 1 << ' ';
      }
    } else {
      cout << 1 << '\n';
      for (long long i = 0; i < (k + 1) / 2; ++i) {
        cout << cyc[2 * i] + 1 << ' ';
      }
    }
  }
  return 0;
}
