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 sun.reflect.generics.tree.Tree;

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

import static java.lang.Math.*;

public class D {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = in.nextInt(), m = in.nextInt(), k = in.nextInt();
        int degree[] = new int[n + 1];
        int from[] = new int[m], to[] = new int[m];
        for (int i = 0; i < m; i++) {
            int u = in.nextInt(), v = in.nextInt();
            from[i] = u;
            to[i] = v;
            degree[u]++;
            degree[v]++;
        }

        int[][] g = packU(n + 1, from, to);

        int res[] = solveIndependentSet(n, m, k, degree, g);
        if (res != null) {
            pw.println(1);
            for (int i : res) pw.print(i + " ");
            pw.println();
        } else {
            res = solveSimpleCycle(n, m, k, g);
            //debug(res);
            pw.println(2);
            pw.println(res.length);
            for (int i : res) pw.print(i + " ");
            pw.println();
        }

        pw.close();
    }

    static int[] solveIndependentSet(int n, int m, int k, int degree[], int[][] g) {
        k = (k / 2) + (k % 2);
        TreeSet<Pair> set = new TreeSet<>();
        for (int i = 1; i <= n; i++) {
            set.add(new Pair(degree[i], i));
        }
        int arr[] = new int[k];
        boolean done[] = new boolean[n + 1];
        while (k > 0 && !set.isEmpty()) {
            Pair p = set.pollFirst();
           // debug(p);
            arr[--k] = p.s;
            removeAdjacent(p.s, degree, g, set, done);
        }
        return k == 0 ? arr : null;
    }

    static void removeAdjacent(int node, int[] degree, int[][] g, TreeSet<Pair> set, boolean[] done) {
        set.remove(new Pair(degree[node], node));
        done[node] = true;
        for (int u : g[node]) {
            if (done[u]) continue;
            done[u] = true;
            set.remove(new Pair(degree[u], u));
            for (int v : g[u]) {
                if (done[v]) continue;
                set.remove(new Pair(degree[v], v));
                set.add(new Pair(--degree[v], v));
            }
        }
    }

    static int[] solveSimpleCycle(int n, int m, int k, int[][] g) {
        int arr[] = new int[n];
        for (int i = 1; i <= n; i++) {
            arr[i - 1] = i;
        }
        shuffle(arr);
        for (int i : arr) {
            K = k;
            vis = new int[n + 1];
            Arrays.fill(vis, -1);
            par = new int[n + 1];
            graph = g;
            found = -1;
            vis[i] = 0;
            dfs(SRC = i, 0);
            if (res != null) return res;
        }
        return null; // TODO
    }

    public static void shuffle(int[] a) {
        Random rnd = new Random();
        for (int i = a.length - 1; i >= 1; i--) {
            int j = rnd.nextInt(i + 1);
            int t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    static int[][] graph;
    static int vis[];
    static int par[];
    static int res[];
    static int K;
    static int found = -1;
    static int SRC;

    static void dfs(int node, int dist) {
        if (found != -1) return;
        if (dist >= K) return;
        //debug(node, graph[node]);
        for (int u : graph[node]) {
            if (dist > 1 && u == SRC && found == -1) {
                found = node;
                int v = node;
                res = new int[dist + 1];
                int idx = 0;
                while (v != 0) {
                   // debug("C", SRC, v, u);
                    res[idx++] = v;
                    v = par[v];
                }
                return;
            } else if (vis[u] == -1) {
                par[u] = node;
                vis[u] = dist;
                dfs(u, dist + 1);
            }
        }
    }

    static class Pair implements Comparable<Pair> {
        int f, s;

        Pair(int F, int S) {
            f = F;
            s = S;
        }

        public int compareTo(Pair p) {
            if (f == p.f) return s - p.s;
            return f - p.f;
        }

        public String toString() {
            return f + " " + s;
        }
    }


    static int[][] packU(int n, int[] from, int[] to) {
        int[][] g = new int[n][];
        int[] p = new int[n];
        for (int f : from)
            p[f]++;
        for (int t : to)
            p[t]++;
        for (int i = 0; i < n; i++)
            g[i] = new int[p[i]];
        for (int i = 0; i < from.length; i++) {
            g[from[i]][--p[from[i]]] = to[i];
            g[to[i]][--p[to[i]]] = from[i];
        }
        return g;
    }

    static void debug(Object... obj) {
        System.err.println(Arrays.deepToString(obj));
    }
}