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.util.*;
import java.io.*;
import static java.lang.Math.*;

public class D
{
    /*
     * This FastReader code is taken from GeeksForGeeks.com
     * https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
     *
     * The article was written by Rishabh Mahrsee
     */
    public static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static class Graph
    {
        public static class Vertex
        {
            List<Integer> neighbors;
            public Vertex()
            {
                neighbors = new ArrayList<>();
            }
        }
        Vertex[] graph;
        public Graph(int n)
        {
            graph = new Vertex[n];
            for (int i = 0; i < n; i++)
            {
                graph[i] = new Vertex();
            }
        }
        public Set<Integer> visited;
        public Queue<Integer> q;
        public List<Integer> cycle = null;
        public List<Integer> uncuttableCycle()
        {
            visited = new HashSet<>();
            q = new LinkedList<>();
            dfs(0, -1);

            return cycle;
        }

        private boolean dfs(int cur, int prev)
        {
            visited.add(cur);
            for (int neighbor : graph[cur].neighbors)
            {
                if (neighbor != prev && visited.contains(neighbor))
                {
                    // We have a cycle
                    int a = neighbor;
                    int b = cur;
                    graph[a].neighbors.remove(new Integer(b));
                    graph[b].neighbors.remove(new Integer(a));
                    cycle = new ArrayList<>();
                    bfs(a, b);
                    return true;
                }
                else if (neighbor != prev && !visited.contains(neighbor))
                {
                    if (dfs(neighbor, cur))
                        return true;
                }
            }
            return false;
        }

        private void bfs(int a, int b)
        {
            int[] prev = new int[graph.length];
            Arrays.fill(prev, -1);
            visited = new HashSet<>();
            q.add(a);

            while (!q.isEmpty())
            {
                int polled = q.poll();

                if (visited.contains(polled))
                    continue;

                if (polled == b)
                {
                    // Found path
                    int cur = b;
                    while (cur != -1)
                    {
                        cycle.add(cur);
                        cur = prev[cur];
                    }
                    return;
                }

                visited.add(polled);

                for (int neighbor : graph[polled].neighbors)
                {
                    if (!visited.contains(neighbor))
                    {
                        q.add(neighbor);
                        if (prev[neighbor] == -1)
                            prev[neighbor] = polled;
                    }
                }
            }
        }

        public List<Integer> treeColor()
        {
            int[] color = new int[graph.length]; // 0 black, 1 white
            visited = new HashSet<>();
            dfsColor(0, 1, color);

            // Figure out which color occurs more
            int blackCount = 0;
            int whiteCount = 0;
            for (int i : color)
            {
                if (i == 0)
                    blackCount++;
                else
                    whiteCount++;
            }
            int winningColor = blackCount >= whiteCount ? 0 : 1;
            List<Integer> returnList = new ArrayList<>();
            for (int i = 0; i < color.length; i++)
            {
                if (color[i] == winningColor)
                {
                    returnList.add(i);
                }
            }

            return returnList;
        }

        private void dfsColor(int cur, int prevColor, int[] color)
        {
            visited.add(cur);
            color[cur] = prevColor == 0 ? 1 : 0;
            for (int neighbor : graph[cur].neighbors)
            {
                if (!visited.contains(neighbor))
                {
                    dfsColor(neighbor, color[cur], color);
                }
            }
        }
    }

    public static FastReader in = new FastReader();
    public static PrintWriter out = new PrintWriter(System.out);
    public static final int MOD = (int)1e9 + 7;

    public static void main(String[] args)
    {
        solve();

        out.close();
    }

    private static void solve()
    {
        int n = in.nextInt(), m = in.nextInt(), k = in.nextInt();
        Graph graph = new Graph(n);

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

            graph.graph[u].neighbors.add(v);
            graph.graph[v].neighbors.add(u);
        }

        List<Integer> cycle = graph.uncuttableCycle();
        if (cycle == null)
        {
            cycle = graph.treeColor();
            out.println(1);
            for (int i = 0; i < ceil(k / 2.); i++)
            {
                out.print(cycle.get(i) + 1 + " ");
            }
        }

        else if (cycle.size() <= k)
        {
            out.println(2);
            out.println(cycle.size());
            for (int i : cycle) out.print((i + 1) + " ");
            out.println();
            return;
        }
        else
        {
            out.println(1);
            for (int i = 0; i < ceil(k / 2.); i++)
            {
                out.print((cycle.get(i * 2) + 1) + " ");
            }
            out.println();
        }
    }

}
