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;
const int MAX = 100005;
vector<int> g[MAX];
int p[MAX];
int d[MAX];
int e1 = -1;
int e2 = -1;
bool cont = true;
int ct = 0;
void dfs(int u, int par) {
  p[u] = par;
  if (u != 1) {
    d[u] = d[par] + 1;
  }
  for (int i : g[u]) {
    if (i == par) {
      continue;
    } else if (p[i] != -2) {
      cont = false;
      if (e1 == -1) {
        e1 = u;
        e2 = i;
      }
      continue;
    }
    if (cont) {
      dfs(i, u);
    }
  }
}
vector<pair<int, int> > edges;
bool in[MAX];
int pos[MAX];
vector<int> shave(vector<int> cycle) {
  int len = (int)cycle.size();
  for (int i = 0; i < (int)cycle.size(); i++) {
    pos[cycle[i]] = i;
  }
  for (int i : cycle) {
    in[i] = true;
  }
  vector<int> new_cycle;
  for (pair<int, int> e : edges) {
    if (in[e.first] && in[e.second]) {
      int diff = abs(pos[e.first] - pos[e.second]);
      if (diff != 1 && diff != len - 1) {
        int smol = pos[e.first];
        int big = pos[e.second];
        if (smol > big) {
          swap(smol, big);
        }
        if (big - smol + 1 > len + 2 - (big - smol + 1)) {
          swap(smol, big);
        }
        for (int i = smol; i != big; i = (i + 1) % len) {
          new_cycle.push_back(cycle[i]);
        }
        new_cycle.push_back(cycle[big]);
        for (int i : cycle) {
          in[i] = false;
        }
        return new_cycle;
      }
    }
  }
  for (int i : cycle) {
    in[i] = false;
  }
  return cycle;
}
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
    edges.push_back(make_pair(u, v));
  }
  for (int i = 1; i <= n; i++) {
    p[i] = -2;
  }
  d[1] = 1;
  dfs(1, -1);
  vector<int> cycle;
  cycle.push_back(e1);
  while (e1 != e2) {
    e1 = p[e1];
    cycle.push_back(e1);
  }
  if (m == n - 1) {
    vector<int> odds;
    vector<int> evens;
    for (int i = 1; i <= n; i++) {
      if (d[i] % 2 == 0) {
        evens.push_back(i);
      } else {
        odds.push_back(i);
      }
    }
    if (odds.size() < evens.size()) {
      swap(odds, evens);
    }
    printf("1\n");
    for (int i = 0; i < (k + 1) / 2; i++) {
      printf("%d ", odds[i]);
    }
    return 0;
  }
  int oldsize = cycle.size();
  int newsize = -1;
  int ct = 0;
  while (oldsize != newsize) {
    oldsize = cycle.size();
    vector<int> shaved = shave(cycle);
    swap(cycle, shaved);
    int newsize = cycle.size();
    if (oldsize == newsize) {
      break;
    }
  }
  if (cycle.size() <= k) {
    printf("2\n");
    printf("%d\n", (int)cycle.size());
    for (int i : cycle) {
      printf("%d ", i);
    }
    return 0;
  }
  vector<int> whee;
  for (int i = 0; i < (int)cycle.size(); i += 2) {
    whee.push_back(cycle[i]);
  }
  printf("1\n");
  for (int i = 0; i < (k + 1) / 2; i++) {
    printf("%d ", whee[i]);
  }
}