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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.function.Predicate;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author out_of_the_box
 */
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);
        DEhabsLastCorollary solver = new DEhabsLastCorollary();
        solver.solve(1, in, out);
        out.close();
    }

    static class DEhabsLastCorollary {
        MiscUtility ut;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            ut = new MiscUtility(false);
            int n = in.nextInt();
            int m = in.nextInt();
            int k = in.nextInt();
            List<List<Integer>> graph = new ArrayList<>(n);
            for (int i = 0; i < n; i++) {
                graph.add(new ArrayList<>());
            }
            for (int i = 0; i < m; i++) {
                int u = in.nextInt();
                u--;
                int v = in.nextInt();
                v--;
                graph.get(u).add(v);
                graph.get(v).add(u);
            }
            int[] rank = new int[n];
//        List<Integer> ans = dfs(n, graph, rank);
            int hk = MathUtility.ceil(k, 2);
//        ut.printDebug(hk, "hk");
            if (m == (n - 1)) {
                ndfs(n, graph, rank, k, out);
                int ecnt = 0;
                for (int i = 0; i < n; i++) {
                    if ((rank[i] & 1) == 0) {
                        ecnt++;
                    }
                }
                Predicate<Integer> pred = (ecnt >= hk) ? (ind -> ((rank[ind] & 1) == 0)) : (ind -> ((rank[ind] & 1) != 0));
                int r = hk;
                out.println(1);
                for (int i = 0; i < n && r != 0; i++) {
                    if (pred.test(i)) {
                        out.print((i + 1) + " ");
                        r--;
                    }
                }
                out.println();
            } else {
                boolean done = ndfs(n, graph, rank, k, out);
                if (!done) {
                    printAns(n, graph, rank, k, out);
                }
            }
//        if (ans.isEmpty()) {
//            //Tree case
//            int ecnt = 0;
//            for (int i = 0; i < n; i++) {
//                if ((rank[i]&1) == 0) {
//                    ecnt++;
//                }
//            }
//            Predicate<Integer> pred = (ecnt >= hk) ? (ind -> ((rank[ind]&1) == 0)) : (ind -> ((rank[ind]&1) != 0));
//            int r = hk;
//            out.println(1);
//            for (int i = 0; i < n && r != 0; i++) {
//                if (pred.test(i)) {
//                    out.print((i+1) + " ");
//                    r--;
//                }
//            }
//            out.println();
//        } else {
//            int minCycle = ans.size();
////            ut.printDebug(minCycle, "minCycle");
//            if (minCycle <= k) {
//                out.println(2);
//                out.println(minCycle);
//                for (int val : ans) {
//                    out.print((val+1)+ " ");
//                }
//                out.println();
//            } else {
//                out.println(1);
//                for (int i = 0, r=0; r < hk; i+=2, r++) {
//                    out.print((ans.get(i) + 1) + " ");
//                }
//                out.println();
//            }
//        }
        }

        private boolean printAns(int n, List<List<Integer>> graph, int[] rank, int k, OutputWriter out) {
            boolean[] dis = new boolean[n];
            dis[0] = true;
            rank[0] = 0;
            int[] p = new int[n];
            p[0] = -1;
            return printAnsUtil(0, dis, graph, rank, p, k, out);
        }

        private boolean printAnsUtil(int s, boolean[] dis, List<List<Integer>> graph, int[] rank, int[] p, int k,
                                     OutputWriter out) {
            for (int v : graph.get(s)) {
                if (!dis[v]) {
                    dis[v] = true;
                    rank[v] = rank[s] + 1;
                    p[v] = s;
                    boolean ans = printAnsUtil(v, dis, graph, rank, p, k, out);
                    if (ans) return true;
                } else if (v != p[s]) {
                    int cand = Math.abs(rank[s] - rank[v]) + 1;
                    MiscUtility.assertion(cand > k, String.format("cand [%d] is <= k [%d]", cand, k));
                    out.println(1);
                    int curr = s;
                    int hk = MathUtility.ceil(k, 2);
                    for (int i = 0; i < hk; i++) {
                        out.print((curr + 1) + " ");
                        curr = p[curr];
                        curr = p[curr];
                    }
                    return true;
                }
            }
            return false;
        }

        private boolean ndfs(int n, List<List<Integer>> graph, int[] rank, int k, OutputWriter out) {
            boolean[] dis = new boolean[n];
            dis[0] = true;
            rank[0] = 0;
            int[] p = new int[n];
            p[0] = -1;
            return ndfsUtil(0, dis, graph, rank, p, k, out);
        }

        private boolean ndfsUtil(int s, boolean[] dis, List<List<Integer>> graph, int[] rank, int[] p, int k,
                                 OutputWriter out) {
            for (int v : graph.get(s)) {
                if (!dis[v]) {
                    dis[v] = true;
                    rank[v] = rank[s] + 1;
                    p[v] = s;
                    boolean ans = ndfsUtil(v, dis, graph, rank, p, k, out);
                    if (ans) return true;
                } else if (v != p[s]) {
                    int cand = Math.abs(rank[s] - rank[v]) + 1;
                    if (cand <= k) {
                        out.println(2);
                        out.println(cand);

                        int curr = s;
                        out.print((curr + 1) + " ");
                        do {
                            curr = p[curr];
                            out.print((curr + 1) + " ");
                        } while (curr != v);
                        out.println();
                        return true;
                    }
                }
            }
            return false;
        }

    }

    static class MathUtility {
        public static int ceil(int num, int denom) {
            if (num % denom == 0) return num / denom;
            return num / denom + 1;
        }

    }

    static class MiscUtility {
        private boolean debug;

        public MiscUtility() {
            debug = System.getProperty("ONLINE_JUDGE") == null;
        }

        public MiscUtility(boolean debug) {
            this.debug = debug;
        }

        public static void assertion(boolean condition, String message) {
            if (!condition) {
                throw new RuntimeException("Assertion failed. " + message);
            }
        }

    }

    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);

        }

    }

    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() {
            writer.println();
        }

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

        public void println(int i) {
            writer.println(i);
        }

    }
}

