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:
/**
 * @author derrick20
 */
import java.io.*;
import java.util.*;

public class LastCorollary implements Runnable {
    public static void main(String[] args) throws Exception {
        new Thread(null, new LastCorollary(), ": )", 1 << 28).start();
    }

    public void run() {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        N = sc.nextInt();
        int M = sc.nextInt();
        int k = sc.nextInt();
        adjList = new ArrayList[N];
        Arrays.setAll(adjList, i -> new ArrayList<>());
        for (int i = 0; i < M; i++) {
            int u = sc.nextInt() - 1;
            int v = sc.nextInt() - 1;
            adjList[u].add(v);
            adjList[v].add(u);
        }
        // the two conditions aren't random:
        // if we can find a cycle, either it's < k or >= k
        // in the first case, we've satisfied the second condition
        // in the second case, we have a cycle that's k long which we can alternate
        // in a ring fashioN!
        // and if we couldn't find a cycle at all, then it's a tree, so we
        // can take every other node into two groups!

        groups = new ArrayList[2];
        Arrays.setAll(groups, i -> new ArrayList<>());
        vis = new boolean[N];
        parent = new int[N];
        cycle = new ArrayDeque<>();
        bfsCycle();
        int need = (k + 1) / 2;
//        System.out.println(cycle);
        if (cycle.size() > 0) {
            if (cycle.size() <= k) {
                // the issue is that for odd k, if we are equal to it, we can't
                // get an independent set of ceil(k / 2). so, we have to do the cycle
                out.println(2);
                out.println(cycle.size());
                StringBuilder ans = new StringBuilder();
                for (int node : cycle) {
                    ans.append(node + 1).append(" ");
                }
                out.println(ans);
            } else {
                // we can find an independent set by alternating!
                StringBuilder ans = new StringBuilder();
                // if odd we'll get half and one extra, if even it'll be half
                while (cycle.size() > 0 && need > 0) {
                    ans.append(cycle.pollFirst() + 1).append(" ");
                    need--;
                    cycle.pollFirst();
                }
                out.println(1);
                out.println(ans);
            }
        } else {
            dfsTree(0, -1, 0);
            int which = groups[0].size() >= groups[1].size() ? 0 : 1;
            // it's always possible for input.
            ASSERT(groups[which].size() >= need);
            StringBuilder ans = new StringBuilder();
            for (int i = 0; i < need; i++) {
                ans.append(groups[which].get(i) + 1).append(" ");
            }
            out.println(1);
            out.println(ans);
        }
        out.close();
    }

    static ArrayList<Integer>[] adjList;
    static ArrayList<Integer>[] groups;
    static int[] parent;
    static ArrayDeque<Integer> cycle;
    static boolean[] vis;
    static int N;

    static void bfsCycle() {
        ArrayDeque<Integer> q = new ArrayDeque<>();
        int[] level = new int[N];
        q.add(0);
        q.add(-1);
        vis[0] = true;
        parent[0] = -1;
        while (q.size() > 0) {
            int node = q.pollFirst();
            int par = q.pollFirst();
            for (int adj : adjList[node]) {
                if (adj != par) {
//                    System.out.println("Visiting " + adj + " from " + node);
                    if (!vis[adj]) {
                        vis[adj] = true;
                        parent[adj] = node;
                        level[adj] = level[node] + 1;
//                        System.out.println(Arrays.toString(level));
                        q.add(adj);
                        q.add(node);
                    } else {
                        if (cycle.size() == 0) {
                            ArrayDeque<Integer> left = new ArrayDeque<>();
                            ArrayDeque<Integer> right = new ArrayDeque<>();
                            int a = node;
                            int b = adj;
                            boolean jumped = false;
                            if (level[b] > level[a]) {
                                jumped = true;
                                ASSERT(level[b] == level[a] + 1);
                                right.add(b);
                                b = parent[b];
                                // this occurs in even cycle length (one has to reach the diagonal first)
                            }
                            while (a != b) {
//                                System.out.println(a + " " + b);
                                left.addFirst(a);
                                right.add(b);
                                a = parent[a];
                                b = parent[b];
                            }
                            left.addFirst(a); // the root!
//                            System.out.println(left + " " + right);
                            left.addAll(right);
                            cycle = left;
                            ASSERT(jumped ^ cycle.size() % 2 == 1);
//                            System.out.println(cycle);
                        }
                    }
                }
            }
        }
    }

    static void dfsTree(int node, int par, int color) {
        groups[color].add(node);
        for (int adj : adjList[node]) {
            if (adj != par) {
                dfsTree(adj, node, 1 ^ color);
            }
        }
    }

    static class FastScanner {
        private int BS = 1 << 16;
        private char NC = (char) 0;
        private byte[] buf = new byte[BS];
        private int bId = 0, size = 0;
        private char c = NC;
        private double cnt = 1;
        private BufferedInputStream in;

        public FastScanner() {
            in = new BufferedInputStream(System.in, BS);
        }

        public FastScanner(String s) {
            try {
                in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
            } catch (Exception e) {
                in = new BufferedInputStream(System.in, BS);
            }
        }

        private char getChar() {
            while (bId == size) {
                try {
                    size = in.read(buf);
                } catch (Exception e) {
                    return NC;
                }
                if (size == -1) return NC;
                bId = 0;
            }
            return (char) buf[bId++];
        }

        public int nextInt() {
            return (int) nextLong();
        }

        public int[] nextInts(int N) {
            int[] res = new int[N];
            for (int i = 0; i < N; i++) {
                res[i] = (int) nextLong();
            }
            return res;
        }

        public long[] nextLongs(int N) {
            long[] res = new long[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextLong();
            }
            return res;
        }

        public long nextLong() {
            cnt = 1;
            boolean neg = false;
            if (c == NC) c = getChar();
            for (; (c < '0' || c > '9'); c = getChar()) {
                if (c == '-') neg = true;
            }
            long res = 0;
            for (; c >= '0' && c <= '9'; c = getChar()) {
                res = (res << 3) + (res << 1) + c - '0';
                cnt *= 10;
            }
            return neg ? -res : res;
        }

        public double nextDouble() {
            double cur = nextLong();
            return c != '.' ? cur : cur + nextLong() / cnt;
        }

        public double[] nextDoubles(int N) {
            double[] res = new double[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextDouble();
            }
            return res;
        }

        public String next() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c > 32) {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public String nextLine() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c != '\n') {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public boolean hasNext() {
            if (c > 32) return true;
            while (true) {
                c = getChar();
                if (c == NC) return false;
                else if (c > 32) return true;
            }
        }
    }

    static void ASSERT(boolean assertion, String message) {
        if (!assertion) throw new AssertionError(message);
    }

    static void ASSERT(boolean assertion) {
        if (!assertion) throw new AssertionError();
    }
}