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>
import java.io.*;
import java.util.*;
import java.math.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;
 

@SuppressWarnings("unchecked")
public class Main {
      
    int mod = 1000000007;

    public class SegmentTree{

       int n;
       int[] tree;

       SegmentTree(int[] arr){

          this.n = arr.length; 
          this.tree = new int[2 * n];

          for(int i = n; i < 2 * n; i++){
              this.tree[i] = arr[i - n];
          }

          for(int i = n - 1; i >= 1; i--){
              this.tree[i] = Math.min(this.tree[2 * i], this.tree[2 * i + 1]);
          }

       }

       public boolean isIn(int a){

          a += n;
          return tree[a] >= 1000000;

       }

       public int query(int l, int r){

          int res = Integer.MAX_VALUE;
          l = l + n;
          r = r + n;

          while(l < r){

              if(l % 2 == 1){
                  res = Math.min(res, tree[l]); 
                  l++;
              }

              if(r % 2 == 1){
                  r--;
                  res = Math.min(res, tree[r]);
              }

              l /= 2;
              r /= 2;
          }

          return res;
       }

       public void update(int idx, int v){
          
          idx += n; this.tree[idx] += v;
          while(idx > 1){
             idx /= 2;
             this.tree[idx] = Math.min(this.tree[2 * idx], this.tree[2 * idx + 1]);
          }
       }


    }


    int n, m, k;
    List<Integer>[] graph;
    int[] color, parent, depth;
    List<Integer> cycle = new ArrayList<>();
    List<Integer> c1 = new ArrayList<>();
    List<Integer> c2 = new ArrayList<>();

    public void solve() throws IOException{

       n = in.nextInt(); m = in.nextInt(); k = in.nextInt();
       graph = new List[n + 1];
       color = new int[n + 1];
       Arrays.fill(color, -1);
       parent = new int[n + 1];
       depth = new int[n + 1];

       for(int i = 1; i <= n; i++){
           graph[i] = new ArrayList<>();
       }
       
       for(int i = 0; i < m; i++){
            
          int u = in.nextInt();
          int v = in.nextInt();
          graph[u].add(v);
          graph[v].add(u);

       }
      
       color[1] = 0;
       c1.add(1);
       dfs(1);

       //out.println("Cycle Size: " + cycle.size());

       //printArr(color);

       if(cycle.size() == 0){
       
          List<Integer> treeCase = c1.size() > c2.size() ? c1 : c2;
          out.println(1 + " ");
          for(int i = 0; i < (k + 1) / 2; i++){
              out.print(treeCase.get(i) + " ");            
          }
       }else if(cycle.size() <= k){

          out.println(2 + " ");
          out.println(cycle.size());
          for(int i = 0; i < cycle.size(); i++){
            out.print(cycle.get(i) + " ");
          }

       }else{

          out.println(1 + " ");
          for(int i = 0; i < (k + 1) / 2; i++){
            out.print(cycle.get(2 * i) + " ");
          }
          
       }


    }

    public boolean dfs(int root){
         
       //out.println(root);

       // go through all the child to find back edge first
       
       int backEdgeIdx = -1;
       int backEdgeVal = 0;

       for(int child: graph[root]){
          //out.println(" root " + root + " child " + child + " depth root " + depth[root] + " depth child " + depth[child]);
          if(child == parent[root]) continue;
          if(color[child] != -1 && depth[root] > depth[child]){
            
             if(depth[child] > backEdgeVal){
                  //out.println("At root " + root + " child " + child + " dpeth root " + depth[root] + " depth child " + depth[child]);
                  backEdgeIdx = child;
                  backEdgeVal = depth[child];
             }
          }
       }

       if(backEdgeIdx != -1){

           int child = backEdgeIdx;
           int cycleStartDepth = depth[child];
           int cycleEndDepth = depth[root];

           for(int i = cycleEndDepth; i >= cycleStartDepth; i--){
                 cycle.add(root);
                 root = parent[root];
           }

           return false;

       }
         
       for(int child: graph[root]){
          
          if(child == parent[root]) continue;
          
          depth[child] = depth[root] + 1;
          color[child] = 1 - color[root];
          parent[child] = root;
          if(color[child] == 0){
             c1.add(child);
          }else{
             c2.add(child);
          }
          if(!dfs(child)) return false;
       }

       return true;

    }


    FastScanner in;
    PrintWriter out;
    
    static class FastScanner {
 
        BufferedReader br;
        StringTokenizer st;
 
        FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }
 
        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
 
        String nextLine() throws IOException {
            if (st == null || !st.hasMoreTokens())
                return br.readLine();
            StringBuilder result = new StringBuilder(st.nextToken());
            while (st.hasMoreTokens()) {
                result.append(" ");
                result.append(st.nextToken());
            }
            return result.toString();
        }
 
        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
 
        long nextLong() throws IOException {
            return Long.parseLong(next());
        }
 
        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
 
    }
 
    void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out, false);
        solve();
        out.close();
    }
 
    public static void main(String[] args) throws IOException{
        new Main().run();
    }
 
    public void printArr(int[] arr){
        for(int i = 0; i < arr.length; i++){
            out.print(arr[i] + " ");
        }
        out.println();
    }
 
    public long gcd(long a, long b){
        if(a == 0) return b;
        return gcd(b % a, a);
    }

    public boolean isPrime(long num){

        if(num == 0 || num == 1){
            return false;
        }

        for(int i = 2; i * i <= num; i++){
            if(num % i == 0){
                return false;
            }
        }

        return true;
    }

    public class Pair<A, B>{
        public A x; 
        public B y;

        Pair(A x, B y){
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair<?, ?> pair = (Pair<?, ?>) o;
            if (!x.equals(pair.x)) return false;
            return y.equals(pair.y);
        }

        @Override
        public int hashCode() {
            int result = x.hashCode();
            result = 31 * result + y.hashCode();
            return result;
        }

    }

    class Tuple{
        int x; int y; int z;
        Tuple(int ix, int iy, int iz){
            x = ix;
            y = iy;
            z = iz;
        }
    }
}
