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:
# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------- fast io --------------------
from math import gcd, ceil

def prod(a, mod=10**9+7):
    ans = 1
    for each in a:
        ans = (ans * each) % mod
    return ans

def lcm(a, b): return a * b // gcd(a, b)

def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else "0" * (length - len(y)) + y

def dfs(graph, alpha):
    """Depth First Search on a graph!"""
    n = len(graph)
    visited = [False]*n
    parents = [-1]*n
    colors = [1]*n
    stack = [alpha]
    cycle = []
    while stack:
        v = stack[-1]
        if not visited[v]:
            visited[v] = True
            for u in graph[v]:
                if not visited[u]:
                    stack.append(u)
                    colors[u] = 1 - colors[v]
                    if parents[u] == -1:
                        parents[u] = v
                elif u != parents[v]:
                    cycle = [u, v]
        else:
            stack.pop()
    return colors, parents, cycle

for _ in range(int(input()) if not True else 1):
    n, m, k = map(int, input().split())
    #a, b = map(int, input().split())
    #c, d = map(int, input().split())
    #a = list(map(int, input().split()))
    #b = list(map(int, input().split()))
    #s = input()
    graph = [[] for __ in range(n+1)]
    edges = set()
    for i in range(m):
        x, y = map(int, input().split())
        graph[x] += [y]
        graph[y] += [x]
        edges.add((x, y))
        edges.add((y, x))

    if m == n-1:
        # tree
        print(1)
        colors, parents, cycle = dfs(graph, 1)
        zero, one = [], []
        for i in range(1, n+1):
            if colors[i]:
                one += [i]
            else:
                zero += [i]
            if max(len(one), len(zero)) == ceil(k/2):
                break
        if len(one) == ceil(k/2):
            print(*one)
        else:
            print(*zero)
        continue

    colors, parents, cycle = dfs(graph, 1)

    def shortest_path(graph, alpha, omega, parents):
        """Returns the shortest path between two vertices!"""
        path = [omega]
        v = omega
        while parents[v] != -1:
            path += [parents[v]]
            v = parents[v]
        return path[::-1]
    c = shortest_path(graph, cycle[0], cycle[1], parents) + \
        shortest_path(graph, cycle[1], cycle[0], parents)[::-1]
    from collections import deque
    c = deque(c)
    while len(c)>=4 and c[1] == c[-2]:
        c.popleft()
        c.pop()
    e2 = set()
    vtc = set()
    for i in range(1, len(c)):
        e2.add((c[i-1], c[i]))
        vtc.add(c[i])
    rdex = {}
    for i in range(len(c)):
        rdex[c[i]] = i
    mr1, mr2 = 69696969, 69696969
    for edge in edges:
        if edge in e2 or (edge[1], edge[0]) in e2:continue
        if edge[0] in vtc and edge[1] in vtc:
            r1, r2 = rdex[edge[0]], rdex[edge[1]]
            r1,r2 = min(r1,r2),max(r1,r2)
            if r1 < mr1:
                mr1 = r1
                mr2 = r2
    c=list(c)
    c = c[:(mr1 + 1)] + c[mr2:]
    c = c[:-1]
    #print(cycle, c)
    if len(c) <= k:
        print(2)
        print(len(c))
        print(*c)

    else:
        print(1)
        print(*[c[i] for i in range(0, len(c), 2)][:ceil(k/2)])