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 Solution implements Runnable{
    FastScanner sc;
    PrintWriter pw;
    final class FastScanner {
        BufferedReader br;
        StringTokenizer st;
 
        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
 
        public long nlo() {
            return Long.parseLong(next());
        }
 
        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }
 
        public int ni() {
            return Integer.parseInt(next());
        }
 
        public String nli() {
            String line = "";
            if (st.hasMoreTokens()) line = st.nextToken();
            else try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            while (st.hasMoreTokens()) line += " " + st.nextToken();
            return line;
        }
 
        public double nd() {
            return Double.parseDouble(next());
        }
    }
    public static void main(String[] args) throws Exception
    {
        new Thread(null,new Solution(),"codeforces",1<<28).start();
    }
    public void run()
    {
        sc=new FastScanner();
        pw=new PrintWriter(System.out);
        solve();
        pw.flush();
        pw.close();
    }
    public long gcd(long a,long b)
    {
        return b==0L?a:gcd(b,a%b);
    }
    public long ppow(long a,long b,long mod)
    {
        if(b==0L)
        return 1L;
        long tmp=1;
        while(b>1L)
        {
            if((b&1L)==1)
            tmp*=a;
            a*=a;
            a%=mod;
            tmp%=mod;
            b>>=1;
        }
        return (tmp*a)%mod;
    }
    public  int gcd(int x,int y)
    {
        return y==0?x:gcd(y,x%y);
    }
    //////////////////////////////////
    /////////////  LOGIC  ///////////
    ////////////////////////////////
    public int[] visit,prr,col;
    public ArrayList<Integer>[] ccol;
    public HashSet<Integer>[] adj;
    public int a,b,c;
    public void solve() 
    {
        int n=sc.ni();
        int m=sc.ni();
        int k=sc.ni();
        a=-1;b=-1;c=-1;
        adj=new HashSet[n+1];
        for(int i=1;i<=n;i++)
        adj[i]=new HashSet();
        ccol=new ArrayList[2];
        ccol[0]=new ArrayList();
        ccol[1]=new ArrayList();
        visit=new int[n+1];
        col=new int[n+1];
        prr=new int[n+1];
        for(int i=0;i<m;i++)
        {
            int x=sc.ni();
            int y=sc.ni();
            adj[x].add(y);
            adj[y].add(x);
        }
        prr[1]=1;
        dfs(1,1,0);
        if(a==-1)
        {
            ArrayList<Integer> list=null;
            if(ccol[0].size()>=ccol[1].size())
            list=ccol[0];
            else
            list=ccol[1];
            pw.println(1);
            k=k/2+k%2;
            for(int i=0;i<k;i++)
            pw.print(list.get(i)+" ");
        }
        else
        {
            c=a;
            ArrayList<Integer> list=new ArrayList();
            adj[a].remove(b);
            adj[b].remove(a);
            Arrays.fill(prr,-1);
            Arrays.fill(visit,0);
            dfs1(a,a,b);
            int x=b;
            while(prr[x]!=x)
            {
                list.add(x);
                x=prr[x];
            }
            list.add(a);
            if(list.size()<=k)
            {
                pw.println("2");
                pw.println(list.size());
                for(int pp:list)
                pw.print(pp+" ");
            }
            else
            {
                k=k/2+k%2;
                pw.println("1");
                for(int i=0;i<list.size();i++)
                {
                    if(i%2==0)
                    {
                        pw.print(list.get(i)+" ");
                        k--;
                        if(k==0)
                        break;
                    }
                }
            }
        }
    }
    public void dfs(int x,int p,int c)
    {
        visit[x]=1;
        col[x]=c;
        ccol[c].add(x);
        prr[x]=p;
        for(int y:adj[x])
        {
            if(y==prr[x])
            continue;
            if(visit[y]==1)
            {
                if(col[y]==c)
                    {a=x;b=y;}
            }
            else
            dfs(y,x,c^1);
        }
    }
   public void dfs1(int x,int p,int dd)
    {
        visit[x]=1;
        prr[x]=p;
        Queue<Integer> qu=new ArrayDeque();
        qu.add(x);
        while(qu.size()>0&&visit[dd]==0)
        {
            x=qu.poll();
            for(int y:adj[x])
            {
                if(visit[y]==0)
                {
                    prr[y]=x;
                    visit[y]=1;
                    qu.add(y);
                }
            }
        }
    }
}