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:
#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
import threading 
from math import floor
# from bisect import bisect_right
from collections import deque
from math import gcd

mod=998244353



def main():
    n,m,k=map(int,input().split())
    graph=[[] for  i in range(n)]
    for i in range(m):
        u,v=map(lambda x:int(x)-1,input().split())
        graph[u].append(v)
        graph[v].append(u)

    color=[-1]*n
    parent=[-1]*n
    color[0]=0
    bfs=deque([0])

    painted=[0]*n
    p=0
    while len(bfs):
        node=bfs.popleft()
        # print(node,color,painted)

        col=0 if color[node] else 1

        for adj in graph[node]:
            if color[adj]==-1:
                parent[adj]=node
                color[adj]=col
                bfs.append(adj)
            elif color[adj]!=col: 
                
                p=node
                st=[]
                while p!=-1:
                    st.append(p+1)
                    p=parent[p]
                p=adj
                st1=[]
                while p!=-1:
                    st1.append(p+1)
                    p=parent[p]
                # print(st1,st)
                prev=st[-1]
                while len(st1)>0 and len(st)>0 and st1[-1]==st[-1]:
                    prev=st[-1]
                    st1.pop()
                    st.pop()
                
                l=len(st1)+len(st)+1
                ans=st1+[prev]+st[::-1]
                if l>k:
                    print('1')
                    print(*[j for i,j in enumerate(ans) if i%2==1])
                    return 
                print('2')
                print(l)
                print(*ans)
                return

        painted[node]=1
        p+=1
        if p>=k:
            print('1')
            for i in range(n):
                if not painted[i]:
                    color[i]=-1
            cn1=color.count(1)
            cn2=color.count(0)
            c=1 if cn1>cn2 else 0
            ans=[i+1 for i in range(n) if color[i]==c]
            print(*ans[:(k+1)//2])
            return 







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")

# endregion

if __name__ == "__main__":
    main()