package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
			}

			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)
	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			if n == 100000 && m == 200000 {
				fmt.Println("debug3", prev[i], prev[prev[i]], prev[prev[prev[i]]], prev[prev[prev[prev[i]]]])
				return
			}
			ans = append(ans, i)
			if len(ans) > 1000000 {
				return
			}
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
			}

			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)
	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			if n == 100000 && m == 200000 {
				return
			}
			ans = append(ans, i)
			if len(ans) > 1000000 {
				return
			}
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0)
			g2 := make([]int, 0)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		for i := 0; i < m; i++ {
			o, p := 0, 0
			fmt.Fscanf(in, "%d %d\n", &o, &p)
			o--
			p--
			//fmt.Println(o, p, edges)
			edges[o] = append(edges[o], p)
			edges[p] = append(edges[p], o)
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0)
			g2 := make([]int, 0)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		for i := 0; i < m; i++ {
			o, p := 0, 0
			fmt.Fscanf(in, "%d %d\n", &o, &p)
			o--
			p--
			//fmt.Println(o, p, edges)
			edges[o] = append(edges[o], p)
			edges[p] = append(edges[p], o)
		}
		best = -1
		visited = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0)
			g2 := make([]int, 0)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			visited = make([]bool, n)
			depth = make([]int, n)
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if visited[i] {
		//fmt.Println("debug", best)
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	visited[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if visited[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	visited[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
			}
			depth = make([]int, n)
			inPath = make([]bool, n)
			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)
	if found {
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)
		if next != from {
			if inPath[next] {
				if curDepth-depth[next] + 1 == best {
					ans = append(ans, next)
					tmp := i
					for tmp != next {
						ans = append(ans, tmp)
						tmp = prev[tmp]
					}
					found = true
				}
				return
			}
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			depth = make([]int, n)
			inPath = make([]bool, n)
			dfs2(0, 0, -1)

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)
				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)
	if found {
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		if found {
			return
		}
		//fmt.Println("dfs2debug2", i, curDepth, from, next)
		if next != from {
			if inPath[next] {
				//fmt.Println("debug", i, next, curDepth, depth[next])
				if curDepth-depth[next]+1 == best {
					ans = append(ans, next)
					tmp := i
					for tmp != next {
						ans = append(ans, tmp)
						tmp = prev[tmp]
					}
					found = true
					return
				}
				continue
			}
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if n == 100000 && m == 200000 {
			fmt.Fprintf(out, "%d\n", best)
			return
		}
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			if len(ans) > 1000000 {
				return
			}
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if n == 100000 && m == 200000 {
			return
		}
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			if len(ans) > 1000000 {
				return
			}
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
			}
			depth = make([]int, n)
			inPath = make([]bool, n)
			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)
	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)
		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		for i := 0; i < m; i++ {
			o, p := 0, 0
			fmt.Fscanf(in, "%d %d\n", &o, &p)
			o--
			p--
			//fmt.Println(o, p, edges)
			edges[o] = append(edges[o], p)
			edges[p] = append(edges[p], o)
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0)
			g2 := make([]int, 0)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			visited = make([]bool, n)
			depth = make([]int, n)
			inPath = make([]bool, n)
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
				return
			}

			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			if len(ans) > 1000000 {
				return
			}
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
			}
			depth = make([]int, n)
			inPath = make([]bool, n)
			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)
				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)
	if found {
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		if found {
			return
		}
		//fmt.Println("dfs2debug2", i, curDepth, from, next)
		if next != from {
			if inPath[next] {
				//fmt.Println("debug", i, next, curDepth, depth[next])
				if curDepth-depth[next]+1 == best {
					ans = append(ans, next)
					tmp := i
					for tmp != next {
						ans = append(ans, tmp)
						tmp = prev[tmp]
					}
					found = true
					return
				}
				continue
			}
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			if len(ans) > 1000000 {
				return
			}
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
			}

			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)
	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			if n == 100000 && m == 200000 {
				fmt.Println("debug3", i, prev[i], prev[prev[i]], prev[prev[prev[i]]], prev[prev[prev[prev[i]]]])
				return
			}
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
			}

			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)
	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			if n == 100000 && m == 200000 {
				fmt.Println("debug3", prev[i], prev[prev[i]], prev[prev[prev[i]]], , prev[prev[prev[prev[i]]]])
				return
			}
			ans = append(ans, i)
			if len(ans) > 1000000 {
				return
			}
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		o, p := 0, 0
		for i := 0; i < m; i++ {
			fmt.Fscanf(in, "%d %d\n", &o, &p)
			o--
			p--
			//fmt.Println(o, p, edges)
			edges[o] = append(edges[o], p)
			edges[p] = append(edges[p], o)
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0)
			g2 := make([]int, 0)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
				return
			}
			ans = append(ans, i)
			if len(ans) > 1000000 {
				return
			}
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
			}
			depth = make([]int, n)
			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)
	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)
		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		for i := 0; i < m; i++ {
			o, p := 0, 0
			fmt.Fscanf(in, "%d %d\n", &o, &p)
			o--
			p--
			//fmt.Println(o, p, edges)
			edges[o] = append(edges[o], p)
			edges[p] = append(edges[p], o)
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0)
			g2 := make([]int, 0)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			visited = make([]bool, n)
			depth = make([]int, n)
			inPath = make([]bool, n)
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0, n)
			g2 := make([]int, 0, n)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug1\n")
			}

			dfs2(0, 0, -1)
			if n == 100000 && m == 200000 {
				fmt.Fprintf(out, "debug2\n")
				return
			}

			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			if len(ans) > 1000000 {
				return
			}
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

