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 PYTHON3):

Solution:
class LowestCommonAncestor:
    def __init__(self, tree, root):
        self.n = len(tree)
        self.depth = [0] * self.n
        self.log_size = (self.n).bit_length()
        self.parent = [[-1] * self.n for i in range(self.log_size)]

        q = [(root, -1)] 
        while q:
            v, par = q.pop()
            for chi_v in tree[v]:
                if chi_v == par:
                    continue
                self.parent[0][chi_v] = v
                self.depth[chi_v] = self.depth[v] + 1
                q.append((chi_v, v))

        for k in range(self.log_size - 1):
            for v in range(self.n):
                if self.parent[k][v] == -1:
                    self.parent[k + 1][v] = -1
                else:
                    self.parent[k + 1][v] = self.parent[k][self.parent[k][v]]

    def lca(self, u, v):
        if self.depth[u] > self.depth[v]:
            u, v = v, u
        for k in range(self.log_size):
            if ((self.depth[v] - self.depth[u]) >> k) & 1:
                v = self.parent[k][v]
        if u == v:
            return u

        for k in reversed(range(self.log_size)):
            if self.parent[k][u] != self.parent[k][v]:
                u = self.parent[k][u]
                v = self.parent[k][v]
        return self.parent[0][u]


from collections import deque
import sys
input = sys.stdin.buffer.readline


n, m, k = map(int, input().split())
info = [list(map(int, input().split())) for i in range(m)]
OFFSET = 10 ** 6

graph = [[] for i in range(n)]
for a, b in info:
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)


tree = [[] for i in range(n)]
edges = set([])
used = [False] * n
out_degree = [len(graph[i]) for i in range(n)]

def dfs_tree(self, root):
    st = [-1, root, 0]
    while st:
        prv_v, v, ind = st[-3], st[-2], st[-1]
        if not ind and used[v]:
            st.pop()
            st.pop()
            st.pop()
        else:
            used[v] = True
            if ind < out_degree[v]:
                st[-1] += 1
                st.append(v)
                st.append(graph[v][ind])
                st.append(0)
            else:
                st.pop()
                st.pop()
                st.pop()
                if prv_v != -1:
                    edges.add(min(prv_v, v) * OFFSET + max(prv_v, v))
                    tree[v].append(prv_v)
                    tree[prv_v].append(v)

dfs_tree(graph, 0)
lca = LowestCommonAncestor(tree, 0)

for a, b in info:
    a -= 1
    b -= 1
    if min(a, b) * OFFSET + max(a, b) in edges:
        continue
    dist = abs(lca.depth[a] - lca.depth[b]) + 1
    if dist <= k:
        if lca.depth[a] < lca.depth[b]:
            a, b = b, a
        ans = [a + 1]
        while a != b:
            a = lca.parent[0][a]
            ans.append(a + 1)
        print(2)
        print(len(ans))
        print(*ans)
        exit()
    

stack = [i for i in range(n) if len(tree[i]) == 1]
visited = [False] * n
q = deque([])
for i in stack:
    visited[i] = True
    q.append(i)
col = [False] * n

while q:
    v = q.popleft()
    flag = True
    for nxt_v in graph[v]:
        flag &= not(col[nxt_v])
        if visited[nxt_v]:
            continue
        visited[nxt_v] = True
        q.append(nxt_v)
        
    if flag:
        col[v] = True

ans = []
for i in range(n):
    if col[i] == True and len(ans) < (k + 1) // 2:
        ans.append(i + 1)
if len(ans) == (k + 1) // 2:
    print(1)
    print(*ans)