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.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Reader in = new Reader();
    public static void main(String[] args) throws IOException {
        Main solver = new Main();
        solver.solve();
        out.flush();
        out.close();
 
    }
 
    static int INF = (int)1e9;
    static int maxn = (int)2e4+5;
    static int mod  = 1000*1000*1000+7;
    static int n,m,q,k,t;
    
    static ArrayList<Integer> adj[];
    
    void solve() throws IOException{
        n = in.nextInt();
        m = in.nextInt();
        k = in.nextInt();
        
        adj = new ArrayList[n+1];
        for (int i = 1; i <= n; i++) adj[i] = new ArrayList<Integer>();
        
        int u,v;
        for (int i = 0; i < m; i++) {
            u = in.nextInt();
            v = in.nextInt();
            adj[u].add(v);
            adj[v].add(u);
        }
        
        vis = new boolean[n+1];
        par = new int[n+1];
        depth = new int[n+1];
        
        ArrayList<Integer> list = new ArrayList<>();
        vis[1] = true;
        cnt = 1;
        
        DFS(1);
        for (int i = 1; i <= n; i++) {
            if (vis[i]) {
                list.add(i);
            }
        }
        
        int start = 0, end = 0;
        int tmp = 0;
        boolean flag = false;
        
        for (int i = 1; i < cnt; i++) {
            tmp = list.get(i);
            for (int e: adj[tmp]) {
                if (e == par[tmp] || par[e] == tmp || !vis[e]) continue;
                else {
                    flag = true;
                    start = tmp;
                    end = e;
                    break;
                }
            }
            if (flag) break;
        }
        
        if (!flag) {
            int cnt1 = 0;
            for (int i = 0; i < cnt; i++) {
                cnt1 += depth[list.get(i)]%2;
            }
            
            int cnt2 = cnt - cnt1;
            
            out.println(1);
            if (cnt1 >= (k+1)/2) {
                for (int i = 0, z = 0; i < cnt && z < (k+1)/2; i++) {
                    if (depth[list.get(i)]%2 == 1) {
                        out.print(list.get(i)+" ");
                        z++;
                    }
                }
            } else {
                for (int i = 0, z = 0; i < cnt && z < (k+1)/2; i++) {
                    if (depth[list.get(i)]%2 == 0) {
                        out.print(list.get(i)+" ");
                        z++;
                    }
                }
            }
            out.println();
        } else {
            ArrayList<Integer> arr1 = new ArrayList<Integer>();
            ArrayList<Integer> arr2 = new ArrayList<Integer>();
            
            arr1.add(start);
            arr2.add(end);
            while (start != 1) {
                start = par[start];
                arr1.add(start);
            }
            while (end != 1) {
                end = par[end];
                arr2.add(end);
            }
            
            ArrayList<Integer> arr3 = new ArrayList<Integer>();
            boolean[] here = new boolean[n+1];
            for (int e: arr1)   here[e] = true;
            
            int idx = 0, len = 0;
            for (int i = 0; i < arr2.size(); i++) {
                if (here[arr2.get(i)] == true) {
                    idx = i;
                    len = i+1;
                    break;
                }
            }
            ArrayList<Integer> ans = new ArrayList<>();
            for (int i = len-1; i >= 0; i--) ans.add(arr2.get(i));
            
            int e = arr2.get(idx);
            for (int i = 0; i < arr1.size(); i++) {
                if (arr1.get(i) == e) {
                    break;
                }
                len++;
                ans.add(arr1.get(i));
            }
            out.println(2);
            out.println(len);
            for (int i = 0; i < len; i++)   out.print(ans.get(i)+" ");
            out.println();
        }
    }
    
    //<>
    
    static boolean[] vis;
    static int[] depth;
    static int[] par;
    static int cnt = 1;
    
    static void DFS(int s) {
        for (int e: adj[s]) {
            if (cnt == k) return;
            if (vis[e]) continue;
            
            depth[e] = depth[s]+1;
            par[e] = s;
            vis[e] = true;
            cnt++;
            DFS(e);
        }
    }
    
    static class Reader {
 
    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
 
    public Reader() {
        this(System.in);
    }
 
    public Reader(InputStream is) {
        mIs = is;
    }
 
    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();
 
    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }
 
    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }
 
    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }
 
    double nextDouble()
    {
        return Double.parseDouble(next());
    }
 
    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long 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 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) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }
 
    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }
 
    }
}