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

public class Main {
    public static void main(String args[]) {new Main().run();}

    FastReader in = new FastReader();
    PrintWriter out = new PrintWriter(System.out);
    void run(){
        work();
        out.flush();
    }
    long mod=998244353;
    long gcd(long a,long b) {
        return a==0?b:gcd(b%a,a);
    }
    ArrayList<Integer>[] graph;
    int node1=-1,node2=-1;
    int[] color;
    boolean[] vis;
    void work() {
        int n=ni(),m=ni(),k=ni();
        graph=ng(n,m);
        color=new int[n];
        vis=new boolean[n];
        for(int i=0;i<n;i++){
            if(!vis[i]&&node1==-1){
                dfs(i,-1);
            }
        }
        if(node1==-1){
            for(int i=0;i<n;i++){
                if(color[i]==0){
                    dfs1(i,1,-1);
                }
            }
            ArrayList<Integer> ret=new ArrayList<>();
            ArrayList<Integer> ret2=new ArrayList<>();
            for(int i=0;i<n;i++){
                if(color[i]==1){
                    ret.add(i);
                }else{
                    ret2.add(i);
                }
            }
            out.println(1);
            ArrayList<Integer> list=ret;
            if(ret2.size()>ret.size()){
                list=ret2;
            }
            for(int i=0;i<(k+1)/2;i++){
                out.print((list.get(i)+1)+" ");
            }
        }else{
            LinkedList<Integer> queue=new LinkedList<>();
            ArrayList<Integer> ret=new ArrayList<>();
            queue.add(node1);
            vis=new boolean[n];
            vis[node1]=true;
            int[] route=new int[n];
            Arrays.fill(route,-1);
            while(queue.size()>0){
                int node=queue.poll();
                for(int nn:graph[node]){
                   if(!vis[nn]){
                       if((nn==node1&&node==node2)||(nn==node2&&node==node1))continue;
                       route[nn]=node;
                       queue.add(nn);
                       vis[nn]=true;
                   }
                }
            }
            int node=node2;
            while(node!=-1){
                ret.add(node);
                node=route[node];
            }
            if(ret.size()<=k){
                out.println(2);
                out.println(ret.size());
                for(int r:ret){
                    out.print((r+1)+" ");
                }
            }else{
                out.println(1);
                for(int i=0;i<k;i+=2){
                    out.print((ret.get(i)+1)+" ");
                }
            }
        }
    }

    private void dfs1(int node, int cur, int pre) {
        color[node]=cur;
        for(int nn:graph[node]){
            if(nn!=pre){
                dfs1(nn,cur==1?2:1,node);
            }
        }
    }

    private void dfs(int node,int pre) {
        if(vis[node]){
            node1=node;
            node2=pre;
            return;
        }
        vis[node]=true;
        for(int nn:graph[node]){
            if(nn!=pre){
                dfs(nn,node);
                if(node1!=-1)return;
            }
        }
    }


    private ArrayList<long[]>[] ngw(int n, int m) {
        ArrayList<long[]>[] graph=(ArrayList<long[]>[])new ArrayList[n];
        for(int i=0;i<n;i++) {
            graph[i]=new ArrayList<>();
        }
        for(int i=1;i<=m;i++) {
            long s=in.nextLong()-1,e=in.nextLong()-1,w=in.nextLong();
            graph[(int)s].add(new long[] {e,w});
            graph[(int)e].add(new long[] {s,w});
        }
        return graph;
    }

    private ArrayList<Integer>[] ng(int n, int m) {
        ArrayList<Integer>[] graph=(ArrayList<Integer>[])new ArrayList[n];
        for(int i=0;i<n;i++) {
            graph[i]=new ArrayList<>();
        }
        for(int i=1;i<=m;i++) {
            int s=in.nextInt()-1,e=in.nextInt()-1;
            graph[s].add(e);
            graph[e].add(s);
        }
        return graph;
    }

    private int ni() {
        return in.nextInt();
    }

    private long nl() {
        return in.nextLong();
    }

    private String ns() {
        return in.next();
    }

    private long[] na(int n) {
        long[] A=new long[n];
        for(int i=0;i<n;i++) {
            A[i]=in.nextLong();
        }
        return A;
    }
    private int[] nia(int n) {
        int[] A=new int[n];
        for(int i=0;i<n;i++) {
            A[i]=in.nextInt();
        }
        return A;
    }
}

class FastReader
{
    BufferedReader br;
    StringTokenizer st;

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


    public String next()
    {
        while(st==null || !st.hasMoreElements())//回车，空行情况
        {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

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

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