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 UnionFindVerSize():
    def __init__(self, N):
        self._parent = [n for n in range(0, N)]
        self._size = [1] * N
    def find_root(self, x):
        if self._parent[x] == x: return x
        self._parent[x] = self.find_root(self._parent[x])
        return self._parent[x]

    def unite(self, x, y):

        gx = self.find_root(x)
        gy = self.find_root(y)
        if gx == gy: return


        if self._size[gx] < self._size[gy]:
            self._parent[gx] = gy
            self._size[gy] += self._size[gx]
        else:
            self._parent[gy] = gx
            self._size[gx] += self._size[gy]

    def get_size(self, x):

        return self._size[self.find_root(x)]

    def is_same_group(self, x, y):

        return self.find_root(x) == self.find_root(y)

    def calc_group_num(self):

        N = len(self._parent)
        ans = 0
        for i in range(N):
            if self.find_root(i) == i:
                ans += 1
        return ans

class Dijkstra():

    class Edge():

        def __init__(self, _to, _cost):
            self.to = _to
            self.cost = _cost

    def __init__(self, V):

        self.G = [[] for i in range(V)]
        self._E = 0
        self._V = V

    @property
    def E(self):

        return self._E

    @property
    def V(self):

        return self._V

    def add(self, _from, _to, _cost):

        self.G[_from].append(self.Edge(_to, _cost))
        self._E += 1

    def shortest_path(self, s):

        import heapq
        que = []
        d = [10**15] * self.V
        d[s] = 0
        heapq.heappush(que, (0, s))

        while len(que) != 0:
            cost, v = heapq.heappop(que)

            if d[v] < cost: continue

            for i in range(len(self.G[v])):

                e = self.G[v][i]
                if d[e.to] > d[v] + e.cost:
                    d[e.to] = d[v] + e.cost
                    heapq.heappush(que, (d[e.to], e.to))
        return d

    def back(self,s,t):
        data=self.shortest_path(s)
        val=data[t]
        path=[t]
        pos=t
        while pos!=s:
            for e in self.G[pos]:
                pv=e.to
                if data[pv]==data[pos]-1:
                    pos=pv
                    break
            path.append(pos)
        return path

import sys

input=sys.stdin.readline

n,m,k=map(int,input().split())
uf=UnionFindVerSize(n)
di=Dijkstra(n)
edge=[[] for i in range(n)]
flag=True
path=[]
if m>n-1:
    for i in range(m):
        u,v=map(int,input().split())
        if uf.is_same_group(u-1,v-1) and flag:
            start=u-1
            end=v-1
            flag=False
        else:
            uf.unite(u-1,v-1)
            di.add(u-1,v-1,1)
            di.add(v-1,u-1,1)

    path=di.back(end,start)
    path=[path[i]+1 for i in range(len(path))]
    N=len(path)
    if k>=N:
        print(2)
        print(N)
        print(*path)
    else:
        print(1)
        ans=[path[2*i] for i in range((k+1)//2)]
        print(*ans)
else:
    from collections import deque
    for i in range(m):
        u,v=map(int,input().split())
        edge[u-1].append(v-1)
        edge[v-1].append(u-1)

    color=[-1]*n
    color[0]=0
    que=deque([0])
    while que:
        v=que.popleft()
        for nv in edge[v]:
            if color[nv]==-1:
                color[nv]=(1+color[v])%2
                que.append(nv)
                
    A=color.count(1)
    B=color.count(0)
    print(1)
    if A>=(k+1)//2:
        ans=[i+1 for i in range(n) if color[i]==1]
        ans=ans[:(k+1)//2]
        print(*ans)
    else:
        ans=[i+1 for i in range(n) if color[i]==0]
        ans=ans[:(k+1)//2]
        print(*ans)