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;
using ii = pair<int, int>;
using lint = long long;
const lint LINF = 1e18;
const int INF = 1e9 + 7;
const int mxn = 100010;
const int dr[] = {-1, 0, 1, 0};
const int dc[] = {0, -1, 0, 1};
int tc, N, M, K, a[mxn];
vector<set<int>> adj;
vector<ii> edg;
bitset<200020> vis, c;
vector<int> prv, clist[2];
void input() {
  edg.clear();
  vis.reset();
  clist[0].clear();
  clist[1].clear();
  cin >> N >> M >> K;
  prv.resize(N + 1);
  adj.resize(N + 1);
  for (int i = 0; i < M; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].insert(v);
    adj[v].insert(u);
    edg.push_back({u, v});
  }
}
int bfs(int idx) {
  vector<int> dist(N + 1, INF);
  int ret = 0;
  int st = edg[idx].first, en = edg[idx].second;
  queue<int> q;
  q.push(st);
  dist[st] = 0;
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    if (cur == en) {
      return dist[en] + 1;
    }
    for (int nxt : adj[cur]) {
      if (dist[nxt] == INF) {
        dist[nxt] = dist[cur] + 1;
        q.push(nxt);
        prv[nxt] = cur;
      }
    }
  }
  return -1;
}
void dfs(int cur, int co) {
  vis[cur] = 1;
  clist[co].push_back(cur);
  for (int nxt : adj[cur]) {
    if (vis[nxt]) continue;
    dfs(nxt, 1 - co);
  }
}
lint solve() {
  lint ret = 0;
  if (N == M + 1) {
    vis.reset();
    dfs(1, 0);
    int col = 0;
    if (clist[0].size() < clist[1].size()) col = 1;
    int sz = clist[col].size();
    cout << 1 << '\n';
    for (int i = 0; i < (K + 1) / 2; i++) cout << clist[col][i] << ' ';
    cout << '\n';
    return 0;
  }
  queue<int> q;
  for (int i = 0; i < 100; i++) {
    int x;
    while (1) {
      x = rand() % M;
      if (!vis[x]) break;
    }
    int st = edg[x].first, en = edg[x].second, s = st, e = en;
    adj[st].erase(en);
    adj[en].erase(st);
    vis[x] = 1;
    int cand = bfs(x);
    if (cand == -1) goto fin;
    if (cand <= K) {
      cout << 2 << '\n' << cand << '\n';
      for (; en != st; en = prv[en]) cout << en << ' ';
      cout << st << '\n';
      return 0;
    } else {
      set<int> cand;
      int cnt = 0;
      for (; en != st && cnt < (K + 1) / 2; en = prv[en]) {
        cand.insert(en);
        en = prv[en];
        cnt++;
      }
      if (cand.find(0) != cand.end()) cand.erase(0);
      if (cand.size() == (K + 1) / 2) {
        cout << 1 << '\n';
        for (int x : cand) cout << x << ' ';
        cout << '\n';
        return 0;
      }
    }
  fin:
    adj[s].insert(e);
    adj[e].insert(s);
  }
  vis.reset();
  dfs(1, 0);
  int col = 0;
  if (clist[0].size() < clist[1].size()) col = 1;
  int sz = clist[col].size();
  cout << 1 << '\n';
  for (int i = 0; i < (K + 1) / 2; i++) cout << clist[col][i] << ' ';
  cout << '\n';
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  srand(time(NULL));
  tc = 1;
  while (tc--) {
    input();
    lint ans = solve();
    for (int i = 0; i < N; i++) adj[i].clear();
  }
  return 0;
}