You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Solution.go
    path of file: ./repos/awesome-golang-algorithm/leetcode/1601-1700/1609.Even-Odd-Tree
    
    the code of the file until where you have to start completion: package Solution

type TreeNode struct {
	Val         int
	Left, Right *TreeNode
}

func Solution(root *TreeNode) bool {
	if root == nil || root.Val&1 != 1 {
		return false
	}
	queue := []*TreeNode{root}
	next := 1
	for len(queue) > 0 {
		nextQ := make([]*TreeNode, 0)
		pre := -1

		for _, item := range queue {
			if item.Left != nil {

				if !((pre == -1 && item.Left.Val&1 != next) || (next&1 == 1 && item.Left.Val&1 == 0 && item.Left.Val < pre) || (next&1 == 0 && item.Left.Val&1 == 1 && item.Left.Val > pre)) {
					return false
				}
				pre = item.Left.Val
				nextQ = append(nextQ, item.Left)
			}
			if item.Right != nil {
				if !((pre == -1 && item.Right.Val&1 != next) || (next&1 == 1 && item.Right.Val&1 == 0 && item.Right.Val < pre) || (next&1 == 0 && item.Right.Val&
    
func Solution(root *TreeNode) bool {
	if root == nil || root.Val&1 != 1 {
		return false
	}
	queue := []*TreeNode{root}
	next := 1
	for len(queue) > 0 {
		nextQ := make([]*TreeNode, 0)
		pre := -1

		for _, item := range queue {
			if item.Left != nil {

				if !((pre == -1 && item.Left.Val&1 != next) || (next&1 == 1 && item.Left.Val&1 == 0 && item.Left.Val < pre) || (next&1 == 0 && item.Left.Val&1 == 1 && item.Left.Val > pre)) {
					return false
				}
				pre = item.Left.Val
				nextQ = append(nextQ, item.Left)
			}
			if item.Right != nil {
				if !((pre == -1 && item.Right.Val&1 != next) || (next&1 == 1 && item.Right.Val&1 == 0 && item.Right.Val < pre) || (next&1 == 0 && item.Right.Val&1 == 1 && item.Right.Val > pre)) {
					return false
				}
				pre = item.Right.Val
				nextQ = append(nextQ, item.Right)
			}
		}

		next = 1 - next
		queue = nextQ
	}
	return true
}