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:
//JDope
import java.util.*;
import java.io.*;
import java.math.*;
public class D{
public static void main(String[] omkar) throws Exception
{
   BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
   StringTokenizer st = new StringTokenizer(in.readLine());
   StringBuilder sb = new StringBuilder();
   int n = Integer.parseInt(st.nextToken());
   int m = Integer.parseInt(st.nextToken());
   int k = Integer.parseInt(st.nextToken());
   int a, b;
   Node[] nodes = new Node[n];
   for(int i = 0; i < n; i++)
   {
      nodes[i] = new Node();
   }
   for(int i = 0; i < m; i++)
   {
      st = new StringTokenizer(in.readLine());
      a = Integer.parseInt(st.nextToken())-1;
      b = Integer.parseInt(st.nextToken())-1;
      nodes[a].add(b);
      nodes[b].add(a);
   }
   Stack<Integer> stack = new Stack<Integer>();
   Set<Integer> set = new HashSet<Integer>();
   int num = 0;
   int temp;
   ArrayList<Integer> temp2;
   int[] used = new int[k];
   stack.push(0);
   while(num < k)
   {
      temp = stack.pop();
      used[num] = temp;
      num++;
      set.add(temp);
      temp2 = nodes[temp].children;
      for(int i = 0; i < temp2.size(); i++)
      {
         if(!set.contains(temp2.get(i)))
         {
            if(nodes[temp2.get(i)].par == -1)
            {
               nodes[temp2.get(i)].setPar(temp);
            }
            nodes[temp2.get(i)].depth = nodes[temp].depth ^ 1;
            stack.push(temp2.get(i));
         }
         else
         {
            makeCycle(nodes, temp, temp2.get(i), sb);
            return;
         }
      }
   }
   ArrayList<Integer> g1 = new ArrayList<Integer>();
   ArrayList<Integer> g2 = new ArrayList<Integer>();
   for(int i = 0; i < k; i++)
   {
      if(nodes[used[i]].depth == 0)
      {
         g1.add(used[i]+1);
      }
      else
      {
         g2.add(used[i]+1);
      }
   }
   if(g1.size() < g2.size())
   {
      g1 = g2;
   }
   sb.append("1\n");
   for(int i = 0; i < (k+1)/2; i++)
   {
      sb.append(g1.get(i) + " ");
   }
   System.out.println(sb);
   
        }
  public static void makeCycle(Node[] nodes, int a, int b, StringBuilder sb)
  {
      ArrayList<Integer> arrA = new ArrayList<Integer>();
      Stack<Integer> stackB = new Stack<Integer>();
      Set<Integer> set = new HashSet<Integer>();
      System.out.println("2");
      int num = 0;
      int curr = a;
      while(curr != 0)
      {
         arrA.add(curr);
         set.add(curr);
         curr = nodes[curr].par;  
      }
      arrA.add(0);
      set.add(0);
      curr = b;
      while(!set.contains(curr))
      {
         stackB.push(curr+1);
         num++;
         curr = nodes[curr].par;
      }
      int count = 0;
      while(arrA.get(count) != curr)
      {
         sb.append((arrA.get(count)+1) + " ");
         count++;
         num++;
      }
      sb.append((curr+1) + " ");
      num++;
      while(!stackB.empty())
      {
         sb.append(stackB.pop() + " ");
      }
      System.out.println(num);
      System.out.println(sb);
  }
 public static int[] readArr(int N, BufferedReader in, StringTokenizer st) throws Exception
      {
         int[] arr = new int[N];
         st = new StringTokenizer(in.readLine());
         for(int i=0; i < N; i++)
            arr[i] = Integer.parseInt(st.nextToken());
         return arr;
      }
static class Node
{
   public int par = -1;
   public ArrayList<Integer> children;  
   public int depth = 0;
   public Node()
   {
      children = new ArrayList<Integer>();
   }
   public void add(int i)
   {
      children.add(i);
   }
   public void setPar(int i)
   {
      par = i;
      children.remove(Integer.valueOf(i));
   }
}
}