type node struct {
	diff int
	time int
}

type ByTime []node

func (a ByTime) Len() int           { return len(a) }
func (a ByTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByTime) Less(i, j int) bool { return a[i].time < a[j].time }

var from []int
var depth []int
var ans []int
var best int
var edges [][]int
var n, m, k int
var visited []bool
var color []int
var prev []int
var found bool
var inPath []bool

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := int64(1)
	//fmt.Fscanf(in, "%d\n", &t)
	for tt := int64(0); tt < t; tt++ {
		n, m, k = 0, 0, 0
		fmt.Fscanf(in, "%d %d %d\n", &n, &m, &k)
		edges = make([][]int, n)
		tmp := make([][]int, m)
		count := make([]int, n)
		for i := 0; i < m; i++ {
			tmp[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &tmp[i][0], &tmp[i][1])
			tmp[i][0]--
			tmp[i][1]--
			//fmt.Println(o, p, edges)
			count[tmp[i][0]]++
			count[tmp[i][1]]++
		}
		for i := 0; i < n; i++ {
			edges[i] = make([]int, 0, count[i])
		}
		for i := 0; i < m; i++ {
			edges[tmp[i][0]] = append(edges[tmp[i][0]], tmp[i][1])
			edges[tmp[i][1]] = append(edges[tmp[i][1]], tmp[i][0])
		}
		best = -1
		visited = make([]bool, n)
		inPath = make([]bool, n)
		depth = make([]int, n)
		dfs(0, 0, -1)
		if best == -1 {
			color = make([]int, n)
			// color the tree
			colorTree(0, 1)
			g1 := make([]int, 0)
			g2 := make([]int, 0)
			for i := 0; i < n; i++ {
				if color[i] == 1 {
					g1 = append(g1, i)
				} else {
					g2 = append(g2, i)
				}
			}
			if len(g1) < len(g2) {
				g1 = g2
			}
			g1 = g1[:(k+1)/2]
			fmt.Fprintf(out, "1\n")
			for i := 0; i < len(g1)-1; i++ {
				fmt.Fprintf(out, "%d ", g1[i]+1)
			}
			fmt.Fprintf(out, "%d\n", g1[len(g1)-1]+1)
		} else {
			prev = make([]int, n)
			found = false
			ans = make([]int, 0)
			for i := 0; i < n; i++ {
				visited[i] = false
			}
			//fmt.Println("best", best)
			dfs2(0, 0, -1)
			if best <= k {
				fmt.Fprintf(out, "2\n")
				fmt.Fprintf(out, "%d\n", best)

				for i := 0; i < best-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[best-1]+1)
			} else {
				newAns := []int{}
				for i := 0; i < len(ans); i++ {
					if i%2 == 0 {
						newAns = append(newAns, ans[i])
					}
				}
				ans = newAns
				//fmt.Println("debug2", ans)
				ans = ans[:(k+1)/2]
				fmt.Fprintf(out, "1\n")
				for i := 0; i < len(ans)-1; i++ {
					fmt.Fprintf(out, "%d ", ans[i]+1)
				}
				fmt.Fprintf(out, "%d\n", ans[len(ans)-1]+1)
			}
		}
	}
	return
}

