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.*;

/**
 * Created by Katushka on 11.03.2020.
 */
public class EhabLastCorollary {
    static int[] readArray(int size, InputReader in) {
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextInt();
        }
        return a;
    }

    static long[] readLongArray(int size, InputReader in) {
        long[] a = new long[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextLong();
        }
        return a;
    }

    static class Vertex {
        int num;
        Set<Vertex> children = new HashSet<>();
        boolean marked = false;

        public Vertex(int num) {
            this.num = num;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Vertex vertex = (Vertex) o;

            return num == vertex.num;
        }

        @Override
        public int hashCode() {
            return num;
        }
    }

    public static void main(String[] args) throws FileNotFoundException {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        int k = in.nextInt();

        List<Vertex> graph = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            graph.add(new Vertex(i + 1));
        }

        for (int i = 0; i < m; i++) {
            int u = in.nextInt();
            int v = in.nextInt();

            graph.get(u - 1).children.add(graph.get(v - 1));
            graph.get(v - 1).children.add(graph.get(u - 1));
        }

//        boolean[] visited = new boolean[n + 1];
//        VertexWithNum currentResult = new VertexWithNum(null, Integer.MAX_VALUE);
//        Vertex vertex = graph.get(0);
//        int[] pathIndices = new int[n + 1];
//        pathIndices[vertex.num] = 1;
//        ArrayList<Vertex> path = new ArrayList<>();
//        path.add(vertex);
        List<Integer> minCycle = getMinCycle(graph, k, out);

        if (minCycle != null) {
//            int[] pIndices = new int[n + 1];
//            pIndices[currentResult.vertex.num] = 1;
//            ArrayList<Vertex> p = new ArrayList<>();
//            p.add(currentResult.vertex);
//
//            List<Vertex> minCycle = getMinCycle(currentResult.vertex, pIndices, p, currentResult.num, 0);
            if (minCycle.size() <= k) {
                out.println(2);
                out.println(minCycle.size());
                
                StringBuilder ans = new StringBuilder();
                for (Integer v : minCycle) {
                    ans.append(v).append(" ");
                }
                out.println(ans.toString());
            } else {
                out.println(1);
                StringBuilder ans = new StringBuilder();
                int t = 0;
                for (int i = 0; i < minCycle.size() && t < (k + 1) / 2; i++) {
                    Integer v = minCycle.get(i);
                    if (i % 2 == 0) {
                        ans.append(v).append(" ");
                        t++;
                    }
                }


                out.println(ans.toString());
            }
        } else {
            out.println(1);
            StringBuilder ans = new StringBuilder();
            int t = 0;
            for (int i = 0; i < graph.size() && t < (k + 1) / 2; i++) {
                Vertex v = graph.get(i);
                if (v.marked) {
                    ans.append(v.num).append(" ");
                    t++;
                }
            }
            if (t < (k + 1) / 2) {
                ans = new StringBuilder();
                t = 0;
                for (int i = 0; i < graph.size() && t < (k + 1) / 2; i++) {
                    Vertex v = graph.get(i);
                    if (!v.marked) {
                        ans.append(v.num).append(" ");
                        t++;
                    }
                }
            }

            out.println(ans.toString());
        }


        out.close();
    }

    private static List<Integer> getMinCycle(List<Vertex> graph, int k, PrintWriter out) {
        Queue<Vertex> q = new ArrayDeque<>();
        q.add(graph.get(0));
        boolean[] visited = new boolean[graph.size() + 1];
        int[] p = new int[graph.size() + 1];
        visited[1] = true;
        graph.get(0).marked = true;
        p[1] = -1;
        while (!q.isEmpty()) {
            Vertex vertex = q.poll();
            for (Vertex to : vertex.children) {
                if (!visited[to.num]) {
                    visited[to.num] = true;
                    q.add(to);
                    p[to.num] = vertex.num;
                    if (!vertex.marked) {
                        to.marked = true;
                    }
                } else if (to.num != p[vertex.num]) {
                    List<Integer> path1 = new ArrayList<>();
                    for (int v = to.num; v != -1; v = p[v]) {
                        path1.add(v);
                    }
                    
                    List<Integer> path2 = new ArrayList<>();
                    Set<Integer> path1Set = new HashSet<>(path1);
                    int common = -1;
                    for (int v = vertex.num; v != -1; v = p[v]) {
                        if (path1Set.contains(v)) {
                            common = v;
                            
                            break;
                        }
                        path2.add(v);
                    }
                    List<Integer> path = new ArrayList<>();
                    for (Integer u : path1) {
                        path.add(u);
                        
                        if (u.intValue() == common) {
                            break;
                        }
                    }
                    for (int j = path2.size() - 1; j >= 0; j--) {
                        path.add(path2.get(j));
                    }
                    return path;
                }
            }
        }
        return null;
    }

    private static List<Vertex> getMinCycle(Vertex vertex, int[] pathIndices,
                                            ArrayList<Vertex> path, int minCycleLength, int step) {

        if (step >= minCycleLength) {
            return null;
        }

        for (Vertex child : vertex.children) {
            if (pathIndices[child.num] > 0) {
                int cycleLength = step + 1 - pathIndices[child.num] + 1;
                if (cycleLength == 2) {
                    continue;
                }
                if (cycleLength == minCycleLength) {
                    List<Vertex> minCycle = new ArrayList<>();
                    for (int i = pathIndices[child.num] - 1; i < step + 1; i++) {
                        minCycle.add(path.get(i));
                    }

                    return minCycle;
                }


            } else {
                path.add(child);
                pathIndices[child.num] = step + 2;

                List<Vertex> minCycle = getMinCycle(child, pathIndices, path, minCycleLength, step + 1);
                if (minCycle != null) {
                    return minCycle;
                }

                path.remove(path.size() - 1);
                pathIndices[child.num] = 0;
            }
        }

        return null;
    }


    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }
    }
}