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>
import java.io.*;
import java.util.*;
import java.util.concurrent.TimeUnit;

public class d649 implements Runnable{
	
    public static void main(String[] args) {
    	try{
            new Thread(null, new d649(), "process", 1<<26).start();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		//int t = scan.nextInt();
		int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int inf = Integer.MAX_VALUE;

		static List<List<Integer>> adj = new ArrayList<>();
		static int K;
		static PrintWriter out;
		public void solve(int testNumber, FastReader sc, PrintWriter o) {
			int N = sc.nextInt();
			int M = sc.nextInt();
			K = sc.nextInt();
			out = o;
			
			for(int i = 0; i <= N; i++) {
				adj.add(new ArrayList<>());
			}
			
			while(M --> 0) {
				int a = sc.nextInt();
				int b = sc.nextInt();
				
				adj.get(a).add(b);
				adj.get(b).add(a);
			}
			
			visited = new boolean[N+1];
			depth = new int[N+1];
			
			
			// Case #3: No cycle. Guaranteed to be a tree: use graph coloring to find the solution.
			if(!cycleFinder(1, 0, 0, new Stack<>())) {
				// Perform graph coloring instead
				//System.out.println("GRAPH COLORING TIME");
				visited = new boolean[N+1];
				color = new boolean[N+1];
				if(colorGraph(1, true) >= (K+1)/2) {
					out.println(1);
					int count = (K+1)/2;
					for(int i = 1; i < color.length; i++) {
						if(count == 0)
							break;
						if(color[i]) {
							out.print(i + " ");
							count--;
						}
					}
					out.println();
				} else {
					out.println(1);
					int count = (K+1)/2;
					for(int i = 1; i < color.length; i++) {
						if(count == 0)
							break;
						if(!color[i]) {
							out.print(i + " ");
							count--;
						}
					}
					out.println();
				}
				
			}
			
		}
		
		static boolean[] color;
		public static int colorGraph(int node, boolean col) {
			color[node] = col;
			visited[node] = true;
			int sum = 0;
			for(int each: adj.get(node)) {
				if(!visited[each]) {
					sum += colorGraph(each, !col);
				}
			}
			return sum + ((col) ? 1 : 0);
		}
		
		static boolean[] visited;
		static int[] depth;
		
		public static boolean cycleFinder(int node, int dep, int parent, Stack<Integer> stack) {
			depth[node] = dep;
			stack.push(node);
			visited[node] = true;
			
			boolean cycleFound = false;
			for(int each: adj.get(node)) {
				if(each == parent)
					continue;
				if(visited[each]) {
					// Cycle found
					if(depth[node] - depth[each] + 1 <= K) {
						out.println(2);
						out.println(depth[node] - depth[each] + 1);
						while(stack.peek() != each) {
							out.print(stack.pop() + " ");
						}
						out.println(stack.pop());
					} else {
						out.println(1);
						stack.push(each);
						for(int i = 0; i < (K+1)/2; i++) {
							out.print(stack.pop() + " ");
							stack.pop();
						}
						out.println();
					}
					return true;
				}
			}
			
			for(int each: adj.get(node)) {
				if(each == parent || cycleFound)
					continue;
				if(!visited[each]) {
					cycleFound = cycleFound || cycleFinder(each, dep+1, node, stack);
				}
			}
			
			if(!cycleFound)
				stack.pop();
			return cycleFound;
		}
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static void sort(long[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static class tup implements Comparable<tup>, Comparator<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		public tup() {
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(b,o.b);
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Integer.compare(o1.b, o2.b);
		}
		
		@Override
	    public int hashCode() {
			return Objects.hash(a, b);
	    }
 
	    @Override
	    public boolean equals(Object obj) {
	    	if (this == obj)
                return true;
	    	if (obj == null)
                return false;
	    	if (getClass() != obj.getClass())
                return false;
	    	tup other = (tup) obj;
	    	return a==other.a && b==other.b;
	    }
	    
	    @Override
	    public String toString() {
	    	return a + " " + b;
	    }
	}
	
	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		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;
		}
	}

}