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

public class D {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1024];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1024);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    Vertex failed;

    public void go() throws IOException {
        // in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1024);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int n = ipar();
        int m = ipar();
        int k = ipar();
        Vertex[] vertices = new Vertex[n];
        for (int i = 0; i < n; i++) {
            vertices[i] = new Vertex(i);
        }
        for (int i = 0; i < m; i++) {
            int a = ipar()-1;
            int b = ipar()-1;
            vertices[a].others.add(vertices[b]);
            vertices[b].others.add(vertices[a]);
        }
        ArrayList<Integer> cycle = dfs(vertices[0], null, 0, k);
        if (cycle != null) {
            out.println(2);
            out.println(cycle.size());
            for (int x : cycle) {
                out.print(x);
                out.print(" ");
            }
            out.println();
            return;
        }
        // int logn = 0;
        // while (1 << logn <= n) {
        //     logn++;
        // }
        // int[][] dp = new int[n][logn];
        // for (int i = 0; i < n; i++) {
        //     dp[i][0] = vertices[i].parent == null ? -1 : vertices[i].parent.i;
        // }
        // for (int p = 1; p < logn; p++) {
        //     for (int i = 0; i < n; i++) {
        //         dp[i][p] = -1;
        //         if (dp[i][p-1] >= 0) {
        //             dp[i][p] = dp[dp[i][p-1]][p-1];
        //         }
        //     }
        // }
        // for (int[] arr : dp) {
        //     out.println(Arrays.toString(arr));
        // }
        // for (Vertex curr : vertices) {
        //     for (Vertex other : curr.others) {
        //         if (curr.parent == other || other.parent == curr) {
        //             continue;
        //         }
        //         Vertex lca = vertices[getLca(dp, vertices, curr.i, other.i)];
        //         // out.printf("%d %d = %d%n", curr.i, other.i, lca.i);
        //         if (curr.depth - lca.depth + other.depth - lca.depth + 1 <= k) {
        //             int len = curr.depth - lca.depth + other.depth - lca.depth + 1;
        //             StringBuilder sb = new StringBuilder();
        //             while (curr != lca) {
        //                 sb.append(curr.i+1).append(' ');
        //                 curr = curr.parent;
        //             }
        //             sb.append(lca.i+1);
        //             sb.reverse();
        //             while (other != lca) {
        //                 sb.append(' ').append(other.i+1);
        //                 other = other.parent;
        //             }
        //             out.println(2);
        //             out.println(len);
        //             out.println(sb);
        //             return;
        //         }
        //     }
        // }
        for (int i = 0; i < 100; i++) {
            for (Vertex v : vertices) {
                v.set = -1;
            }
            int start = (int)(Math.random() * n);
            int count = indepSet(vertices[start]);
            if (count >= (k+1)/2) {
                count = (k+1)/2;
                out.println(1);
                for (Vertex v : vertices) {
                    if (v.set == 1) {
                        out.print(v.i+1);
                        out.print(" ");
                        count--;
                        if (count == 0) {
                            out.println();
                            return;
                        }
                    }
                }
            }
        }
    }

    int getLca(int[][] dp, Vertex[] vertices, int a, int b) {
        int n = dp.length;
        int logn = dp[0].length;
        if (vertices[a].depth < vertices[b].depth) {
            int temp = a;
            a = b;
            b = temp;
        }
        int c = a;
        for (int i = logn-1; i >= 0; i--) {
            if (vertices[c].depth - (1 << i) >= vertices[b].depth) {
                c = dp[c][i];
            }
        }
        if (b == c) {
            return b;
        }
        for (int i = logn-1; i >= 0; i--) {
            if (dp[b][i] != -1 && dp[b][i] != dp[c][i]) {
                b = dp[b][i];
                c = dp[c][i];
            }
        }
        return vertices[b].parent.i;
    }

    ArrayList<Integer> dfs(Vertex curr, Vertex prev, int d, int k) {
        curr.depth = d;
        for (Vertex other : curr.others) {
            if (other.depth == -1) {
                other.parent = curr;
                ArrayList<Integer> ans = dfs(other, curr, d+1, k);
                if (ans != null) {
                    return ans;
                }
            } else if (!other.done && other != prev && curr.depth - other.depth + 1 <= k) {
                ArrayList<Integer> ans = new ArrayList<>();
                Vertex v = curr;
                while (v != other) {
                    ans.add(v.i+1);
                    v = v.parent;
                }
                ans.add(v.i+1);
                return ans;
            }
        }
        curr.done = true;
        return null;
    }

    int indepSet(Vertex curr) {
        boolean canSet = true;
        for (Vertex other : curr.others) {
            if (other.set == 1) {
                canSet = false;
                break;
            }
        }
        curr.set = canSet ? 1 : 0;
        int count = curr.set;
        for (Vertex other : curr.others) {
            if (other.set == -1) {
                count += indepSet(other);
            }
        }
        return count;
    }

    public class Vertex {
        int i;
        ArrayList<Vertex> others;
        Vertex parent;
        int set;
        int depth;
        boolean done;

        public Vertex(int i) {
            this.i = i;
            others = new ArrayList<>();
            set = -1;
            depth = -1;
        }
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new D().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}