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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Vector;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Stack;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter out = new PrintWriter(outputStream);
            DEhabsLastCorollary solver = new DEhabsLastCorollary();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class DEhabsLastCorollary {
        ArrayList<Integer>[] a;
        Stack<Integer> st = new Stack<>();
        boolean[] vis;
        boolean[] stack;
        int[] colorArr;
        PrintWriter w;
        boolean done;

        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int n = s.nextInt(), m = s.nextInt(), k = s.nextInt();
            a = new ArrayList[k];
            for (int i = 0; i < k; i++) a[i] = new ArrayList<>();
            this.w = w;
            while (m-- > 0) {
                int u = s.nextInt() - 1, v = s.nextInt() - 1;
                if (u >= k || v >= k) continue;
                a[u].add(v);
                a[v].add(u);
            }
            colorArr = new int[k];
            for (int i = 0; i < k; ++i)
                colorArr[i] = -1;
            for (int i = 0; i < k; i++) {
                if (colorArr[i] != -1) continue;
                if (!isBipartite(i)) {
                    vis = new boolean[k];
                    stack = new boolean[k];
                    w.println(2);
                    dfs(i, -1);
                    return;
                }
            }
            int[] f = new int[2];
            for (int i = 0; i < k; i++) f[colorArr[i]]++;
            w.println(1);
            int cnt = k + 1 >> 1;
            if (f[0] > f[1]) {
                for (int i = 0; i < k && cnt > 0; i++)
                    if (colorArr[i] == 0) {
                        cnt--;
                        w.print(i + 1 + " ");
                    }

            } else {
                for (int i = 0; i < k && cnt > 0; i++)
                    if (colorArr[i] == 1) {
                        cnt--;
                        w.print(i + 1 + " ");
                    }
            }
            w.println();
        }

        void dfs(int cur, int par) {
            stack[cur] = true;
            vis[cur] = true;
            st.add(cur);
            if (done) return;
            for (int i : a[cur]) {
                if (done) return;
                if (stack[i] && i != par) {
                    ArrayList<Integer> ans = new ArrayList<>();
                    ans.add(i + 1);
                    while (st.peek() != i) ans.add(st.pop() + 1);
                    w.println(ans.size());
                    for (int j : ans) w.print(j + " ");
                    done = true;
                    return;
                }
                if (!vis[i]) dfs(i, cur);
            }
            st.pop();
            stack[cur] = false;
        }

        boolean isBipartite(int src) {


            // Assign first color to source
            colorArr[src] = 0;

            // Create a queue (FIFO) of vertex numbers
            // and enqueue source vertex for BFS traversal
            LinkedList<Integer> q = new LinkedList<>();
            q.add(src);

            // Run while there are vertices in queue (Similar to BFS)
            while (q.size() != 0) {
                int cur = q.poll();
                for (int i : a[cur]) {
                    if (colorArr[i] == colorArr[cur]) return false;
                    if (colorArr[i] == -1) {
                        q.add(i);
                        colorArr[i] = colorArr[cur] ^ 1;
                    }
                }
            }
            // If we reach here, then all adjacent vertices can
            // be colored with alternate color
            return true;
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public 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 nextInt() {

            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 c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

