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.*;
import java.util.*;
import static java.lang.Math.*;

public class Ans implements Runnable{
	
	
	public static void main(String args[]) throws Exception {		
		
		Ans s = new Ans();
		s.run();
		
	}	
	// static pahije.
	static InputReader sc = new InputReader(System.in);
	static PrintWriter pw = new PrintWriter(System.out);
	
	ArrayList<Integer>[] G ;
	
	int[] stack = new int[112345];
	int[] depth = new int[112345];
	int[] color = new int[112345];
	ArrayList<Integer> cycle = new ArrayList<>();
	ArrayList<Integer> red = new ArrayList<>();
	ArrayList<Integer> black = new ArrayList<>();
	
	public void run(){
		
		int n = sc.nextInt();
		int m = sc.nextInt();
		int k = sc.nextInt();
		G = new ArrayList[n+1];
		for(int i = 0; i <= n; i++){
			G[i] = new ArrayList<Integer>();
		}
		for(int i = 0; i < m; i++){
			int u = sc.nextInt();
			int v = sc.nextInt();
			G[u].add(v);
			G[v].add(u);
		}
		
		dfs(1, 0);
	
		
		if(cycle.size() > 0 && cycle.size() <= k){
			pw.println(2);
			pw.println(cycle.size());
			for(int v : cycle){
				pw.print(v+" ");
			}
		}else{
			if(cycle.size() > 0){
				pw.println(1);
				for(int i = 0, req = (k+1)/2; i < cycle.size() && req > 0; i+=2, req--){
					pw.print(cycle.get(i)+" ");
				}
			}else{
				if(red.size() < black.size()){
					red = black;
				}
				pw.println(1);
				for(int i = 0, req=(k+1)/2; i < red.size() && req > 0; i++,req--){
					pw.print(red.get(i)+" ");
				}
			}
		}
		
		pw.close();

	}
	
	private boolean dfs(int v, int d){
	    // pw.println("dfs " + v + " " + d);
		stack[d] = v;
		depth[v] = d;
		color[v] = 1 + (d&1);
		if(color[v] == 1){
			red.add(v);
		}else{
			black.add(v);
		}
		
		int minLength = 112345;
		int backVertex = -1;
		
		for(int u : G[v]){
			if(color[u] != 0){
				int len = d - depth[u] + 1;
				if(len > 2 && len < minLength){
					minLength = len;
					backVertex = u;
				}
			}
		}
		
		if(backVertex != -1){
			for(int i = depth[backVertex]; i <= d; i++){
				cycle.add(stack[i]);
			}
			return false;
		}
		
		for(int u : G[v]){
			if(color[u] == 0){
				if(!dfs(u, d+1)){
					return false;
				}
			}
		}
		
		return true;
		
	}
	

static class InputReader {
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();

		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}

			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public String nextLine() {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String stock = "";
		try {
			stock = br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return stock;
	}

	public int nextInt() {
		int c = read();

		while (isSpaceChar(c))
			c = read();

		int sgn = 1;

		if (c == '-') {
			sgn = -1;
			c = read();
		}

		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));

		return res * sgn;
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;

		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public double nextDouble() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		double res = 0;
		while (!isSpaceChar(c) && c != '.') {
			if (c == 'e' || c == 'E')
				return res * Math.pow(10, nextInt());
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		}
		if (c == '.') {
			c = read();
			double m = 1;
			while (!isSpaceChar(c)) {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				m /= 10;
				res += (c - '0') * m;
				c = read();
			}
		}
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));

		return res.toString();
	}

	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public String next() {
		return readString();
	}

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}}