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:
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;

public class D_Ehab_Last_Corollary {
	
	static int[] parents;
	static int[] depth;
	
	public static void main(String[] args) {
		MyScanner sc = new MyScanner();
	    PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	    
	    int n = sc.nextInt();
	    int m = sc.nextInt();
	    int k = sc.nextInt();
	    
	    ArrayList<ArrayList<Integer>> adjList = new ArrayList<>();
	    
	    ArrayList<ArrayList<Integer>> edgeList = new ArrayList<>();
	    
	    for(int i = 0; i <= n; i++)
	    	adjList.add(new ArrayList<Integer>());
	    
	    // read input edges
	    for(int i = 0; i < m; i++) {
	    	int a = sc.nextInt();
	    	int b = sc.nextInt();
	    	
	    	edgeList.add(new ArrayList<Integer>());
	    	edgeList.get(i).add(a);
	    	edgeList.get(i).add(b);
	    	
	    	adjList.get(a).add(b);
	    	adjList.get(b).add(a);
	    }
	    
	    HashSet<Integer> cycle = new HashSet<>();
    	
	    parents = new int[n + 1];
	    depth = new int[n + 1];
	    Pair res = dfs(cycle, adjList, 1);
    	   	
       	if(res == null) { 	    	
        	parents = new int[n + 1];
        	int[] depth = new int[n + 1];
        	int[] depth_count = new int[n + 1]; depth_count[0] = 1;
        	int max_depth = 0;
        	Queue<Integer> toVisit = new LinkedList<Integer>();
        	toVisit.add(1);
        	while(!toVisit.isEmpty()) {
        		int curr = toVisit.poll();
        		
        		for(int i = 0; i < adjList.get(curr).size(); i++) {
        			int child = adjList.get(curr).get(i);
        			        			
        			if(child != parents[curr]) {
    					toVisit.add(child);
    					parents[child] = curr;
    					depth[child] = depth[curr] + 1;
    					depth_count[depth[child]]++;
    					max_depth = Math.max(max_depth, depth[child]);
        			}
        		}
        	}
    		
	    	// dp on the layers to calc max indep set
	    	//0: did not use | 1: used 
	    	int[][] dp = new int[max_depth + 1][2];
	    	dp[0][1] = 1;
	    	for(int i = 1; i < dp.length; i++) {
	    		dp[i][0] = Math.max(dp[i - 1][0], dp[i - 1][1]);
	    		dp[i][1] = dp[i - 1][0] + depth_count[i];
	    	}
	    	
	    	HashSet<Integer> layers_used = new HashSet<>();
	    	int curr = dp[max_depth][1] > dp[max_depth][0] ? 1 : 0;
	    	for(int i = max_depth; i >= 0; i--) {
	    		if(curr == 1)
	    			layers_used.add(i);
	    		
	    		if(i == 0) continue;
	    		if(curr == 1) {
	    			curr = 0;
	    		}else {
	    			if(dp[i - 1][0] > dp[i - 1][1]) {
	    				curr = 0;
	    			}else {
	    				curr = 1;
	    			}
	    		}
	    	}
	    	
	    	HashSet<Integer> indep_set = new HashSet<>();
	    	for(int i = 1; indep_set.size() < (k + 1)/2 && i < depth.length; i++) {
	    		if(layers_used.contains(depth[i])) {
	    			indep_set.add(i);
	    		}
	    	}
	    	
	    	out.println(1);
	    	var indep_itr = indep_set.iterator();
	    	for(int i = 0; i < (k+1)/2; i++) {
	    		out.print(indep_itr.next() + " ");
	    	}
	    	
		}else {			    
		    // iterate through nodes
		    ArrayList<Integer> cycle_order = new ArrayList<>();
		    
		    int curr_node = res.lower;
		    while(curr_node != parents[res.upper]) {
		    	cycle_order.add(curr_node);
		    	
		    	curr_node = parents[curr_node];
		    }
		    
		    // determine which solution we must output
		    if(cycle_order.size() <= k) {
		    	out.println(2);
		    	out.println(cycle_order.size());
		    	cycle_order.stream().forEach(elem -> out.print(elem + " "));
		    }else {
		    	out.println(1);
		    	int cnt = 0;
		    	for(int i = 0; cnt < (k + 1)/2 && i < cycle_order.size(); i+=2) {
		    		out.print(cycle_order.get(i) + " ");
		    		cnt++;
		    	}
		    }
		
    	}
	    
	    
	    out.println();
	    out.close();
	}
	
	public static Pair dfs(HashSet<Integer> currSeen, ArrayList<ArrayList<Integer>> adjList, 
			int curr_node) {
		currSeen.add(curr_node);
		
		boolean foundCycle = false;
		Pair neighbor_to_add = null;
		for(int i = 0; i < adjList.get(curr_node).size(); i++) {
			int neighbor = adjList.get(curr_node).get(i);
			
			if(neighbor == parents[curr_node]) continue;
			
			if(currSeen.contains(neighbor)) {
				if(neighbor_to_add == null)
					neighbor_to_add = new Pair();
				if(depth[neighbor] > depth[neighbor_to_add.upper]) {
					neighbor_to_add.upper = neighbor;
				}
				neighbor_to_add.lower = curr_node;
				foundCycle = true;
			}
		}
		
		for(int i = 0; !foundCycle && i < adjList.get(curr_node).size(); i++) {
			int neighbor = adjList.get(curr_node).get(i);
			
			if(neighbor == parents[curr_node]) continue;
			
			parents[neighbor] = curr_node;
			depth[neighbor] = depth[curr_node] + 1;
			neighbor_to_add = dfs(currSeen, adjList, neighbor);
			if(neighbor_to_add != null)
				foundCycle = true;
		}
		if(!foundCycle) {
			currSeen.remove(curr_node);
			return null;
		}else {
			return neighbor_to_add;
		}
	}
	
	static class Pair {
		int lower = 0;
		int upper = 0;
		
		Pair(int lower, int upper) {
			this.lower = lower;
			this.upper = upper;
		}
		
		Pair() {
			
		}
	}
	
	private static class MyScanner {
		BufferedReader br;
	    StringTokenizer st;
	 
	    public MyScanner() {
	       br = new BufferedReader(new InputStreamReader(System.in));
	    }
	 
	    String next() {
	    	while (st == null || !st.hasMoreElements()) {
	    		try {
	    			st = new StringTokenizer(br.readLine());
	            	
	    		} catch (IOException e) {
	    			e.printStackTrace();
	            }
	          }
	    	return st.nextToken();
	   }
	 
	   int nextInt() {
		   return Integer.parseInt(next());
	   }
	 
	   long nextLong() {
		   return Long.parseLong(next());
	   }
	 
	   double nextDouble() {
		   return Double.parseDouble(next());
	   }
	 
	   String nextLine(){
		   String str = "";
		   try {
			   str = br.readLine();
		   } catch (IOException e) {
			   e.printStackTrace();
		   }
		   return str;
	   }
	}
}