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;
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
struct Edge {
  int from, to;
  Edge(){};
  Edge(int from, int to) : from(from), to(to) {}
  void scanFrom(std::istream& strm, int base = 1) {
    strm >> from >> to;
    if (base == 1) --from, --to;
  }
  Edge reverse() const { return Edge(to, from); }
};
inline std::istream& operator>>(std::istream& strm, Edge& t) {
  t.scanFrom(strm);
  return strm;
}
template <typename T>
struct WeightedEdge {
  int from, to;
  T _weight;
  WeightedEdge(){};
  WeightedEdge(int from, int to, T weight)
      : from(from), to(to), _weight(weight) {}
  void scanFrom(std::istream& strm, int base = 1) {
    strm >> from >> to >> _weight;
    if (base == 1) --from, --to;
  }
  T weight() const { return _weight; }
  WeightedEdge reverse() const { return WeightedEdge(to, from, _weight); }
};
template <typename T>
inline std::istream& operator>>(std::istream& strm, WeightedEdge<T>& t) {
  t.scanFrom(strm);
  return strm;
}
template <typename Edge>
class Digraph {
  int _E, _V;
  vector<vector<Edge>> _adjacencyList;

 public:
  int E() const { return _E; }
  int V() const { return _V; }
  int size() const { return _V; }
  Digraph() : _V(0), _E(0){};
  Digraph(int V, int E = 0) : _V(V), _E(E) { _adjacencyList.resize(V); }
  void addEdge(const Edge& e) {
    _adjacencyList[e.from].push_back(e);
    ++_E;
  }
  void addUndirectedEdge(const Edge& e) {
    _adjacencyList[e.from].push_back(e);
    _adjacencyList[e.to].push_back(e.reverse());
    ++_E;
  }
  void addNode() {
    ++_V;
    _adjacencyList.push_back(vector<Edge>());
  }
  void scanFrom(std::istream& strm, int base = 1) {
    if (_V == 0) strm >> _V;
    if (_E == 0) strm >> _E;
    _adjacencyList.resize(_V);
    for (int i = 0; i < _E; ++i) {
      Edge e;
      e.scanFrom(cin, base);
      assert(0 <= e.from < _V);
      assert(0 <= e.to < _V);
      addEdge(e);
    }
  }
  vector<Edge> operator[](int u) const { return _adjacencyList[u]; }
  vector<vector<Edge>>& adjacencyList() { return _adjacencyList; }
};
template <typename Edge>
inline std::istream& operator>>(std::istream& strm, Digraph<Edge>& t) {
  t.scanFrom(strm);
  return strm;
}
int main() {
  int V, E;
  cin >> V >> E;
  Digraph<Edge> G(V, E);
  for (int i = 0; i < (int)(E); ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    --u, --v;
    G.addUndirectedEdge(Edge(u, v));
  }
  int sq = ceil(sqrt(V));
  vector<int> depth(V, -1);
  vector<bool> independent(V, false);
  function<void(int, int)> printCycle = [&](int s, int u) {
    printf("%d ", u + 1);
    if (u == s) return;
    for (Edge& e : G[u]) {
      if (depth[e.to] == depth[u] - 1) printCycle(s, e.to);
    }
  };
  function<void(int, int)> dfs = [&](int u, int d) {
    depth[u] = d;
    bool ind = true;
    int mind = d, anc = u;
    for (Edge& e : G[u]) {
      if (depth[e.to] == -1) dfs(e.to, d + 1);
      if (depth[e.to] < depth[u]) {
        if (chmin(mind, depth[e.to])) anc = e.to;
        continue;
      }
      ind &= !independent[e.to];
    }
    if (d - mind >= sq - 1) {
      cout << 2 << endl;
      cout << d - mind + 1 << endl;
      printCycle(anc, u);
      exit(0);
    }
    independent[u] = ind;
  };
  dfs(0, 0);
  cout << 1 << endl;
  int c = 0;
  for (int u = 0; u < (int)(V); ++u) {
    if (c < sq && independent[u]) {
      printf("%d ", u + 1);
      ++c;
    }
  }
  cout << endl;
  return 0;
}