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.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;

public class Round649D {
	
	public static LinkedList<Integer>[] adj;
	public static HashSet<Integer> stack_helper;
	public static LinkedList<Integer> stack;
	public static ArrayList<Integer> ans;
	public static int[] depth;
	public static boolean[] visited;
	
	public static int dfs1(int curr, int pr, int ht) {
		stack.addLast(curr);
		stack_helper.add(curr);
		depth[curr] = ht;
		int smallest = -1, deepest = Integer.MAX_VALUE;
		for(Integer  x : adj[curr]) {
			if(x == pr) {
				continue;
			}
			if(stack_helper.contains(x)) {
				int cur_diff = ht - depth[x];
				if(cur_diff < deepest) {
					deepest = cur_diff;
					smallest = x;
				}
			}
		}
		if(smallest != -1) {
			ans.add(curr);
			stack.removeLast();
			stack_helper.remove(curr);
			return smallest;
		}
		for(Integer x : adj[curr]) {
			if(x == pr) {
				continue;
			}
			if(!visited[x]) {
				int  val = dfs1(x, curr, ht + 1);				
				if(stack_helper.contains(val)) {
					ans.add(curr);
					stack.removeLast();
					stack_helper.remove(curr);
					return val;
				}else if(val != -1){
					return val;
				}
			}
		}
		stack.removeLast();
		stack_helper.remove(curr);
		return -1;
	}

	public static LinkedList<Integer> first;
	public static LinkedList<Integer> second;
	
	public static void ifTree(int curr, int pr, int ht) {
		if(ht%2 == 0) {
			first.add(curr);
		}else {
			second.add(curr);
		}
		for(Integer x : adj[curr]) {
			if(x == pr) continue;
			ifTree(x, curr, ht + 1);
		}
	}
	
	public static void solve() {
		int n = s.nextInt();
		int m = s.nextInt();
		int k = s.nextInt();
		adj = new LinkedList[n];
		for(int i = 0; i < n; i++) {
			adj[i] = new LinkedList<Integer>();
		}
		for(int i = 0; i < m; i++) {
			int u = s.nextInt() - 1;
			int v = s.nextInt() - 1;
			adj[u].add(v);
			adj[v].add(u);
		}
		int half = k%2 == 0 ? k/2 : k/2 + 1;
		if(m == n - 1) {
			first = new LinkedList<Integer>();
			second = new LinkedList<Integer>();
			ifTree(0, 0, 0);
			out.println(1);
			if(first.size() >= half) {
				int count = 0;
				for(Integer  x : first) {
					if(count >= half) break;
					out.print((x + 1) + " ");
					count++;
				}
			}else if(second.size() >= half) {
				int count = 0;
				for(Integer  x : second) {
					if(count >= half) break;
					out.print((x + 1) + " ");
					count++;
				}
			}
		}else {
			stack = new LinkedList<Integer>();
			stack_helper = new HashSet<Integer>();
			ans = new ArrayList<Integer>();
			visited = new boolean[n];
			depth = new int[n];
			dfs1(0, 0, 0);
			if(ans.size() == 0) {
				throw null;
			}
			if(ans.size() <= k) {
				out.println(2);
				out.println(ans.size());
				for(int i = 0; i < ans.size(); i++) {
					out.print((ans.get(i) + 1) + " ");
				}
			}else {
				out.println(1);
				ArrayList<Integer> first = new ArrayList<Integer>();
				ArrayList<Integer> second = new ArrayList<Integer>();
				for(int i = 0; i < ans.size(); i++) {
					if(i%2 == 0) {
						first.add(ans.get(i));
					}else {
						second.add(ans.get(i));
					}
				}
				if(first.size() >= half) {
					int count = 0;
					for(Integer  x : first) {
						if(count >= half) break;
						out.print((x + 1) + " ");
						count++;
					}
				}else if(second.size() >= half) {
					int count = 0;
					for(Integer  x : second) {
						if(count >= half) break;
						out.print((x + 1) + " ");
						count++;
					}
				}
			}
		}
	}

	public static void main(String[] args) {
		new Thread(null, null, "Thread", 1 << 27) {
			public void run() {
				try {
					out = new PrintWriter(new BufferedOutputStream(System.out));
					s = new FastReader(System.in);
					solve();
					out.close();
				} catch (Exception e) {
					e.printStackTrace();
					System.exit(1);
				}
			}
		}.start();
	}

	public static PrintWriter out;
	public static FastReader s;

	public static class FastReader {

		private InputStream stream;
		private byte[] buf = new byte[4096];
		private int curChar, snumChars;

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

		public int read() {
			if (snumChars == -1) {
				throw new InputMismatchException();
			}
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException E) {
					throw new InputMismatchException();
				}
			}
			if (snumChars <= 0) {
				return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int number = 0;
			do {
				number *= 10;
				number += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return number * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			long sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long number = 0;
			do {
				number *= 10L;
				number += (long) (c - '0');
				c = read();
			} while (!isSpaceChar(c));
			return number * sgn;
		}

		public int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = this.nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = this.nextLong();
			}
			return arr;
		}

		public String next() {
			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 String nextLine() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndofLine(c));
			return res.toString();
		}

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

		public boolean isEndofLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

	}

	
}