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

/**
 * @author Mubtasim Shahriar
 */

public class EhabLastCorollary {


	public static void main(String[] args) {

		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader sc = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Solver solver = new Solver();
		//		int t = sc.nextInt();
		int t = 1;
		while(t--!=0) {
			solver.solve(sc, out);
		}		
		out.close();

	}

	static class Solver {
		private int n;
		private int m;
		private int k;
		private ArrayList<Integer>[] gp;
		private Deque<Integer> cycle;
		private ArrayList<Edge> edges;
		private ArrayList<Integer> serial;
		private boolean foundCycle;
		private int[] pos;
		private boolean[] inCycle;
		private ArrayList<Integer>[] color;
		private int[] col;

		public void solve(InputReader sc, PrintWriter out) {
			n = sc.nextInt();
			m = sc.nextInt();
			k = sc.nextInt();
			gp = new ArrayList[n];
			edges = new ArrayList<Edge>();
			for(int i = 0; i < n; i++) gp[i] = new ArrayList();
			for(int i = 0; i < m; i++) {
				int s = sc.nextInt()-1;
				int d = sc.nextInt()-1;
				gp[s].add(d);
				gp[d].add(s);
				edges.add(new Edge(s,d));
			}
			cycle = new LinkedList<Integer>();
			serial = new ArrayList<Integer>();
			pos = new int[n];
			Arrays.fill(pos, -1);
			foundCycle = false;
			inCycle = new boolean[n];
			dfs(0);
			if(foundCycle) {
				for(Edge e : edges) {
					if(inCycle[e.s] && inCycle[e.d] && Math.abs(pos[e.s]-pos[e.d])>1) {
						while(!cycle.isEmpty() && (int)cycle.getFirst()!=e.s && (int)cycle.getFirst()!=e.d) {
							inCycle[cycle.pollFirst()] = false;
						}
						while(!cycle.isEmpty() && (int)cycle.getLast()!=e.s && (int)cycle.getLast()!=e.d) {
							inCycle[cycle.pollLast()] = false;
						}
					}
				}
				if(cycle.size()<=k) {
					out.println(2);
					out.println(cycle.size());
					for(int i : cycle) out.print(i+1 + " ");
					out.println();
				} else {
					int tot = 0;
					out.println(1);
					//					out.println("HI");
					//					out.println(cycle);
					while(tot!=(k+1)/2) {
						out.print(cycle.pollFirst()+1 + " ");
						cycle.pollFirst();
						tot++;
					}
					out.println();
				}
			} else {
				color = new ArrayList[2];
				for(int i = 0; i < 2; i++) color[i] = new ArrayList();
				col = new int[n];
				dfscol(0,-1);
				int idx = color[0].size()>color[1].size() ? 0 : 1;
				out.println(1);
				for(int i = 0; i < (k+1)/2; i++) out.print(color[idx].get(i)+1 + " ");
				out.println();
			}
		}

		private void dfscol(int src, int par) {
			if(par==-1) {
				col[src] = 0;
				color[0].add(src);
			} else {
				col[src] = col[par]^1;
				color[col[src]].add(src);
			}
			for(int v : gp[src]) if(v!=par) dfscol(v,src);
		}

		private void dfs(int src) {
			pos[src] = serial.size();
			serial.add(src);
			for(int v : gp[src]) {
				if(pos[v]==-1) dfs(v);
				else if(!foundCycle && pos[src]-pos[v]>1) {
					foundCycle = true;
					for(int i = pos[v]; i <= pos[src]; i++) {
						cycle.add(serial.get(i));
						inCycle[serial.get(i)] = true;
					}
				}
			}
			serial.remove(serial.size()-1);
		}

	}

	static class Edge {
		int s, d;
		Edge(int s, int d) {
			this.s=s;
			this.d=d;
		}
	}

	static class InputReader { 
		private boolean finished = false;

		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 int peek() {
			if (numChars == -1) {
				return -1;
			}
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					return -1;
				}
				if (numChars <= 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 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 String nextString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				if (Character.isValidCodePoint(c)) {
					res.appendCodePoint(c);
				}
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null) {
				return filter.isSpaceChar(c);
			}
			return isWhitespace(c);
		}

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

		private String readLine0() {
			StringBuilder buf = new StringBuilder();
			int c = read();
			while (c != '\n' && c != -1) {
				if (c != '\r') {
					buf.appendCodePoint(c);
				}
				c = read();
			}
			return buf.toString();
		}

		public String readLine() {
			String s = readLine0();
			while (s.trim().length() == 0) {
				s = readLine0();
			}
			return s;
		}

		public String readLine(boolean ignoreEmptyLines) {
			if (ignoreEmptyLines) {
				return readLine();
			} else {
				return readLine0();
			}
		}

		public BigInteger readBigInteger() {
			try {
				return new BigInteger(nextString());
			} catch (NumberFormatException e) {
				throw new InputMismatchException();
			}
		}

		public char nextCharacter() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			return (char) c;
		}

		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 boolean isExhausted() {
			int value;
			while (isSpaceChar(value = peek()) && value != -1) {
				read();
			}
			return value == -1;
		}

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

		public SpaceCharFilter getFilter() {
			return filter;
		}

		public void setFilter(SpaceCharFilter filter) {
			this.filter = filter;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
		public int[] nextIntArray(int n){
			int[] array=new int[n];
			for(int i=0;i<n;++i)array[i]=nextInt();
			return array;
		}
		public int[] nextSortedIntArray(int n){
			int array[]=nextIntArray(n);
			Arrays.sort(array);
			return array;
		}
		public int[] nextSumIntArray(int n){
			int[] array=new int[n];
			array[0]=nextInt();
			for(int i=1;i<n;++i)array[i]=array[i-1]+nextInt();
			return array;
		}
		public long[] nextLongArray(int n){
			long[] array=new long[n];
			for(int i=0;i<n;++i)array[i]=nextLong();
			return array;
		}
		public long[] nextSumLongArray(int n){
			long[] array=new long[n];
			array[0]=nextInt();
			for(int i=1;i<n;++i)array[i]=array[i-1]+nextInt();
			return array;
		}
		public long[] nextSortedLongArray(int n){
			long array[]=nextLongArray(n);
			Arrays.sort(array);
			return array;
		}
	}


}
