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.util.*;

import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;;

public class E {
	static BufferedReader br;
	static PrintWriter pw;
	static int inf = (int) 1e9;
	static long mod = (long) 1e9 + 7;

	static ArrayList<Integer> primes; // generated by sieve

	/*
	 * 1. Generating a list of prime factors of N
	 */
	static ArrayList<Long> primeFactors(Long N) // O(sqrt(N) / ln sqrt(N))
	{
		ArrayList<Long> factors = new ArrayList<Long>(); // take abs(N) in case of -ve integers
		int idx = 0, p = primes.get(idx);

		while (p * p <= N) {
			if (N % p == 0)
				factors.add((long) p);
			while (N % p == 0) {
				N /= p;
			}
			if (idx + 1 == primes.size())
				break;
			p = primes.get(++idx);
		}

		if (N != 1) // last prime factor may be > sqrt(N)
			factors.add(N); // for integers whose largest prime factor has a power of 1
		return factors;
	}

	static int[] isComposite;

	static void sieve(int N) // O(N log log N)
	{
		isComposite = new int[N + 1];
		isComposite[0] = isComposite[1] = 1; // 0 indicates a prime number
		primes = new ArrayList<Integer>();

		for (int i = 2; i <= N; ++i) // can loop till i*i <= N if primes array is not needed O(N log log sqrt(N))
			if (isComposite[i] == 0) // can loop in 2 and odd integers for slightly better performance
			{
				primes.add(i);
				if (1l * i * i <= N)
					for (int j = i * i; j <= N; j += i) // j = i * 2 will not affect performance too much, may alter in
														// modified sieve
						isComposite[j] = 1;
			}
	}

	public static void main(String[] args) throws NumberFormatException, IOException, InterruptedException {
//		br = new BufferedReader(new FileReader(new File("chief.in")));
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(System.out);
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		adjList = new ArrayList[n];
		for (int i = 0; i < adjList.length; i++) {
			adjList[i] = new ArrayList<>();
		}
		for (int i = 0; i < m; i++) {
			st = new StringTokenizer(br.readLine());
			int u = Integer.parseInt(st.nextToken()) - 1;
			int v = Integer.parseInt(st.nextToken()) - 1;
			adjList[u].add(v);
			adjList[v].add(u);
		}
		s = new int[n];
		cyc = new ArrayList<>();
		alter = new ArrayList[2];
		alter[0] = new ArrayList<>();
		alter[1] = new ArrayList<>();
		depth = new int[n];
		Arrays.fill(depth, -1);
		dfs(0, 0);
		if (cyc.isEmpty()) {
			if (alter[0].size() < alter[1].size()) {
				ArrayList<Integer> temp = alter[0];
				alter[0] = alter[1];
				alter[1] = temp;
			}
			pw.println(1);
			for (int i = 0; i < (k + 1) / 2; i++)
				pw.print(alter[0].get(i) + " ");
		} else {
			if (cyc.size() > k) {
				pw.println(1);
				for (int i = 0; i < (k + 1) / 2; i++) {
					pw.print(cyc.get(i * 2) + " ");
				}
			} else {
				pw.println(2);
				pw.println(cyc.size());
				for (int x : cyc)
					pw.print(x + " ");
			}
		}

		pw.flush();
		pw.close();
	}

	static ArrayList<Integer> cyc, alter[];
	static int[] depth, s;

	static boolean dfs(int u, int d) {
		depth[u] = d;
		s[d] = u;
		alter[d % 2].add(u + 1);
		int low = -1;
		for (int x : adjList[u]) {
			if (depth[x] != -1 && depth[u] - depth[x] > 1) {
				low = Math.max(low, depth[x]);
			}
		}
		if (low != -1) {
			for (int i = low; i <= d; i++)
				cyc.add(s[i] + 1);
			return true;
		}

		for (int x : adjList[u]) {
			if (depth[x] == -1)
				if (dfs(x, d + 1))
					return true;
		}
		return false;
	}

	static final int INF = (int) 1e9; // don't increase, avoid overflow
	static ArrayList<Integer>[] adjList;
//	static ArrayList<Edge>[] adjList;
	static int V;
	static int[] p;

	static class Edge implements Comparable<Edge> {
		int node;
		long cost;

		Edge(int a, long b) {
			node = a;
			cost = b;
		}

		public int compareTo(Edge e) {
			return Long.compare(cost, e.cost);
		}
	}

	static long gcd(long a, long b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	// method to return LCM of two numbers
	static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}

	static double dis(int x, int y, int z, int w) {
		return Math.sqrt((x - z) * (x - z) + (y - w) * (y - w));
	}

	static int[] nxtarr() throws IOException {
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] a = new int[st.countTokens()];
		for (int i = 0; i < a.length; i++) {
			a[i] = Integer.parseInt(st.nextToken());
		}
		return a;
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		@Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			if (y == o.y)
				return x - o.x;
			return y - o.y;
		}

		@Override
		public String toString() {
			// TODO Auto-generated method stub
			return x + " " + y;
		}

	}

	static class triple implements Comparable<triple> {
		int x;
		int y;
		int z;

		public triple(int a, int b, int c) {
			x = a;
			y = b;
			z = c;
		}

		@Override
		public int compareTo(triple o) {
			// TODO Auto-generated method stub
			return x - o.x;
		}

		@Override
		public String toString() {
			// TODO Auto-generated method stub
			return x + " " + y + " " + z;
		}
	}

}
