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:
######################################################
############Created by Devesh Kumar###################
#############devesh1102@gmail.com####################
##########For CodeForces(Devesh1102)#################
#####################2020#############################
######################################################
import sys
input = sys.stdin.readline

# import sys
import heapq 
import copy
import math
import decimal
# import sys.stdout.flush as flush
# from decimal import *
#heapq.heapify(li) 
#
#heapq.heappush(li,4) 
#
#heapq.heappop(li)
#
# &	Bitwise AND Operator	10 & 7 = 2
# |	Bitwise OR Operator	10 | 7 = 15
# ^	Bitwise XOR Operator	10 ^ 7 = 13
 
# <<	Bitwise Left Shift operator	10<<2 = 40
# >>	Bitwise Right Shift Operator
# '''############ ---- Input Functions ---- #######Start#####'''
 

def inp():
	return(int(input()))
def inlt(): 
	return(list(map(int,input().split())))
def insr():
	s = input()
	return(list(s[:len(s) - 1]))
def insr2():
	s = input()
	return((s[:len(s) - 1]))
def invr():
	return(map(int,input().split()))
 ############ ---- Input Functions ---- #######End
 # #####   
def pr_list(a):
	print(*a, sep=" ")
def main():
	# tests =  inp()
	tests = 1
	mod = 998244353
 
	limit = 10**18
	ans = 0
	for test in range(tests):
		[n,m,k] = inlt()
		adj = [{} for i in range(n+1)]
		for i in range(m):
			[u,v]= inlt()
			adj[u][v] = 1
			adj[v][u]= 1
		done = [0 for i in range(n+1)]
		s_hash = {}
		s_hash[1] = 1
		done[1] = 1
		stack = [1]
		is_cycle =0
		found = 0
		token0 = {}
		token1 = {}
		token0 [1]= 1
		while(stack!=[]):
			# print(stack)
			curr = stack[-1]
			to_pop = 1
			for i in adj[curr]:
				if curr in token0:
					token1[i] = 1
				else:
					 token0[i] = 1
				if i in s_hash and stack[-2] !=i:
					is_cycle = 1
					for j in range(len(stack)):
						if stack[j] == i:
							cycle = stack[j:len(stack)]
							break
					break
			
			if is_cycle ==1:
				break
			if len(stack) >= k and stack[0] not in adj[stack[-1]]:
				found = 1
				break
			for i in adj[curr]:
				if done[i]!=1:
					stack.append(i)
					done[i] = 1
					s_hash[i] = 1
					to_pop = 0
					break
			if to_pop ==1:
				del s_hash[curr]
				stack.pop()
		if is_cycle == 1:
			print(2)	
			print(len(cycle))
			pr_list(cycle)
			continue
		elif found == 1:
			ans = []
			for i in range(len(stack)):
				if i%2 == 0:
					ans.append(stack[i])
			print(1)
			pr_list(ans[0:math.ceil(k/2)])
			continue
		ans = []
		if len(token1)>len(token0):
			maxi = token1
		else:
			maxi = token0
		for i in maxi:
			ans.append(i)
			if len(ans)>=k:
				break
		print(1)
		pr_list(ans[0:math.ceil(k/2)])



if __name__== "__main__":
	main()