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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;


public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solve(in, out);
        out.close();
    }

    static String reverse(String s) {
        return (new StringBuilder(s)).reverse().toString();
    }

    static void sieveOfEratosthenes(int n, int factors[]) 
    { 
        factors[1]=1;
        for(int p = 2; p*p <=n; p++) 
        { 
            if(factors[p] == 0) 
            { 
                factors[p]=p;
                for(int i = p*p; i <= n; i += p) 
                    factors[i] = p; 
            } 
        } 
    }

    static void sort(int ar[]) {
        int n = ar.length;
        ArrayList<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++)
            a.add(ar[i]);
        Collections.sort(a);
        for (int i = 0; i < n; i++)
            ar[i] = a.get(i);
    }

    static long ncr(long n, long r, long mod) {
        if (r == 0)
            return 1;
        long val = ncr(n - 1, r - 1, mod);
        val = (n * val) % mod;
        val = (val * modInverse(r, mod)) % mod;
        return val;
    }

    static int u,v;

    public static void solve(InputReader sc, PrintWriter pw) {
        int i, j = 0;
        int t = 1;  
        // int t = sc.nextInt();
        u: while (t-- > 0) {
            int n=sc.nextInt();
            int m=sc.nextInt();
            int k=sc.nextInt();
            ArrayList<Integer> ar[]=new ArrayList[n+1];
            u=v=0;
            for(i=1;i<=n;i++){
                ar[i]=new ArrayList<>();
            }
            for(i=0;i<m;i++){
                int a=sc.nextInt();
                int b=sc.nextInt();
                ar[a].add(b);
                ar[b].add(a);
            }
            int par[]=new int[n+1];
            par[1]=-1;
            ArrayList<Integer> step=new ArrayList<>();
            // int level[]=new int[n+1];
            step.add(1);
            step.add(-1);
            // level[1]=0;
            int y=1;
            int f=0;
            int len=0;
            // fill(step,1,ar,par,level);
            x:for(i=0;i<step.size();i++){
                int curr=step.get(i);
                if(curr==-1&&f==0){
                    f=1;
                    step.add(-1);
                    y++;
                }
                else if(curr==-1&&f==1){
                    break;
                }
                else{
                    f=0;
                    for(int d:ar[curr]){
                        // pw.println(curr+" "+d+" "+par[curr]+" "+par[d]);
                        if(d!=par[curr]&&par[d]!=0){
                            u=curr;
                            v=d;
                            break x;
                        }
                        else if(par[d]==0){
                            par[d]=curr;
                            step.add(d);
                            // pw.println(d);
                        }
                        
                    }
                }
            }
            // pw.println(u+" "+v);
            if(u>0&&v>0){
                // pw.println("## "+u+" "+v);
                HashSet<Integer> set=new HashSet<>();
                int x=u;
                while(x>-1){
                    set.add(x);
                    x=par[x];
                }
                x=v;
                while(!set.contains(x)){
                    x=par[x];
                }
                len=1;
                ArrayList<Integer> next=new ArrayList<>();
                while(u!=x){
                    next.add(u);
                    u=par[u];
                    len++;
                }
                next.add(x);
                int s=next.size();
                while(v!=x){
                    next.add(s,v);
                    v=par[v];
                    len++;
                }
                len=next.size();
                if(len<=k){
                    pw.println(2);
                    pw.println(len);
                    for(i=0;i<len;i++){
                        pw.print(next.get(i)+" ");
                    }
                    pw.println();
                }
                else{
                    pw.println(1);
                    for(i=0;i<k;i+=2){
                        pw.print(next.get(i)+" ");
                    }
                    pw.println();
                }
            }
            else{
                pw.println(1);
                ArrayList<Integer> l=new ArrayList<>();
                fill1(l,1,ar,-1);
                // pw.println(1);
                for(i=0;i<(k+1)/2;i++){
                    pw.print(l.get(i)+" ");
                }
                pw.println();
            }
        }
    }

    static int fill1(ArrayList<Integer> l, int curr, ArrayList<Integer> ar[],int par){
        int y=1;
        for(int j:ar[curr]){
            if(j!=par){
                y=(y&fill1(l,j,ar,curr));
            }
        }
        if(y==1){
            l.add(curr);
            y=0;
        }
        else 
            y=1;
        return y;
    }

    static void fill(ArrayList<Integer> step, int curr, ArrayList<Integer> ar[], int par[], int level[]){
        for(int y:ar[curr]){
            if(y!=par[curr]&&par[y]!=0){
                u=y;
                v=par[y];
            }
            else if(par[y]==0){
                level[y]=level[curr]+1;

            }
        }
    }

    static class Pair implements Comparable<Pair> {
        int a;
        int b;
        int c;
        
        Pair(int a, int b, int c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

        public int compareTo(Pair p) {
            if (c != p.c)
                return -1*(c - p.c);
            return (a - p.a);
        }
    }

    static boolean isPrime(long n) {
        if (n <= 1)
            return false;
        if (n <= 3)
            return true;
        if (n % 2 == 0 || n % 3 == 0)
            return false;
        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;
        return true;
    }

    static long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    static long fast_pow(long base, long n, long M) {
        if (n == 0)
            return 1;
        if (n == 1)
            return base % M;
        long halfn = fast_pow(base, n / 2, M);
        if (n % 2 == 0)
            return (halfn * halfn) % M;
        else
            return (((halfn * halfn) % M) * base) % M;
    }

    static long modInverse(long n, long M) {
        return fast_pow(n, M - 2, M);
    }

    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 int nextInt() {
            return Integer.parseInt(next());
        }

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