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.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;

public class D1364 {
	static class Solver {

		int N, M, K;
		
		int weight[], ans[], ord[], in[], oot[], par[];
		int dep[], sz[], gc[], nxt[];
		ArrayList<Integer> adj[];
		
		int IDX = 0;
		void dfs(int v, int p, int d) {
			in[v] = IDX; ord[IDX++] = v;
			dep[v] = d; par[v] = p; sz[v] = 1;
			for(int e : adj[v]) {
				if(e == p) continue;
				dfs(e, v, d + 1);
				if(gc[v] == 0 || sz[e] > sz[gc[v]]) gc[v] = e;
				sz[v] += sz[e];
			}
			oot[v] = IDX; ord[IDX++] = v;
		}
		
		void hldfs(int v) {
			if(gc[v] != 0) { nxt[gc[v]] = nxt[v]; hldfs(gc[v]); }
			for(int e : adj[v]) {
				if(e == gc[v] || e == par[v]) continue;
				nxt[e] = e; hldfs(e);
			}
		}
		
		int lca(int u, int v) {
			if(nxt[u] == nxt[v]) return dep[u] < dep[v] ? u : v;
			if(dep[nxt[u]] > dep[nxt[v]]) return lca(par[nxt[u]], v);
			return lca(u, par[nxt[v]]);
		}
		
		@SuppressWarnings("unchecked")
		void solve(int testNumber, FastScanner s, PrintWriter out) {
			N = s.nextInt(); M = s.nextInt(); K = s.nextInt();
			Arrays.setAll(adj = new ArrayList[N], x -> new ArrayList<>());
			ArrayList<int[]> joins = new ArrayList<>();
			DisjointSet DSU = new DisjointSet(N);
			for(int i = 0, u, v; i < M; i++) {
				u = s.nextInt() - 1; v = s.nextInt() - 1;
				if(DSU.union(u, v)) {
					adj[u].add(v); adj[v].add(u);
				} else {
					joins.add(new int[] { u, v });
				}
			}
			
			ord = new int[2 * N]; in = new int[N]; oot = new int[N]; par = new int[N];
			sz = new int[N]; gc = new int[N]; nxt = new int[N]; dep = new int[N];
			dfs(0, -1, 0); hldfs(0);
			
			int minc = N + 1, med[] = null;
			for(int[] e : joins) {
				int l = lca(e[0], e[1]);
				int len = 1 + dep[e[0]] + dep[e[1]] - 2 * dep[l];
				if(len < minc) {
					minc = len; med = e;
				}
			}
			
			if(med == null) {
				ArrayList<Integer> red = new ArrayList<>(), blue = new ArrayList<>();
				coldfs(0, 0, -1, red, blue);
				red = red.size() < blue.size() ? blue : red;
				out.println(1);
				int goal = (K + 1) / 2;
				for(int i = 0; i < goal; i++)
					out.print(red.get(i) + 1 + " ");
				out.println();
			} else {
				int a, b, l = lca(a = med[0], b = med[1]);
				// med[0] up to but not including l
				ArrayDeque<Integer> cycle = new ArrayDeque<>();
				while(a != l) { cycle.addLast(a); a = par[a]; }
				while(b != l) { cycle.addFirst(b); b = par[b]; }
				cycle.addFirst(l);
				
				if(cycle.size() <= K) {
					out.println(2);
					out.println(cycle.size());
					while(!cycle.isEmpty()) {
						out.print(cycle.pollFirst() + 1 + " ");
					}
					out.println();
				} else {
					int goal = (K + 1) / 2;
					out.println(1);
					for(int i = 0; i < goal; i++) {
						out.print(cycle.pollFirst() + 1 + " ");
						cycle.pollFirst();
					}
					out.println();
				}
			}
		}
		
		void coldfs(int v, int c, int p, ArrayList<Integer> z, ArrayList<Integer> o) {
			if(c == 0) z.add(v); else o.add(v);
			for(int u : adj[v]) {
				if(u != p) coldfs(u, c ^ 1, v, z, o);
			}
		}
		
		static class DisjointSet {
			int[] s;
			
			public DisjointSet(int n) {
				Arrays.fill(s = new int[n], -1);
			}
			
			public int find(int i) {
				return s[i] < 0 ? i : (s[i] = find(s[i]));
			}
			
			public boolean union(int a, int b) {
				if ((a = find(a)) == (b = find(b))) return false;
				if(s[a] == s[b]) s[a]--;
				if(s[a] <= s[b]) s[b] = a; else s[a] = b;
				return true;
			}
		}

	}

	final static boolean cases = false;

	public static void main(String[] args) {

		FastScanner s = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		Solver solver = new Solver();
		for (int t = 1, T = cases ? s.nextInt() : 1; t <= T; t++)
			solver.solve(t, s, out);

		out.close();

	}

	static int min(int a, int b) {
		return a < b ? a : b;
	}

	static int max(int a, int b) {
		return a > b ? a : b;
	}

	static long min(long a, long b) {
		return a < b ? a : b;
	}

	static long max(long a, long b) {
		return a > b ? a : b;
	}

	static int swap(int a, int b) {
		return a;
	}

	static Object swap(Object a, Object b) {
		return a;
	}

	static String ts(Object... o) {
		return Arrays.deepToString(o);
	}

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

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

		public FastScanner(File f) throws FileNotFoundException {
			this(new FileInputStream(f));
		}

		public FastScanner(String s) {
			this.stream = new ByteArrayInputStream(s.getBytes(StandardCharsets.UTF_8));
		}

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

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

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

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		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 (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}

		// Jacob Garbage

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

		public int[][] next2DIntArray(int N, int M) {
			int[][] ret = new int[N][];
			for (int i = 0; i < N; i++)
				ret[i] = this.nextIntArray(M);
			return ret;
		}

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

		public long[][] next2DLongArray(int N, int M) {
			long[][] ret = new long[N][];
			for (int i = 0; i < N; i++)
				ret[i] = nextLongArray(M);
			return ret;
		}

		public double[] nextDoubleArray(int N) {
			double[] ret = new double[N];
			for (int i = 0; i < N; i++)
				ret[i] = this.nextDouble();
			return ret;
		}

		public double[][] next2DDoubleArray(int N, int M) {
			double[][] ret = new double[N][];
			for (int i = 0; i < N; i++)
				ret[i] = this.nextDoubleArray(M);
			return ret;
		}

	}
}