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.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) throws Exception {
        ScanReader in = new ScanReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        Solver main = new Solver();
        int test = 1;
        for (int i = 1; i <= test; i++) main.solve(i, in, out);
        out.close();
    }
}

class Solver {
    int[][] G;
    int[] parent;
    int[] level;
    int mod;
    boolean[] visited;
    int k;
    List<Integer> list;

    public static int[][] packGraph(int[] from, int[] to, int n, int m) {
        int[][] g = new int[n + 1][];
        int[] p = new int[n + 1];
        for (int i = 0; i < m; i++) p[from[i]]++;
        for (int i = 0; i < m; i++) p[to[i]]++;
        for (int i = 0; i <= n; i++) g[i] = new int[p[i]];
        for (int i = 0; i < m; i++) {
            g[from[i]][--p[from[i]]] = to[i];
            g[to[i]][--p[to[i]]] = from[i];
        }
        return g;
    }

    public void dfs1(int node, int parent) {
        if (mod != -1) return;
        this.parent[node] = parent;
        level[node] = level[parent] + 1;
        visited[node] = true;
        for (int i : G[node]) {
            if (i == parent) continue;
            if (visited[i] ) {
                if (level[node] - level[i] + 1 <= k && level[i] < level[node]) {
                    int temp = node;
                    while (temp != i) {
                        list.add(temp);
                        temp = this.parent[temp];
                    }
                    list.add(i);
                    mod = 2;
                    return;
                }
                continue;
            }
            dfs1(i, node);
            if (mod != -1) return;
        }
    }

    public void dfs2(int node, int parent) {
        if (mod != -1) return;
        this.parent[node] = parent;
        level[node] = level[parent] + 1;
        visited[node] = true;
        for (int i : G[node]) {
            if (i == parent) continue;
            if (visited[i]) {
                if (level[node] - level[i] + 1 > k && level[i] < level[node]) {
                    int temp = node;
                    boolean add = true;
                    while (list.size() < k / 2 + (k % 2)) {
                        if (add) list.add(temp);
                        temp = this.parent[temp];
                        add ^= true;
                    }

                    mod = 1;
                    return;
                }
                continue;
            }
            dfs2(i, node);
            if (mod != -1) return;
        }
    }

    public void solve(int testNumber, ScanReader in, PrintWriter out) throws IOException {
        int n = in.scanInt();
        int m = in.scanInt();
        k = in.scanInt();
        int[] from = new int[m];
        int[] to = new int[m];
        for (int i = 0; i < m; i++) {
            from[i] = in.scanInt();
            to[i] = in.scanInt();
        }
        G = packGraph(from, to, n, m);
        visited = new boolean[n + 1];
        parent = new int[n + 1];
        level = new int[n + 1];
        mod = -1;
        list = new ArrayList<>();
        // mod 2 cycle
        dfs1(1, 0);
        if (mod == 2) {
            out.println(2);
            out.println(list.size());
            for (int i : list) out.print(i + " ");
            out.println();
            return;
        }
        visited = new boolean[n + 1];
        parent = new int[n + 1];
        level = new int[n + 1];
        dfs2(1, 0);
        if (mod == 1) {
            out.println(1);
            if (list.size() != k / 2 + (k % 2)) throw new RuntimeException("NO");
            for (int i : list) out.print(i + " ");
            out.println();
            return;
        }

        int odd = 0;
        int even = 0;
        for (int i = 1; i <= n; i++)
            if (level[i] % 2 == 0) even++;
            else odd++;
        if (even >= k / 2 + (k % 2)) {
            for (int i = 1; i <= n && list.size() < (k / 2 + (k % 2)); i++) if (level[i] % 2 == 0) list.add(i);
        } else if (odd >= k / 2 + (k % 2)) {
            for (int i = 1; i <= n && list.size() < (k / 2 + (k % 2)); i++) if (level[i] % 2 == 1) list.add(i);
        } else {
            throw new RuntimeException("NO");
        }
        out.println(1);
        for (int i : list) out.print(i + " ");
        out.println();

    }

}


class ScanReader {
    private final byte[] buf = new byte[4 * 1024];
    private final BufferedInputStream in;
    private int index;
    private int total;

    public ScanReader(InputStream inputStream) {
        in = new BufferedInputStream(inputStream);
    }

    private int scan() throws IOException {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) return -1;
        }
        return buf[index++];
    }

    public char scanChar() throws IOException {
        int c = scan();
        while (isWhiteSpace(c)) c = scan();
        return (char) c;
    }


    public int scanInt() throws IOException {
        int integer = 0;
        int n = scan();
        while (isWhiteSpace(n)) n = scan();
        int neg = 1;
        if (n == '-') {
            neg = -1;
            n = scan();
        }
        while (!isWhiteSpace(n)) {
            if (n >= '0' && n <= '9') {
                integer *= 10;
                integer += n - '0';
                n = scan();
            }
        }
        return neg * integer;
    }

    public String scanString() throws IOException {
        int c = scan();
        while (isWhiteSpace(c)) c = scan();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = scan();
        } while (!isWhiteSpace(c));
        return res.toString();
    }

    private boolean isWhiteSpace(int n) {
        return n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1;
    }

    public long scanLong() throws IOException {
        long integer = 0;
        int n = scan();
        while (isWhiteSpace(n)) n = scan();
        int neg = 1;
        if (n == '-') {
            neg = -1;
            n = scan();
        }
        while (!isWhiteSpace(n)) {
            if (n >= '0' && n <= '9') {
                integer *= 10;
                integer += n - '0';
                n = scan();
            }
        }
        return neg * integer;
    }

    public void scanLong(long[] A) throws IOException {
        for (int i = 0; i < A.length; i++) A[i] = scanLong();
    }

    public void scanInt(int[] A) throws IOException {
        for (int i = 0; i < A.length; i++) A[i] = scanInt();
    }

    public double scanDouble() throws IOException {
        int c = scan();
        while (isWhiteSpace(c)) c = scan();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = scan();
        }
        double res = 0;
        while (!isWhiteSpace(c) && c != '.') {
            if (c == 'e' || c == 'E') {
                return res * Math.pow(10, scanInt());
            }
            res *= 10;
            res += c - '0';
            c = scan();
        }
        if (c == '.') {
            c = scan();
            double m = 1;
            while (!isWhiteSpace(c)) {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, scanInt());
                }
                m /= 10;
                res += (c - '0') * m;
                c = scan();
            }
        }
        return res * sgn;
    }

}