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.Arrays;
import java.lang.reflect.Array;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.function.Supplier;
import java.util.TreeSet;
import java.util.ArrayList;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;
import java.util.function.IntFunction;

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

    static class DPosledneeSledstvieYekhaba {
        int testNumber;
        InputReader in;
        OutputWriter out;

        public void solve() {
            int n = in.readInt();
            int m = in.readInt();
            int k = in.readInt();

            TreeGraph tg = new TreeGraph(n);

            for (int i = 0; i < m; i++) {
                tg.addEdgeBi(in.readInt() - 1, in.readInt() - 1);
            }

            ArrayList<Integer> a1 = findSet(tg, (k + 1) / 2);
            if (a1 != null) {
                out.println(1);
                for (int i : a1) {
                    out.print((i + 1) + " ");
                }
                out.println();
            } else {
                a1 = findCycle(tg, k);

                if (a1 == null) {
                    throw new RuntimeException();
                }

                out.println(2);
                out.println(a1.size());
                for (int j : a1) {
                    out.print((j + 1) + " ");
                }
                out.println();
                return;

            }

        }

        ArrayList<Integer> findCycle(TreeGraph tg, int k) {

            TreeSet<IntPt> set = new TreeSet<>();
            for (int i = 0; i < tg.n; i++) {
                set.add(new IntPt(tg.edges[i].size(), i));
            }

            var dc = new DPosledneeSledstvieYekhaba.DetectCycles(tg, k);

            for (int i = 0; i < tg.n; i++) {
                var top = set.pollLast();

                if (top == null) {
                    return null;
                }
                int startNode = top.y;

                dc.bfsHasCycle(startNode, 0, -1, new ArrayList<>());

                if (dc.bestPath != null && dc.bestPath.size() <= k) {
                    return dc.bestPath;
                }
            }

            return null;
        }

        ArrayList<Integer> findSet(TreeGraph tg, int k) {
            int[] st = new int[tg.n];
            for (int i = 0; i < tg.n; i++) {
                st[i] = tg.edges[i].size();
            }

            TreeSet<IntPt> set = new TreeSet<>();
            for (int i = 0; i < tg.n; i++) {
                set.add(new IntPt(st[i], i));
            }

            ArrayList<Integer> res = new ArrayList<>();
            for (int i = 0; i < k; i++) {
                if (set.isEmpty()) {
                    return null;
                }

                IntPt cur = set.pollFirst();

                res.add(cur.y);

                for (int to : tg.edges[cur.y]) {
                    set.remove(new IntPt(st[to], to));

                    for (int to2 : tg.edges[to]) {
                        if (set.contains(new IntPt(st[to2], to2))) {
                            set.remove(new IntPt(st[to2], to2));
                            st[to2]--;
                            set.add(new IntPt(st[to2], to2));
                        }
                    }
                }
            }

            return res;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            this.testNumber = testNumber;
            this.in = in;
            this.out = out;

            solve();
        }

        public static class DetectCycles {
            private TreeGraph tg;
            private int[] color;
            private int[] incTime;
            private int MARK_IN_CUR_PATH = 1;
            private int MARK_VISITED = 2;
            ArrayList<Integer> bestPath;
            int k;

            public DetectCycles(TreeGraph tg, int k) {
                this.tg = tg;
                color = new int[tg.n];
                incTime = new int[tg.n];
                Arrays.fill(incTime, -1);
                this.k = k;
            }

            void bfsHasCycle(int node, int time, int from, ArrayList<Integer> curPath) {
                if (time > k) return;
                if (bestPath != null && bestPath.size() <= k) {
                    return;
                }

                if (color[node] == MARK_IN_CUR_PATH) {
                    int toTime = incTime[node];

                    int distance = time - toTime;
                    if (bestPath == null && distance <= k) {
                        bestPath = new ArrayList<>();
                        for (int i = 0; i < distance; i++) {
                            bestPath.add(curPath.get(curPath.size() - 1 - i));
                        }
                    }

                    return;
                } else if (color[node] == MARK_VISITED) {
                    return;
                }
                color[node] = MARK_IN_CUR_PATH;
                incTime[node] = time;
                curPath.add(node);

                for (int to : tg.edges[node]) {
                    if (to != from) {
                        bfsHasCycle(to, time + 1, node, curPath);
                    }
                }
                color[node] = MARK_VISITED;
                curPath.remove(curPath.size() - 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() {
            writer.println();
        }

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

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

    }

    static class IntPt implements Comparable<IntPt>, IPt<Integer, Integer> {
        public final int x;
        public final int y;

        public IntPt(int k, int v) {
            x = k;
            y = v;
        }

        public IntPt(IntPt entry) {
            this(entry.getX(), entry.getY());
        }

        public Integer getX() {
            return x;
        }

        public Integer getY() {
            return y;
        }

        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (!(o instanceof IntPt)) {
                return false;
            } else {
                return x == ((IntPt) o).x && y == ((IntPt) o).y;
            }
        }

        public int hashCode() {
            int result = Integer.hashCode(x);

            final int h = Integer.hashCode(y);
            result = 37 * result + h ^ (h >>> 16);

            return result;
        }

        public String toString() {
            return "[" + getX() + ", " + getY() + "]";
        }

        public int compareTo(IntPt o) {
            if (x == o.x) {
                return Integer.compare(y, o.y);
            }
            return Integer.compare(x, o.x);
        }

    }

    static interface IPt<A, B> {
    }

    static final class Utils {
        private Utils() {
        }

        public static <T> T[] makeArrayInd(int n, IntFunction<T> creator) {
            if (n > 0) {
                T first = creator.apply(0);
                T[] res = (T[]) Array.newInstance(first.getClass(), n);
                res[0] = first;

                for (int i = 1; i < n; i++) {
                    res[i] = creator.apply(i);
                }

                return res;
            } else {
                return null;
            }
        }

        public static <T> T[] makeArray(int n, Supplier<T> creator) {
            return makeArrayInd(n, value -> creator.get());
        }

    }

    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 static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private 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 readInt() {
            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 interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class TreeGraph {
        public int n;
        public ArrayList<Integer>[] edges;

        public TreeGraph(int n) {
            this.n = n;
            this.edges = Utils.makeArray(n, ArrayList::new);
        }

        public void addEdge(int from, int to) {
            edges[from].add(to);
        }

        public void addEdgeBi(int a, int b) {
            addEdge(a, b);
            addEdge(b, a);
        }

    }
}