Problem: Given a connected undirected graph with n vertices and an integer k, you have to either:

  * either find an independent set that has exactly ⌈k/2⌉ vertices.
  * or find a simple cycle of length at most k. 



An independent set is a set of vertices such that no two of them are connected by an edge. A simple cycle is a cycle that doesn't contain any vertex twice. 

I have a proof that for any input you can always solve at least one of these problems, but it's left as an exercise for the reader.

Input

The first line contains three integers n, m, and k (3 ≤ k ≤ n ≤ 10^5, n-1 ≤ m ≤ 2 ⋅ 10^5) — the number of vertices and edges in the graph, and the parameter k from the statement.

Each of the next m lines contains two integers u and v (1 ≤ u,v ≤ n) that mean there's an edge between vertices u and v. It's guaranteed that the graph is connected and doesn't contain any self-loops or multiple edges.

Output

If you choose to solve the first problem, then on the first line print 1, followed by a line containing ⌈k/2⌉ distinct integers not exceeding n, the vertices in the desired independent set.

If you, however, choose to solve the second problem, then on the first line print 2, followed by a line containing one integer, c, representing the length of the found cycle, followed by a line containing c distinct integers not exceeding n, the vertices in the desired cycle, in the order they appear in the cycle.

Examples

Input


4 4 3
1 2
2 3
3 4
4 1


Output


1
1 3 

Input


4 5 3
1 2
2 3
3 4
4 1
2 4


Output


2
3
2 3 4 

Input


4 6 3
1 2
2 3
3 4
4 1
1 3
2 4


Output


2
3
1 2 3 

Input


5 4 5
1 2
1 3
2 4
2 5


Output


1
1 4 5 

Note

In the first sample:

<image>

Notice that printing the independent set \{2,4\} is also OK, but printing the cycle 1-2-3-4 isn't, because its length must be at most 3.

In the second sample:

<image>

Notice that printing the independent set \{1,3\} or printing the cycle 2-1-4 is also OK.

In the third sample:

<image>

In the fourth sample:

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
template <class C>
void mini(C& a, C b) {
  a = min(a, b);
}
template <class C>
void maxi(C& a, C b) {
  a = max(a, b);
}
void a() {
  int n;
  cin >> n;
  cout << 1 << ' ' << n - 1 << '\n';
}
void b() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  vector<int> b;
  for (int i = 0; i < n; i++) {
    if (i == 0 or a[i] != a[i - 1]) b.push_back(a[i]);
  }
  cout << b.size() << '\n';
}
void c() {
  int n;
  cin >> n;
  vector<vector<int>> grafo(n + 1);
  vector<pair<int, int>> aristas;
  int u, v;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    if (u > v) swap(u, v);
    grafo[u].push_back(v);
    grafo[v].push_back(u);
    aristas.push_back(make_pair(u, v));
  }
  vector<int> hojas;
  vector<int> res(n - 1, -1);
  for (int(i) = 1; i <= n; i++)
    if (hojas.size() < 3 and grafo[i].size() == 1) hojas.push_back(i);
  if (hojas.size() == 3) {
    for (int i = 0; i < 3; i++) {
      u = hojas[i];
      v = grafo[u][0];
      for (int j = 0; j < n - 1; j++)
        if (aristas[j].first == u or aristas[j].second == u) res[j] = i;
    }
  }
  int val = 3;
  for (int i = 0; i < n - 1; i++) {
    if (res[i] == -1) {
      if (val >= n - 1) val = 0;
      res[i] = val;
      val++;
    }
  }
  for (int i = 0; i < n - 1; i++) cout << res[i] << '\n';
}
void d() {
  long long u, v;
  cin >> u >> v;
  if (u == 0 and v == 0) {
    cout << "0\n";
    return;
  }
  if (u == v) {
    cout << "1\n";
    cout << u << '\n';
    return;
  }
  if (v - u >= 0 and (v - u) % 2 == 0 and (((v - u) / 2) & u) == 0) {
    long long b = (v - u) / 2;
    long long a = b;
    long long pot = 1;
    for (int i = 0; i < 63; i++) {
      if (pot & u) a |= pot;
      pot *= 2;
    }
    cout << 2 << '\n';
    cout << a << ' ' << b << '\n';
    return;
  }
  if (v >= u and (v - u) % 2 == 0) {
    v -= u;
    v /= 2;
    cout << "3\n";
    cout << u << ' ' << v << ' ' << v << '\n';
    return;
  }
  cout << -1 << '\n';
}
void f() {
  int n, m;
  cin >> n >> m;
  int sq = 1;
  while (sq * sq < n) sq++;
  vector<set<int>> grafo(n + 1);
  vector<int> d(n + 1);
  int u, v;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    grafo[u].insert(v);
    grafo[v].insert(u);
    d[u]++;
    d[v]++;
  }
  set<pair<int, int>> porD;
  for (int(i) = 1; i <= n; i++) porD.insert(make_pair(d[i], i));
  vector<bool> sirven(n + 1, true);
  set<int> conjInd;
  while (conjInd.size() < sq and !porD.empty()) {
    auto it = porD.begin();
    int nodo = it->second;
    int degree = it->first;
    if (degree >= sq - 1) break;
    for (auto it2 = grafo[nodo].begin(); it2 != grafo[nodo].end(); ++it2) {
      if (sirven[nodo]) sirven[*it2] = false;
      grafo[*it2].erase(nodo);
      porD.erase(make_pair(d[*it2], *it2));
      d[*it2]--;
      porD.insert(make_pair(d[*it2], *it2));
    }
    grafo[nodo].clear();
    porD.erase(make_pair(d[nodo], nodo));
    d[nodo] = 0;
    if (sirven[nodo]) conjInd.insert(nodo);
  }
  if (conjInd.size() == sq) {
    cout << "1\n";
    for (auto it = conjInd.begin(); it != conjInd.end(); ++it)
      cout << *it << ' ';
    cout << '\n';
    return;
  }
  int nodo = 1;
  while (d[nodo] < sq - 1) nodo++;
  set<int> camino;
  camino.insert(nodo);
  vector<int> res;
  res.push_back(nodo);
  while (true) {
    bool agregue = false;
    for (auto it = grafo[nodo].begin(); it != grafo[nodo].end(); ++it) {
      if (camino.count(*it)) continue;
      agregue = true;
      nodo = *it;
      camino.insert(nodo);
      res.push_back(nodo);
      break;
    }
    if (!agregue) break;
  }
  reverse(res.begin(), res.end());
  for (int(i) = res.size() - 1; i >= 0; i--) {
    if (grafo[res[0]].count(res.back())) break;
    res.pop_back();
  }
  cout << "2\n";
  cout << res.size() << '\n';
  for (int i = 0; i < res.size(); i++) cout << res[i] << ' ';
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  f();
  return 0;
}