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>
/**
 * @author derrick20
 */

import java.io.*;
import java.util.*;

public class LastCorollaryTightenLoop implements Runnable {
    public static void main(String[] args) throws Exception {
        new Thread(null, new LastCorollaryTightenLoop(), ": )", 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);
        }
        groups = new ArrayDeque[2];
        Arrays.setAll(groups, i -> new ArrayDeque<>());
        cycle = new ArrayDeque<>();
        parent = new int[N];
        depth = new int[N];
        vis = new int[N];
        dfs(0, -1, 0, 0);
//        System.out.println(Arrays.toString(parent));
//        System.out.println(Arrays.toString(depth));
        int need = (k + 1) / 2;
        if (cycle.isEmpty()) {
            // then it's a tree!
            int which = groups[0].size() > groups[1].size() ? 0 : 1;
            StringBuilder ans = new StringBuilder();
            while (need > 0) {
                ans.append(groups[which].pollFirst() + 1).append(" ");
                need--;
            }
            out.println(1);
            out.println(ans);
        } else {
            if (cycle.size() <= k) {
                StringBuilder ans = new StringBuilder();
                for (int i : cycle) {
                    ans.append(i + 1).append(" ");
                }
                out.println(2);
                out.println(cycle.size());
                out.println(ans);
            } else {
                // since it's a minimal cycle, we can alternate validly.
                StringBuilder ans = new StringBuilder();
                while (need > 0) {
                    ans.append(cycle.pollFirst() + 1).append(" ");
                    cycle.pollFirst();
                    need--;
                }
                out.println(1);
                out.println(ans);
            }
        }
        out.close();
    }

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

    static void dfs(int node, int par, int color, int d) {
        parent[node] = par;
        groups[color].add(node);
        if (par != -1) depth[node] = depth[par] + 1;
        int tightest = -1;
        for (int adj : adjList[node]) {
            if (adj != par) {
                if (vis[adj] == 0) {
                    vis[adj] = 1;
                    dfs(adj, node, 1 ^ color, d + 1);
                    vis[adj] = 2;
                } else if (vis[adj] == 1 && depth[adj] <= depth[node] - 2) {
                    if (tightest == -1 || depth[adj] > depth[tightest]) {
                        tightest = adj;
                    }
                }
            }
        }
        if (cycle.isEmpty() && tightest != -1) {
            // why can we just walk upwards through ancestors?
            // A cycle created during the dfs would be fully walked
            // through in one go during the process, since we continue
            // explore our children until our "subtree" has no more.
            // so, either a given node is fully used up and will never
            // be touched again, or it continues exploring (this is
            // the only way for it to belong to a cycle, to hit a back
            // edge as it dives deeper in the dfs)
            int curr = node;
            while (curr != tightest) {
                cycle.add(curr);
                curr = parent[curr];
            }
            cycle.add(curr); // last bit
        }
    }

    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();
    }
}