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 JAVA):

Solution:

// Problem: D. Ehab's Last Corollary
// Contest: Codeforces - Codeforces Round #649 (Div. 2)
// URL: http://codeforces.com/problemset/problem/1364/D
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

import java.io.*;
import java.util.*;

public class Main {
    private static PrintWriter pw = new PrintWriter(System.out);
    private static InputReader sc = new InputReader();
    private static final int intmax = Integer.MAX_VALUE, intmin = Integer.MIN_VALUE;

    static class Pair{
        int first, second;
        Pair(int first, int second){
            this.first = first;
            this.second = second;
        }
    }

    static class InputReader{
        private static BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
        private static StringTokenizer tk;

        private void next()throws IOException{
            if(tk == null || !tk.hasMoreTokens())   
                tk = new StringTokenizer(r.readLine());
        }

        private int nextInt()throws IOException{
            next();
            return Integer.parseInt(tk.nextToken());
        }

        private long nextLong()throws IOException{
            next();
            return Long.parseLong(tk.nextToken());
        }

        private String readString()throws IOException{
            next();
            return tk.nextToken();
        }

        private double nextDouble()throws IOException{
            next();
            return Double.parseDouble(tk.nextToken());
        }

        private int[] intArray(int n)throws IOException{
            next();
            int arr[] = new int[n];

            for(int i=0; i<n; i++)
                arr[i] = nextInt();

            return arr;
        }

        private long[] longArray(int n)throws IOException{
            next();
            long arr[] = new long[n];

            for(int i=0; i<n; i++)
                arr[i] = nextLong();

            return arr;
        }
    }

    public static void main(String args[])throws IOException{
        int t = 1;
        while(t-->0)    solve();
        pw.flush();
        pw.close();
    }
    
    private static ArrayList<ArrayList<Integer>> graph;

	private static void graph_input(int n, int m)throws IOException{
		graph = new ArrayList<>();
		
		for(int i=0; i<n; i++)
			graph.add(new ArrayList<>());
			
		for(int i=0; i<m; i++){
			int u = sc.nextInt() - 1, v = sc.nextInt() - 1;
			graph.get(u).add(v);
			graph.get(v).add(u);
		}
	}
	
	private static Stack<Integer> stack;
	private static HashMap<Integer, Integer> map;
	private static int k;
	
	private static void cycleRes(ArrayList<Integer> cycle){
		if(cycle.size() <= k){
			pw.println("2\n"+cycle.size());
			for(Integer node: cycle)
				pw.print(+(node+1)+" ");
		}
		else{
			pw.println(1);
			
			for(int i=0, j=(k+1)/2; j>0; i+=2, j--)
				pw.print(+(cycle.get(i)+1)+" ");
		}
		pw.println();
	}

	private static boolean dfs(int node, int p){
		map.put(node, stack.size());
		stack.push(node);
		
		int startIndex = -1;
		
		for(Integer neighbor : graph.get(node)){
			if(neighbor != p && map.containsKey(neighbor))
				startIndex = Math.max(startIndex, map.get(neighbor));
		}
		
		if(startIndex == -1){
			for(Integer neighbor : graph.get(node)){
				if(neighbor != p){
					if(dfs(neighbor, node))
						return true;
				}
			}
		}
		else{
			ArrayList<Integer> cycle = new ArrayList<>();
				
			while(stack.size() > startIndex)
				cycle.add(stack.pop());
				
			cycleRes(cycle);
			return true;
		}
		
		stack.pop();
		map.remove(node);
		return false;
	}

	private static ArrayList<ArrayList<Integer>> list;
	
	private static void dfs2(int node, int level){
		list.get(level).add(node);
		map.put(node, 1);
		
		for(Integer neighbor : graph.get(node)){
			if(!map.containsKey(neighbor))
				dfs2(neighbor, 1-level);
		}
	}

    private static void solve()throws IOException{
		int n = sc.nextInt(), m = sc.nextInt();
		k = sc.nextInt();
		
		graph_input(n, m);
		
		stack = new Stack<>();
		map = new HashMap<>();
		
		if(dfs(0, -1))	return;
		
		list = new ArrayList<>();
		for(int i=0; i<2; i++)
			list.add(new ArrayList<>());
			
		map.clear();

		dfs2(0, 0);
		
		ArrayList<Integer> ans = (list.get(0).size() > list.get(1).size())?list.get(0):list.get(1);
		
		pw.println(1);
		int lim = (k+1)/2;
		
		for(Integer node: ans){
			pw.print(+(node+1)+" ");
			lim--;
			
			if(lim == 0) break;
		}
    }
}