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 {
    static class Scan {
        private byte[] buf=new byte[1024];
        private int index;
        private InputStream in;
        private int total;
        public Scan()
        {
            in=System.in;
        }
        public int scan()throws IOException
        {
            if(total<0)
            throw new InputMismatchException();
            if(index>=total)
            {
                index=0;
                total=in.read(buf);
                if(total<=0)
                return -1;
            }
            return buf[index++];
        }
        public int scanInt()throws IOException
        {
            int integer=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    integer*=10;
                    integer+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            return neg*integer;
        }
        public double scanDouble()throws IOException
        {
            double doub=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n)&&n!='.')
            {
                if(n>='0'&&n<='9')
                {
                    doub*=10;
                    doub+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            if(n=='.')
            {
                n=scan();
                double temp=1;
                while(!isWhiteSpace(n))
                {
                    if(n>='0'&&n<='9')
                    {
                        temp/=10;
                        doub+=(n-'0')*temp;
                        n=scan();
                    }
                    else throw new InputMismatchException();
                }
            }
            return doub*neg;
        }
        public String scanString()throws IOException
        {
            StringBuilder sb=new StringBuilder();
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            while(!isWhiteSpace(n))
            {
                sb.append((char)n);
                n=scan();
            }
            return sb.toString();
        }
        private boolean isWhiteSpace(int n)
        {
            if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
            return true;
            return false;
        }
    }
    
    public static void sort(int arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(int arr[],int l1,int r1,int l2,int r2) {
        int tmp[]=new int[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }
    
    public static void sort(long arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(long arr[],int l1,int r1,int l2,int r2) {
        long tmp[]=new long[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }
    static int n,m,k,strt,end;
    static ArrayList<Integer> adj_lst[],path;
    static boolean vis[];
    static int depth[];
    public static void main(String args[]) throws IOException {
        Scan input=new Scan();
        n=input.scanInt();
        m=input.scanInt();
        k=input.scanInt();
        depth=new int[n];
        adj_lst=new ArrayList[n];
        vis=new boolean[n];
        for(int i=0;i<n;i++) {
            adj_lst[i]=new ArrayList<>();
        }
        for(int i=0;i<m;i++) {
            int u=input.scanInt()-1;
            int v=input.scanInt()-1;
            adj_lst[u].add(v);
            adj_lst[v].add(u);
        }
        strt=end=-1;
        DFS(0,-1,0);
        if(m==n-1) {
            System.out.println(1);
            int lim=k/2+k%2;
            int cnt=0;
            StringBuilder ans=new StringBuilder("");
            for(int i=0;i<n;i++) {
                if(depth[i]%2==0) {
                    ans.append((i+1)+" ");
                    cnt++;
                }
                if(cnt==lim) {
                    break;
                }
            }
            if(cnt>=lim) {
                System.out.println(ans);
                return;
            }
            cnt=0;
            ans=new StringBuilder("");
            for(int i=0;i<n;i++) {
                if(depth[i]%2==1) {
                    ans.append((i+1)+" ");
                    cnt++;
                }
                if(cnt==lim) {
                    break;
                }
            }
            System.out.println(ans);
            return;
        }
        path=null;
        vis=new boolean[n];
        find_path(strt,end,new ArrayList<>());
        while(true) {
            Set<Integer> hashset=new HashSet<>();
            for(int i=0;i<path.size();i++) {
                hashset.add(path.get(i));
            }
            for(int i=0;i<path.size();i++) {
                ArrayList<Integer> tmp=new ArrayList<>();
                for(int j=0;j<adj_lst[path.get(i)].size();j++) {
                    if(hashset.contains(adj_lst[path.get(i)].get(j))) {
                        tmp.add(adj_lst[path.get(i)].get(j));
                    }
                }
                adj_lst[path.get(i)]=tmp;
            }
            boolean done=true;
            for(int i=0;i<path.size();i++) {
                if(adj_lst[path.get(i)].size()>2) {
                    done=false;
                    strt=path.get(i);
                    int prev=i-1;
                    if(prev<0) {
                        prev+=path.size();
                    }
                    int nxt=(i+1)%path.size();
                    for(int j=0;j<adj_lst[path.get(i)].size();j++) {
                        if((int)adj_lst[path.get(i)].get(j)==(int)path.get(prev) || (int)adj_lst[path.get(i)].get(j)==(int)path.get(nxt)) {
                            continue;
                        }
                        end=adj_lst[path.get(i)].get(j);
                        break;
                    }
                    break;
                }
            }
            if(done) {
                break;
            }
            ArrayList<Integer> tmp1=new ArrayList<>();
            ArrayList<Integer> tmp2=new ArrayList<>();
            int indx=path.indexOf(new Integer(strt));
            while(path.get(indx)!=end) {
                tmp1.add(path.get(indx));
                indx++;
                indx%=path.size();
            }
            indx=path.indexOf(new Integer(strt));
            while(path.get(indx)!=end) {
                tmp2.add(path.get(indx));
                indx--;
                if(indx<0) {
                    indx+=path.size();
                }
            }
            if(tmp1.size()<tmp2.size()) {
                path=tmp1;
            }
            else {
                path=tmp2;
            }
            path.add(end);
        }
        StringBuilder ans=new StringBuilder("");
        if(path.size()<=k) {
            ans.append(2+"\n"+path.size()+"\n");
            for(int i=0;i<path.size();i++) {
                ans.append((path.get(i)+1)+" ");
            }
            ans.append("\n");
        }
        else {
            ans.append(1+"\n");
            int lim=k/2+k%2;
            for(int i=0,j=0;i<lim;i++,j+=2) {
                ans.append((path.get(j)+1)+" ");
            }
            ans.append("\n");
        }
        System.out.println(ans);
    }
    public static void DFS(int root,int par,int dep) {
        depth[root]=dep;
        if(strt!=-1) {
            return;
        }
        vis[root]=true;
        for(int i=0;i<adj_lst[root].size();i++) {
            if(adj_lst[root].get(i)==par) {
                continue;
            }
            if(vis[adj_lst[root].get(i)]) {
                strt=root;
                end=adj_lst[root].get(i);
                return;
            }
            DFS(adj_lst[root].get(i),root,dep+1);
        }
    }
    public static void find_path(int root,int prev,ArrayList<Integer> tmp) {
        if(path!=null) {
            return;
        }
        tmp.add(root);
        if(root==end) {
            path=new ArrayList<>(tmp);
            return;
        }
        vis[root]=true;
        for(int i=0;i<adj_lst[root].size();i++) {
            if(vis[adj_lst[root].get(i)] || adj_lst[root].get(i)==prev) {
                continue;
            }
            find_path(adj_lst[root].get(i),root,tmp);
        }
        tmp.remove(tmp.size()-1);
    }
}