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

public class D {

    List<List<Integer>> g = new ArrayList<>();

    int[] color;
    Deque<Integer> cycle = new ArrayDeque<>();

    void paintTree(int u, int p) {
        color[u] = p != -1 ? 3 - color[p] : 1;
        for (int v : g.get(u)) {
            if (v != p && color[v] == 0) {
                paintTree(v, u);
            }
        }
    }

    boolean findCycle(int u, int p) {
        if (color[u] == 1) {
            while (cycle.peekFirst() != u) {
                cycle.removeFirst();
            }
            return true;
        }
        color[u] = 1;
        cycle.addLast(u);
        for (int v : g.get(u)) {
            if (v != p && color[v] != 2) {
                if (findCycle(v, u)) {
                    return true;
                }
            }
        }
        color[u] = 2;
        cycle.removeLast();
        return false;
    }

    void solve() throws IOException {
        in = new InputReader("__std");
        out = new OutputWriter("__std");

        int n = in.readInt();
        int m = in.readInt();
        int k = in.readInt();
        int l = (k + 1) / 2;
        for (int u = 0; u < n; ++u) {
            g.add(new ArrayList<>());
        }
        for (int i = 0; i < m; ++i) {
            int u = in.readInt() - 1;
            int v = in.readInt() - 1;
            g.get(u).add(v);
            g.get(v).add(u);
        }
        color = new int[n];
        if (m == n - 1){
            paintTree(0, -1);
            int cnt = 0;
            for (int u = 0; u < n; ++u) {
                if (color[u] == 1) {
                    ++cnt;
                }
            }
            int selectedColor = cnt >= l ? 1 : 2;
            out.println(1);
            for (int u = 0; u < n && l > 0; ++u) {
                if (color[u] == selectedColor) {
                    out.print((u + 1) + " ");
                    --l;
                }
            }
            out.println();
        } else {
            cycle = new ArrayDeque<>(n);
            findCycle(0, -1);
            boolean useCycle = cycle.size() <= k;
            if (!useCycle) {
                l = l * 2 - 1;
                Arrays.fill(color, 0);
                Iterator<Integer> it = cycle.iterator();
                for (int i = 0; i < l; ++i) {
                    int u = it.next();
                    color[u] = i % 2 + 1;
                }
                it = cycle.iterator();
                for (int i = 0; i < l && !useCycle; ++i) {
                    int u = it.next();
                    for (int v : g.get(u)) {
                        if (color[u] == color[v]) {
                            while (cycle.peekFirst() != u) {
                                cycle.removeFirst();
                            }
                            while (cycle.peekLast() != v) {
                                cycle.removeLast();
                            }
                            useCycle = true;
                            break;
                        }
                    }
                }
                if (!useCycle) {
                    out.println(1);
                    it = cycle.iterator();
                    for (int i = 0; i < l; ++i) {
                        int u = it.next();
                        if (color[u] == 1) {
                            out.print((u + 1) + " ");
                        }
                    }
                    out.println();
                }
            }
            if (useCycle) {
                if (cycle.size() > k) {
                    throw new RuntimeException("cycle len > k");
                }
                out.println(2);
                out.println(cycle.size());
                for (int u : cycle) {
                    out.print((u + 1) + " ");
                }
                out.println();
            }
        }

        exit();
    }

    void exit() {
        out.close();
        //System.err.println((System.currentTimeMillis() - startTime) + " ms");
        System.exit(0);
    }

    InputReader in;
    OutputWriter out;

    //long startTime = System.currentTimeMillis();

    public static void main(String[] args) throws IOException {
        new D().solve();
    }

    class InputReader {

        private InputStream stream;

        private byte[] buffer = new byte[1024];
        private int pos, len;

        private int cur;

        private StringBuilder sb = new StringBuilder(32);

        InputReader(String name) throws IOException {
            if (name.equals("__std")) {
                stream = System.in;
            } else {
                stream = new FileInputStream(name);
            }
            cur = read();
        }

        private int read() throws IOException {
            if (len == -1) {
                throw new EOFException();
            }
            if (pos >= len) {
                pos = 0;
                len = stream.read(buffer);
                if (len == -1) return -1;
            }
            return buffer[pos++] & 0xff;
        }

        boolean whitespace() {
            return cur == ' ' || cur == '\t' || cur == '\r' || cur == '\n' || cur == -1;
        }

        boolean eol() {
            return cur == '\r' || cur == '\n' || cur == -1;
        }

        boolean eof() {
            return cur == -1;
        }

        byte readByte() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            byte res = (byte) cur;
            cur = read();
            return res;
        }

        char readChar() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            char res = (char) cur;
            cur = read();
            return res;
        }

        int readInt() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            while (whitespace()) {
                cur = read();
            }
            if (eof()) {
                throw new EOFException();
            }
            int sign = 1;
            if (cur == '-') {
                sign = -1;
                cur = read();
                if (cur < '0' || cur > '9') {
                    throw new NumberFormatException();
                }
            }
            int res = 0;
            while (!whitespace()) {
                if (cur < '0' || cur > '9') {
                    throw new NumberFormatException();
                }
                res *= 10;
                res += cur - '0';
                cur = read();
            }
            return res * sign;
        }

        long readLong() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            while (whitespace()) {
                cur = read();
            }
            if (eof()) {
                throw new EOFException();
            }
            int sign = 1;
            if (cur == '-') {
                sign = -1;
                cur = read();
                if (cur < '0' || cur > '9') {
                    throw new NumberFormatException();
                }
            }
            long res = 0;
            while (!whitespace()) {
                if (cur < '0' || cur > '9') {
                    throw new NumberFormatException();
                }
                res *= 10;
                res += cur - '0';
                cur = read();
            }
            return res * sign;
        }

        double readDouble() throws IOException {
            return Double.parseDouble(readToken());
        }

        String readToken() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            while (whitespace()) {
                cur = read();
            }
            if (eof()) {
                throw new EOFException();
            }
            sb.setLength(0);
            while (!whitespace()) {
                sb.append((char) cur);
                cur = read();
            }
            return sb.toString();
        }

        String readLine() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            sb.setLength(0);
            while (!eol()) {
                sb.append((char) cur);
                cur = read();
            }
            if (cur == '\r') {
                cur = read();
            }
            if (cur == '\n') {
                cur = read();
            }
            return sb.toString();
        }

        void skipLine() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            while (!eol()) {
                cur = read();
            }
            if (cur == '\r') {
                cur = read();
            }
            if (cur == '\n') {
                cur = read();
            }
        }
    }

    class OutputWriter {

        private PrintWriter writer;

        OutputWriter(String name) throws IOException {
            if (name.equals("__std")) {
                writer = new PrintWriter(System.out);
            } else {
                writer = new PrintWriter(name);
            }
        }

        void print(String format, Object ... args) {
            writer.print(new Formatter(Locale.US).format(format, args));
        }

        void println(String format, Object ... args) {
            writer.println(new Formatter(Locale.US).format(format, args));
        }

        void print(Object value) {
            writer.print(value);
        }

        void println(Object value) {
            writer.println(value);
        }

        void println() {
            writer.println();
        }

        void printArray(int[] a) {
            boolean first = true;
            for (int v : a) {
                if (!first) {
                    writer.print(' ');
                } else {
                    first = false;
                }
                writer.print(v);
            }
            writer.println();
        }

        void printArray(int[][] a) {
            for (int[] v : a) {
                printArray(v);
            }
        }

        void flush() {
            writer.flush();
        }

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