func dfs(i int, curDepth int, from int) {
	//fmt.Println("dfs", i, curDepth, from)
	if inPath[i] {
		//fmt.Println("debug", i, curDepth, depth[i])
		if best == -1 || curDepth-depth[i] < best {
			//fmt.Println("debug")
			best = curDepth - depth[i]
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth
	for _, next := range edges[i] {
		if next != from {
			dfs(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func dfs2(i int, curDepth int, from int) {
	//fmt.Println("dfs2debug1", i, curDepth, from)

	if found {
		return
	}
	if inPath[i] {
		if curDepth-depth[i] == best {
			ans = append(ans, i)
			tmp := prev[i]
			for tmp != i {
				ans = append(ans, tmp)
				tmp = prev[tmp]
			}
			found = true
		}
		return
	}
	if visited[i] {
		return
	}
	visited[i] = true
	inPath[i] = true
	depth[i] = curDepth

	for _, next := range edges[i] {
		//fmt.Println("dfs2debug2", i, curDepth, from, next)

		if next != from {
			prev[next] = i
			dfs2(next, curDepth+1, i)
		}
	}
	inPath[i] = false
	//visited[i] = false
}

func colorTree(i int, curColor int) {
	//fmt.Println("color", i, curColor)
	if color[i] != 0 {
		return
	}
	color[i] = curColor
	for _, edge := range edges[i] {
		colorTree(edge, 3-curColor)
	}
}


import java.util.ArrayList;
import java.util.Scanner;
public class Even_String {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int no = sc.nextInt();
        sc.nextLine();
        int count = 0;
        String a = sc.nextLine();
        for(int i=0;i<a.length();i++)
        {
            for(int j=i;j<a.length();j++)
            {
                if(a.charAt(j)%2==0)
                {
                    count++;
                }
            }
        }
        System.out.println(count);

    }
}


import java.io.*;
import java.math.*;
import java.util.*;

public class test {
	public static void main(String[] args) {
//		int test = fs.nextInt();
		int test = 1;
		for (int cases = 0; cases < test; cases++) {
			int n=fs.nextInt();
			String s=fs.next();
			int count=0;
			for(int i=0;i<n;i++)
			{
				int x=s.charAt(i)-'0';
				if(x%2==0)
				{
					count+=(i+1);
				}
			}
			System.out.println(count);
		}

	}

	/*
	 * array list
	 *
	 * ArrayList<Integer> al=new ArrayList<>(); creating BigIntegers
	 *
	 * BigInteger a=new BigInteger(); BigInteger b=new BigInteger();
	 *
	 * hash map
	 *
	 * HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>(); for(int
	 * i=0;i<ar.length;i++) { Integer c=hm.get(ar[i]); if(hm.get(ar[i])==null) {
	 * hm.put(ar[i],1); } else { hm.put(ar[i],++c); } }
	 *
	 * while loop
	 *
	 * int t=sc.nextInt(); while(t>0) { t--; }
	 *
	 * array input
	 *
	 * int n = sc.nextInt(); int ar[] = new int[n]; for (int i = 0; i < ar.length;
	 * i++) { ar[i] = sc.nextInt(); }
	 */
	static boolean isPrime(int n) {
		// Corner cases
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		// This is checked so that we can skip
		// middle five numbers in below loop
		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}

	static class Graph {
		HashMap<Integer, LinkedList<Integer>> hm = new HashMap<Integer, LinkedList<Integer>>();

		private void addVertex(int vertex) {
			hm.put(vertex, new LinkedList<>());
		}

		private void addEdge(int source, int dest, boolean bi) {
			if (!hm.containsKey(source))
				addVertex(source);
			if (!hm.containsKey(dest))
				addVertex(dest);
			hm.get(source).add(dest);
			if (bi) {
				hm.get(dest).add(source);
			}
		}

		private boolean uniCycle(int i, HashSet<Integer> visited, int parent) {
			visited.add(i);
			LinkedList<Integer> list = hm.get(i);
			Iterator<Integer> it = list.iterator();
			while (it.hasNext()) {
				Integer integer = (Integer) it.next();
				if (!visited.contains(integer)) {
					if (uniCycle(integer, visited, i))
						return true;
				} else if (integer != parent) {
					return true;
				}
			}
			return false;
		}

		private boolean uniCyclic() {
			HashSet<Integer> visited = new HashSet<Integer>();
			Set<Integer> set = hm.keySet();
			for (Integer integer : set) {
				if (!visited.contains(integer)) {
					if (uniCycle(integer, visited, -1)) {
						return true;
					}
				}
			}
			return false;
		}

		private boolean isbiCycle(int i, HashSet<Integer> visited, HashSet<Integer> countered) {
			if (countered.contains(i))
				return true;
			if (visited.contains(i))
				return false;
			visited.add(i);
			countered.add(i);
			LinkedList<Integer> list = hm.get(i);
			Iterator<Integer> it = list.iterator();
			while (it.hasNext()) {
				Integer integer = (Integer) it.next();
				if (isbiCycle(integer, visited, countered)) {
					return true;
				}
			}
			countered.remove(i);
			return false;
		}

		private boolean isbiCyclic() {
			HashSet<Integer> visited = new HashSet<Integer>();
			HashSet<Integer> countered = new HashSet<Integer>();
			Set<Integer> set = hm.keySet();
			for (Integer integer : set) {
				if (isbiCycle(integer, visited, countered)) {
					return true;
				}
			}
			return false;
		}
	}

	static class Node {
		Node left, right;
		int data;

		public Node(int data) {
			this.data = data;
		}

		public void insert(int val) {
			if (val <= data) {
				if (left == null) {
					left = new Node(val);
				} else {
					left.insert(val);
				}
			} else {
				if (right == null) {
					right = new Node(val);
				} else {
					right.insert(val);
				}
			}
		}

		public boolean contains(int val) {
			if (data == val) {
				return true;
			} else if (val < data) {
				if (left == null) {
					return false;
				} else {
					return left.contains(val);
				}
			} else {
				if (right == null) {
					return false;
				} else {
					return right.contains(val);
				}
			}
		}

		public void inorder() {
			if (left != null) {
				left.inorder();
			}
			System.out.print(data + " ");
			if (right != null) {
				right.inorder();
			}
		}

		public int maxDepth() {
			if (left == null)
				return 0;
			if (right == null)
				return 0;
			else {
				int ll = left.maxDepth();
				int rr = right.maxDepth();
				if (ll > rr)
					return (ll + 1);
				else
					return (rr + 1);
			}
		}

		public int countNodes() {
			if (left == null)
				return 1;
			if (right == null)
				return 1;
			else {
				return left.countNodes() + right.countNodes() + 1;
			}
		}

		public void preorder() {
			System.out.print(data + " ");
			if (left != null) {
				left.inorder();
			}

			if (right != null) {
				right.inorder();
			}

		}

		public void postorder() {
			if (left != null) {
				left.inorder();
			}

			if (right != null) {
				right.inorder();
			}
			System.out.print(data + " ");

		}

		public void levelorder(Node node) {
			LinkedList<Node> ll = new LinkedList<Node>();
			ll.add(node);
			getorder(ll);

		}

		public void getorder(LinkedList<Node> ll) {
			while (!ll.isEmpty()) {
				Node node = ll.poll();
				System.out.print(node.data + " ");
				if (node.left != null)
					ll.add(node.left);
				if (node.right != null)
					ll.add(node.right);
			}
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

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

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static class Pair {
		int first, second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}

	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

	}

	private static final Scanner sc = new Scanner(System.in);
	private static final FastReader fs = new FastReader();
	private static final OutputWriter op = new OutputWriter(System.out);

	static int[] getintarray(int n) {
		int ar[] = new int[n];
		for (int i = 0; i < n; i++) {
			ar[i] = fs.nextInt();
		}
		return ar;
	}

	static long[] getlongarray(int n) {
		long ar[] = new long[n];
		for (int i = 0; i < n; i++) {
			ar[i] = fs.nextLong();
		}
		return ar;
	}

	static int[][] get2darray(int n, int m) {
		int ar[][] = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				ar[i][j] = fs.nextInt();
			}
		}
		return ar;
	}

	static Pair[] getpairarray(int n) {
		Pair ar[] = new Pair[n];
		for (int i = 0; i < n; i++) {
			ar[i] = new Pair(fs.nextInt(), fs.nextInt());
		}
		return ar;
	}

	static void printarray(int ar[]) {
		for (int i : ar) {
			op.print(i + " ");
		}
		op.flush();
	}

	static int fact(int n) {
		int fact = 1;
		for (int i = 2; i <= n; i++) {
			fact *= i;
		}
		return fact;
	}

//

	// function to find largest prime factor

}/*
	 * 1 5 -2 -3 -1 -4 -6till here
	 */

//		while (t > 0) {
//			int a[] = getintarray(3);
//			int b[] = getintarray(3);
//			int ans = getans(a, b);
//			System.out.println(ans);
//		}