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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.io.BufferedWriter;
import java.util.Collection;
import java.util.Random;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Stream;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public static int[] findCycle(List<Integer>[] graph) {
            int n = graph.length;
            int[] color = new int[n];
            int[] next = new int[n];
            for (int u = 0; u < n; u++) {
                if (color[u] != 0) continue;
                int[] cycleStart = dfs(graph, u, color, next);
                if (cycleStart[0] != -1) {
                    List<Integer> cycle = new ArrayList<>();
//                System.out.println(Arrays.toString(cycleStart) + " " + Arrays.toString(next));
                    int i = cycleStart[0];
                    for (; ; i = next[i]) {
                        cycle.add(i);
                        if (i == cycleStart[1]) break;
                    }
                    return cycle.stream().mapToInt(Integer::intValue).toArray();
                }
            }
            return null;
        }

        static int[] dfs(List<Integer>[] graph, int u, int[] color, int[] next) {
            color[u] = 1;
            for (int v : graph[u])
                if (v != next[u]) {
                    if (color[v] == 0) {
                        next[v] = u;
                        int[] cycleStart = dfs(graph, v, color, next);
                        if (cycleStart[0] != -1) {
                            return cycleStart;
                        }
                    } else {
                        if (color[v] == 1) {
                            int[] ret = {u, v};
                            return ret;
                        }
                    }
                }
            color[u] = 2;
            int[] ret = {-1, -1};
            return ret;
        }

        void dfs1(int node, int[] vis, List<Integer>[] graph, ArrayList<Integer> odd, ArrayList<Integer> even, int depth) {
            if (depth == 0) even.add(node + 1);
            else odd.add(node + 1);
            vis[node] = 1;
            for (int v : graph[node])
                if (vis[v] == 0) {
                    dfs1(v, vis, graph, odd, even, depth ^ 1);
                }
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt(), m = in.nextInt(), k = in.nextInt();
            List<Integer>[] graph = Stream.generate(ArrayList::new).limit(n).toArray(List[]::new);
            for (int i = 0; i < m; i++) {
                int u = in.nextInt() - 1, v = in.nextInt() - 1;
                graph[u].add(v);
                graph[v].add(u);
            }
            if (m == n - 1) {
                out.println(1);
                ArrayList<Integer> odd = new ArrayList<>(), even = new ArrayList<>();
                int[] vis = new int[n];
                dfs1(0, vis, graph, odd, even, 0);
                ArrayList<Integer> ans = new ArrayList();
                if (odd.size() > even.size()) {
                    ans = odd;
                } else ans = even;

                for (int i = 0; i < (k + 1) / 2; i++) out.print(ans.get(i) + " ");
                out.println();
                return;
            }
            int[] cycle = findCycle(graph);
//        System.out.println(Arrays.toString(cycle));
            Random rnd = new Random();
            while (cycle.length > k) {
                HashSet<Integer> hs = new HashSet<>();
                for (int v : cycle) hs.add(v);
                int L = cycle.length;
                boolean found = false;
                ArrayList<Integer> al = new ArrayList<>();
                for (int i = 0; i < L; i++) al.add(i);
                Collections.shuffle(al);

                for (int ii = 0; ii < L && !found; ii++) {
                    int i = al.get(ii);
                    int u = cycle[i];
                    for (int v : graph[u])
                        if (v != cycle[(i + L - 1) % L] && v != cycle[(i + 1) % L] && hs.contains(v)) {
//                    System.out.println(i + " " + u + " " + v);
                            found = true;
                            ArrayList<Integer> newc = new ArrayList<>();
                            for (int j = i; ; ) {
                                int node = cycle[j];
                                newc.add(node);
                                if (node == v) break;
                                j++;
                                if (j == L) j = 0;
                            }
                            int[] newCycle = new int[newc.size()];
                            for (int j = 0; j < newCycle.length; j++) newCycle[j] = newc.get(j);
                            cycle = newCycle.clone();

                            break;
                        }
                }
//            System.out.println(Arrays.toString(cycle));
                if (!found) break;
            }
            if (cycle.length <= k) {
                out.println(2);
                out.println(cycle.length);
                for (int v : cycle) out.print((v + 1) + " ");
                out.println();
            } else {
                out.println(1);
                for (int i = 0; i < (k + 1) / 2; i++) out.print((cycle[2 * i] + 1) + " ");
            }
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
            writer.print('\n');
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.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 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 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;
        }

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

        }

    }
}