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:
import math
import sys

from collections import deque
from typing import Deque, Dict, List, Optional, Set, Tuple

def data(): 
    return sys.stdin.buffer.readline().strip()

def mdata(): 
    return list(map(int, data().split()))

def outl(res): 
    sys.stdout.write(' '.join(map(str, res)) + '\n')

def out(var): 
    sys.stdout.write(str(var)+'\n')


def input_lst():
    return mdata()

def print_out(res):
    outl(res)

class GraphNode:
    def __init__(self, id: int):
        self.id = id
        self.sublings: Deque[GraphNode] = deque()
        
class Graph:
    def __init__(self, n: int):
        self.n = n
        self.nodes = [GraphNode(x) for x in range(n)]

    def add_edge(self, u: int, v: int):
        self.nodes[u].sublings.append(self.nodes[v])
        self.nodes[v].sublings.append(self.nodes[u])

class GraphTraverse:
    def __init__(self, graph: Graph):
        self.graph = graph
        self.watched_nodes: Set[GraphNode] = set()
        self.nodes_color: Dict[GraphNode, bool] = {}
        self.parent_nodes: Dict[GraphNode, GraphNode] = {}
        self.circle_nodes: Optional[Tuple[GraphNode, GraphNode]] = None
    
    def runBFS(self):
        root_node = self.graph.nodes[0]
        current_nodes = [root_node]
        self.nodes_color[None] = True
        self.watched_nodes.add(root_node)
        self.parent_nodes[root_node] = None

        next_nodes = set()
        while len(current_nodes):
            node = current_nodes.pop()
            for child_node in node.sublings:
                if child_node == self.parent_nodes[node]:
                    continue
                if child_node in self.watched_nodes:
                    self.circle_nodes = (node, child_node)
                    break
                self.parent_nodes[child_node] = node
                next_nodes.add(child_node)
            if self.circle_nodes is not None:
                break
            self.nodes_color[node] = not self.nodes_color[self.parent_nodes[node]]
            self.watched_nodes.add(node)
            if len(current_nodes) == 0:
                current_nodes = list(next_nodes)
                next_nodes = set()
        
        del self.nodes_color[None]

    def calc_circle(self):
        if self.circle_nodes is None:
            return
        watched_nodes = set()
        
        current_node = self.circle_nodes[0]
        while current_node is not None:
            watched_nodes.add(current_node)            
            current_node = self.parent_nodes[current_node]

        current_node = self.circle_nodes[1]
        union_node = None
        while current_node is not None:
            if current_node in watched_nodes:
                union_node = current_node
                break
            watched_nodes.add(current_node)           
            current_node = self.parent_nodes[current_node]

        circle_nodes_order = deque()
        current_node = self.circle_nodes[0]
        while current_node is not None:
            circle_nodes_order.append(current_node)           
            if current_node == union_node:
                break
            current_node = self.parent_nodes[current_node]

        circle_nodes_order2 = deque()
        current_node = self.circle_nodes[1]
        while current_node != union_node:
            circle_nodes_order2.append(current_node)                      
            current_node = self.parent_nodes[current_node]

        circle_nodes_order2.reverse()

        circle_nodes_order += circle_nodes_order2

        return circle_nodes_order

        



                

            
        



def main():
    (n, m, k) = input_lst()
    graph = Graph(n)
    for i in range(m):
        (u, v) = input_lst()
        u-=1
        v-=1
        graph.add_edge(u, v)

    traverse = GraphTraverse(graph)
    traverse.runBFS()
    # print(traverse.nodes_color)
    # print(traverse.circle_nodes)
    if traverse.circle_nodes is not None:
        circle_nodes_order = traverse.calc_circle()
        if len(circle_nodes_order) <= k:
            res = [x.id+1 for x in circle_nodes_order];
            print_out([2])
            print_out([len(res)])
            print_out(res)
            return
    

    nodes_count = int(k // 2 + k % 2)

    black_nodes = [k for k, v in traverse.nodes_color.items() if not v]
    red_nodes = [k for k, v in traverse.nodes_color.items() if v]

    if len(black_nodes) >= nodes_count:
        res = [x.id+1 for x in black_nodes[:nodes_count]];
    else: 
        res = [x.id+1 for x in red_nodes[:nodes_count]];
    
    print_out([1])
    print_out(res)






    #print(n, m, a, b)
    #sys.stdout.flush()


if __name__ == '__main__':
    main()