package main

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

var bufin *bufio.Reader
var bufout *bufio.Writer

func main() {
	bufin = bufio.NewReader(os.Stdin)
	bufout = bufio.NewWriter(os.Stdout)
	defer bufout.Flush()

	var n int
	fmt.Fscanf(bufin, "%d\n", &n)

	a := make([]int, n+1)
	for i := 1; i <= n; i++ {
		fmt.Fscanf(bufin, "%d\n", &a[i])
	}

	sum := make([]int64, n+1)
	for i := 1; i <= n; i++ {
		sum[i] = sum[i-1] + int64(a[i])
	}

	dp := make([]int64, n+1)
	dp[n] = 0

	best := sum[n]
	for i := n - 1; i >= 1; i-- {
		prev := sum[i+1] - dp[i+1]
		if best < prev {
			best = prev
		}
		dp[i] = best
	}

	fmt.Fprintf(bufout, "%d\n", dp[1])
}

package main

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

func solve() {
    n := readInt()
    a := readIntArray(n)
    s, dp := make([]int, n), make([]int, n)
    for i := range s {
        s[i] = a[i]
        if i > 0 {
            s[i] += s[i-1]
        }
    }
    maxDiff := s[n-1]
    for i := n-2; i >= 0; i-- {
        dp[i] = maxDiff
        if curDiff := s[i]-dp[i]; curDiff > maxDiff {
            maxDiff = curDiff
        }
    }
    fmt.Println(dp[0])
}

// Helpers

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

// Sort

type Ints64 []int64

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

/* Sort tempalte
func (a ) Len() int           { return len(a) }
func (a ) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ) Less(i, j int) bool { return  }
*/


package main
import (
	"fmt"
	//"sort"
	"bufio"
	"os"
	"strconv"
)
func main() {
	var n,k,hsl int
	fmt.Scan(&n,&k)
	input:= bufio.NewScanner(os.Stdin)
	input.Split(bufio.ScanWords)
	v:=make([]int,150005)
	for i:=1;i<=n;i++ {
		input.Scan()
		aa,_:= strconv.Atoi(input.Text())
		//fmt.Scan(&v[i])
		v[i]=aa
		v[i]+=v[i-1]
	}
	for j:=0;j<=n-k;j++ {
		if (v[hsl+k]-v[hsl])>(v[j+k]-v[j]) {
			hsl=j
		}
	}
	hsl++
	fmt.Println(hsl)
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)

	var n, k int
	fmt.Fscan(reader, &n, &k)

	dp := make([]int, n+1)
	dp[0] = 0

	for i := 1; i <= n; i++ {
		var x int
		fmt.Fscan(reader, &x)
		dp[i] += dp[i-1] + x
	}

	mx := math.MaxInt32
	var pos int
	for i := 1; i <= n-k+1; i++ {
		if mx > dp[i+k-1]-dp[i-1] {
			mx = dp[i+k-1] - dp[i-1]
			pos = i
		}
	}

	fmt.Println(pos)
}

package main

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

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int64
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int64) {
	var k, m, min int64
	I(&k, "\n")
	ans := int64(1)
	arr := make([]int64, n+1)
	for i := int64(1); i <= n; i++ {
		o := " "
		if i == n {
			o = "\n"
		}
		I(&arr[i], o)
		if i <= k {
			m += arr[i]
			min = m
		} else {
			m += arr[i] - arr[i-k]
			if m < min {
				min = m
				ans = i - k + 1
			}
		}
	}
	O(ans, "\n")
}

package main

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

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    scanner.Split(bufio.ScanWords)
    var n,k int
    fmt.Scan(&n,&k)
    a, cnt := make([]int,n), 0
    for i := 0; i < k; i++ {
        scanner.Scan()
        a[i], _ = strconv.Atoi(scanner.Text())
        cnt += a[i]
    }
    ans, min := 1, cnt
    for i := k; i < n; i++ {
        scanner.Scan()
        a[i], _ = strconv.Atoi(scanner.Text())
        cnt = cnt-a[i-k]+a[i]
        if min > cnt { min = cnt; ans = i-k+2; }
    }
    fmt.Println(ans)
}

package main

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

func main() {
	var n, k int
	if _, err := fmt.Scanf("%d %d\n", &n, &k); err != nil {
		return
	}

	var last_k_height int = 0
	var min_k_height int = 0
	var min_k_index int = 1

	fences := make([]int, n)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; scanner.Scan(); i++ {
		h, err := strconv.Atoi(scanner.Text())
		if err != nil {
			return
		}
		fences[i] = h
		if i < k {
			last_k_height += fences[i]
			min_k_height += fences[i]
		} else {
			height := last_k_height - fences[i-k] + fences[i]
			last_k_height = height
			if height < min_k_height {
				min_k_height = height
				min_k_index = i - k + 2
			}
		}
	}

	fmt.Println(min_k_index)
}

package main

import (
	"fmt"
  "math"
)

const N = 200000

func main() {
  var n, k int
  fmt.Scan(&n, &k)
  var height [N]int
  for i := 0; i < n; i++ {
    fmt.Scan(&height[i])
  }

  sum, index, min_seq := 0, -1, math.MaxInt32
  for i := 0; i < n; i++ {
    sum += height[i]
    if i >= k {
      sum -= height[i - k]
    }
    if sum < min_seq && i >= k - 1 {
      min_seq, index = sum, i
    }
  }
  fmt.Println(index + 2 - k)
}

// 363B-mic
package main

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

func main() {
    z := bufio.NewReader(os.Stdin)
    var n, k int
    var sum, num, a [200005]int
    fmt.Scan(&n, &k)
    for i := 0; i < n; i++ {
        sum[0] = 0
        for i := 1; i <= n; i++ {
            fmt.Fscan(z, &num[i])
            sum[i] = sum[i-1] + num[i]
        }
        for i := 1; i <= n-k+1; i++ {
            a[i] = sum[i+k-1] - sum[i-1]
        }
        id := 0
        var sma int64
        sma = 2000000000000
        for i := 1; i <= n-k+1; i++ {
            if sma > int64(a[i]) {
                id = i
                sma = int64(a[i])
            }
        }
        fmt.Println(id)
        return
    }
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	defer writer.Flush()
	var n, k int
	scanf("%d %d\n", &n, &k)
	//printf("n=%d, k=%d\n", n, k)
	var a = make([]int, n)
	for i := 0; i < n; i++ {
		scanf("%d", &a[i])
	}
	//fmt.Println(a)
	var dp = make([]int, n+1)
	dp[0] = 0
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1] + a[i-1]
	}
	var ans int = 1e9
	var pos = -1
	for i := 1; i <= n-k+1; i++ {
		ans = min(ans, dp[i+k-1]-dp[i-1])
		if ans == dp[i+k-1]-dp[i-1] { // sum of elements from i to next consecutive k elements.
			pos = i
		}
	}
	printf("%d\n", pos)
}

package main

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

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	hn := make([]int, n, n)
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)
	for i := 0; i < n; i++ {
		bs.Scan()
		hn[i], _ = strconv.Atoi(bs.Text())
	}

	cur := 0
	for j := 0; j < k; j++ {
		cur += hn[j]
	}

	sum, ans := cur, 1
	for i := 1; i <= n-k; i++ {
		cur -= hn[i-1]
		cur += hn[i+k-1]
		if cur < sum {
			sum = cur
			ans = i + 1
		}
	}

	fmt.Println(ans)
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strings"
)

func Readln(r *bufio.Reader) (string, error) {
	var (
		isPrefix bool  = true
		err      error = nil
		line, ln []byte
	)
	for isPrefix && err == nil {
		line, isPrefix, err = r.ReadLine()
		ln = append(ln, line...)
	}
	return string(ln), err
}

func readIntArray(line string) []int {

	numStrings := strings.Split(strings.TrimSpace(string(line)), " ")

	numbers := make([]int, 0)

	for _, v := range numStrings {
		var converted int

		fmt.Sscanf(v, "%d", &converted)
		numbers = append(numbers, converted)
	}

	return numbers
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	line, _ := Readln(reader)
	params := readIntArray(string(line))
	consItems := params[1]

	line, _ = Readln(reader)
	itemLengths := readIntArray(line)

	newLength := 0
	for j := 0; j < consItems; j++ {
		newLength += itemLengths[j]
	}
	res := 0
	minLength := math.MaxInt32
	for i := 1; i <= len(itemLengths)-consItems; i++ {

		if minLength > newLength {
			minLength = newLength
			res = i - 1
		}

		newLength += itemLengths[i+consItems-1]
		newLength -= itemLengths[i-1]
	}

	if minLength > newLength {
		if minLength != math.MaxInt32 {
			res++
		}
	}

	fmt.Println(res + 1)
}

package main

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

func main() {
	var n, k int
	if _, err := fmt.Scanf("%d %d\n", &n, &k); err != nil {
		return
	}

	var min_k_height int64 = 0
	var min_k_index int = 1

	fences := make([]int, n)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; scanner.Scan(); i++ {
		h, err := strconv.Atoi(scanner.Text())
		if err != nil {
			return
		}
		fences[i] = h
		if i < k {
			min_k_height += int64(fences[i])
		} else {
			height := min_k_height - int64(fences[i-k]-fences[i])
			if height < min_k_height {
				min_k_height = height
				min_k_index = i - k + 2
			}
		}
	}

	fmt.Println(min_k_index)
}

package main

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

func main() {
	var n, k int
	if _, err := fmt.Scanf("%d %d\n", &n, &k); err != nil {
		return
	}

	var min_k_height int = 0
	var min_k_index int = 1

	fences := make([]int, n)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; scanner.Scan(); i++ {
		h, err := strconv.Atoi(scanner.Text())
		if err != nil {
			return
		}
		fences[i] = h
		if i < k {
			min_k_height += fences[i]
		} else {
			height := min_k_height - fences[i-k] + fences[i]
			if height < min_k_height {
				min_k_height = height
				min_k_index = i - k + 2
			}
		}
	}

	fmt.Println(min_k_index)
}

package main

import (
	"fmt"
  "math"
)

const N = 200000

func main() {
  var n, k int
  fmt.Scan(&n, &k)
  fmt.Println(n, k)
  var height [N]int
  for i := 0; i < n; i++ {
    fmt.Scan(&height[i])
  }

  sum, index, min_seq := 0, -1, math.MaxInt32
  for i := 0; i < n; i++ {
    sum += height[i]
    if i >= k {
      sum -= height[i - k]
    }
    if sum < min_seq && i >= k - 1 {
      min_seq, index = sum, i
    }
  }
  fmt.Println(index + 2 - k)
}

package main

import (
	"fmt"
  "math"
)

const N = 200000

func main() {
  var n, k int
  fmt.Scan(&n, &k)
  fmt.Println(n, k)
  var height [N]int
  for i := 0; i < n; i++ {
    fmt.Scan(&height[i])
  }

  sum, index, min_seq := 0, -1, math.MaxInt32
  for i := 0; i < n; i++ {
    sum += height[i]
    if i >= k {
      sum -= height[i - k]
    }
    if sum < min_seq && i >= k - 1 {
      min_seq, index = sum, i
      fmt.Println(sum, i)
    }
  }
  fmt.Println(index + 2 - k)
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var n, k int
	_, err := fmt.Scanf("%d %d", &n, &k)
	if err != nil {
		// do something
	}
	var a = make([]int, n)
	for i := 0; i < n; i++ {
		_, err := fmt.Scanf("%d", &a[i])
		if err != nil {

		}
	}
	var dp = make([]int, n+1)
	dp[0] = 0
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1] + a[i-1]
	}
	var ans int = 1e9
	var pos int
	for i := 1; i <= n-k+1; i++ {
		ans = min(ans, dp[i+k-1]-dp[i-1])
		if ans == dp[i+k-1]-dp[i-1] {
			pos = i
		}
	}
	fmt.Println(pos)
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var n, k int
	_, err := fmt.Scanf("%d", &n)
	_, err = fmt.Scanf("%d", &k)
	if err != nil {
		// do something
	}
	var a = make([]int, n)
	for i := 0; i < n; i++ {
		_, err := fmt.Scanf("%d", &a[i])
		if err != nil {

		}
	}
	fmt.Println(a)
	var dp = make([]int, n+1)
	dp[0] = 0
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1] + a[i-1]
	}
	var ans int = 1e9
	var pos = -1
	for i := 1; i <= n-k+1; i++ {
		ans = min(ans, dp[i+k-1]-dp[i-1])
		if ans == dp[i+k-1]-dp[i-1] { // sum of elements from i to next consecutive k elements.
			pos = i
			fmt.Println(dp[i+k-1] - dp[i-1])
		}
	}
	fmt.Println(pos)
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var n, k int
	_, err := fmt.Scanf("%d %d", &n, &k)
	if err != nil {
		// do something
	}
	var a = make([]int, n)
	for i := 0; i < n; i++ {
		_, err := fmt.Scanf("%d", &a[i])
		if err != nil {

		}
	}
	fmt.Println(a)
	var dp = make([]int, n+1)
	dp[0] = 0
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1] + a[i-1]
	}
	var ans int = 1e9
	var pos = -1
	for i := 1; i <= n-k+1; i++ {
		ans = min(ans, dp[i+k-1]-dp[i-1])
		if ans == dp[i+k-1]-dp[i-1] { // sum of elements from i to next consecutive k elements.
			pos = i
			fmt.Println(dp[i+k-1] - dp[i-1])
		}
	}
	fmt.Println(pos)
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var n, k int
	_, err := fmt.Scanf("%d %d", &n, &k)
	if err != nil {
		// do something
	}
	var a = make([]int, n)
	for i := 0; i < n; i++ {
		_, err := fmt.Scanf("%d", &a[i])
		if err != nil {

		}
	}
	var dp = make([]int, n+1)
	dp[0] = 0
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1] + a[i-1]
	}
	var ans int = 1e9
	var pos = -1
	for i := 1; i <= n-k+1; i++ {
		ans = min(ans, dp[i+k-1]-dp[i-1])
		if ans == dp[i+k-1]-dp[i-1] { // sum of elements from i to next consecutive k elements.
			pos = i
		}
	}
	fmt.Println(pos)
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var n, k int
	_, err := fmt.Scanf("%d %d", &n, &k)
	if err != nil {
		// do something
	}
	fmt.Println(n, k)
	var a = make([]int, n)
	for i := 0; i < n; i++ {
		_, err := fmt.Scan("%d", &a[i])
		if err != nil {

		}
	}
	fmt.Println(a)
	var dp = make([]int, n+1)
	dp[0] = 0
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1] + a[i-1]
	}
	var ans int = 1e9
	var pos = -1
	for i := 1; i <= n-k+1; i++ {
		ans = min(ans, dp[i+k-1]-dp[i-1])
		if ans == dp[i+k-1]-dp[i-1] { // sum of elements from i to next consecutive k elements.
			pos = i
			fmt.Println(dp[i+k-1] - dp[i-1])
		}
	}
	fmt.Println(pos)
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var n, k int
	_, err := fmt.Scanf("%d %d", &n, &k)
	if err != nil {
		// do something
	}
	var a = make([]int, n)
	for i := 0; i < n; i++ {
		_, err := fmt.Scanf("%d", &a[i])
		if err != nil {

		}
	}
	var dp = make([]int, n+1)
	dp[0] = 0
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1] + a[i-1]
	}
	var ans int = 1e9
	var pos int
	for i := 1; i <= n-k+1; i++ {
		ans = min(ans, dp[i+k-1]-dp[i-1])
		if ans == dp[i+k-1]-dp[i-1] { // sum of elements from i to next consecutive k elements.
			pos = i
		}
	}
	fmt.Println(pos)
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var n, k int
	_, err := fmt.Scanf("%d %d", &n, &k)
	if err != nil {
		// do something
	}
	var a = make([]int, n)
	for i := 0; i < n; i++ {
		_, err := fmt.Scanf("%d", &a[i])
		if err != nil {

		}
	}
	var dp = make([]int, n+1)
	dp[0] = 0
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1] + a[i-1]
	}
	var ans int = 1e9
	var pos = -1
	for i := 1; i <= n-k+1; i++ {
		ans = min(ans, dp[i+k-1]-dp[i-1])
		if ans == dp[i+k-1]-dp[i-1] { // sum of elements from i to next consecutive k elements.
			pos = i
			fmt.Println(dp[i+k-1] - dp[i-1])
		}
	}
	fmt.Println(pos)
}

package main

import (
	"fmt"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var n, k int
	_, err := fmt.Scanf("%d %d", &n, &k)
	if err != nil {
		// do something
	}
	fmt.Println(n, k)
	var a = make([]int, n)
	for i := 0; i < n; i++ {
		_, err := fmt.Scanf("%d", &a[i])
		if err != nil {

		}
	}
	fmt.Println(a)
	var dp = make([]int, n+1)
	dp[0] = 0
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1] + a[i-1]
	}
	var ans int = 1e9
	var pos = -1
	for i := 1; i <= n-k+1; i++ {
		ans = min(ans, dp[i+k-1]-dp[i-1])
		if ans == dp[i+k-1]-dp[i-1] { // sum of elements from i to next consecutive k elements.
			pos = i
			fmt.Println(dp[i+k-1] - dp[i-1])
		}
	}
	fmt.Println(pos)
}

package main

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

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	hn := make([]int, n, n)
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)
	for i := 0; i < n; i++ {
		bs.Scan()
		hn[i], _ = strconv.Atoi(bs.Text())
	}

	cur := 0
	for j := 0; j < k; j++ {
		cur += hn[j]
	}

	sum, ans := cur, 0
	for i := 1; i <= n-k; i++ {
		cur -= hn[i-1]
		cur += hn[i+k-1]
		if cur < sum {
			sum = cur
			ans = i + 1
		}
	}

	fmt.Println(ans)
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strings"
)

func Readln(r *bufio.Reader) (string, error) {
	var (
		isPrefix bool  = true
		err      error = nil
		line, ln []byte
	)
	for isPrefix && err == nil {
		line, isPrefix, err = r.ReadLine()
		ln = append(ln, line...)
	}
	return string(ln), err
}

func readIntArray(line string) []int {

	numStrings := strings.Split(strings.TrimSpace(string(line)), " ")

	numbers := make([]int, 0)

	for _, v := range numStrings {
		var converted int

		fmt.Sscanf(v, "%d", &converted)
		numbers = append(numbers, converted)
	}

	return numbers
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	line, _ := Readln(reader)
	params := readIntArray(string(line))
	consItems := params[1]

	line, _ = Readln(reader)
	itemLengths := readIntArray(line)

	newLength := 0
	for j := 0; j < consItems; j++ {
		newLength += itemLengths[j]
	}
	res := 0
	minLength := math.MaxInt32
	for i := 1; i < len(itemLengths)-consItems; i++ {

		if minLength > newLength {
			minLength = newLength
			res = i - 1
		}

		newLength += itemLengths[i+consItems-1]
		newLength -= itemLengths[i-1]
	}

	fmt.Println(res + 1)
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strings"
)

func Readln(r *bufio.Reader) (string, error) {
	var (
		isPrefix bool  = true
		err      error = nil
		line, ln []byte
	)
	for isPrefix && err == nil {
		line, isPrefix, err = r.ReadLine()
		ln = append(ln, line...)
	}
	return string(ln), err
}

func readIntArray(line string) []int {

	numStrings := strings.Split(strings.TrimSpace(string(line)), " ")

	numbers := make([]int, 0)

	for _, v := range numStrings {
		var converted int

		fmt.Sscanf(v, "%d", &converted)
		numbers = append(numbers, converted)
	}

	return numbers
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	line, _ := Readln(reader)
	params := readIntArray(string(line))
	consItems := params[1]

	line, _ = Readln(reader)
	itemLengths := readIntArray(line)

	newLength := 0
	for j := 0; j < consItems; j++ {
		newLength += itemLengths[j]
	}
	res := 0
	minLength := math.MaxInt32
	for i := consItems; i < len(itemLengths)-consItems; i++ {

		if minLength > newLength {
			minLength = newLength
			res = i - 1
		}

		newLength += itemLengths[i]
		newLength -= itemLengths[i-1]
	}

	fmt.Println(res + 1)
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strings"
)

func Readln(r *bufio.Reader) (string, error) {
	var (
		isPrefix bool  = true
		err      error = nil
		line, ln []byte
	)
	for isPrefix && err == nil {
		line, isPrefix, err = r.ReadLine()
		ln = append(ln, line...)
	}
	return string(ln), err
}

func readIntArray(line string) []int {

	numStrings := strings.Split(strings.TrimSpace(string(line)), " ")

	numbers := make([]int, 0)

	for _, v := range numStrings {
		var converted int

		fmt.Sscanf(v, "%d", &converted)
		numbers = append(numbers, converted)
	}

	return numbers
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	line, _ := Readln(reader)
	params := readIntArray(string(line))
	consItems := params[1]

	line, _ = Readln(reader)
	itemLengths := readIntArray(line)

	newLength := 0
	for j := 0; j < consItems; j++ {
		newLength += itemLengths[j]
	}
	res := 0
	minLength := math.MaxInt32
	for i := 1; i <= len(itemLengths)-consItems; i++ {

		if minLength > newLength {
			minLength = newLength
			res = i - 1
		}

		newLength += itemLengths[i+consItems-1]
		newLength -= itemLengths[i-1]
	}

	if minLength > newLength {
		res++
	}

	fmt.Println(res + 1)
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strings"
)

func Readln(r *bufio.Reader) (string, error) {
	var (
		isPrefix bool  = true
		err      error = nil
		line, ln []byte
	)
	for isPrefix && err == nil {
		line, isPrefix, err = r.ReadLine()
		ln = append(ln, line...)
	}
	return string(ln), err
}

func readIntArray(line string) []int {

	numStrings := strings.Split(strings.TrimSpace(string(line)), " ")

	numbers := make([]int, 0)

	for _, v := range numStrings {
		var converted int

		fmt.Sscanf(v, "%d", &converted)
		numbers = append(numbers, converted)
	}

	return numbers
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	line, _ := Readln(reader)
	params := readIntArray(string(line))
	consItems := params[1]

	line, _ = Readln(reader)
	itemLengths := readIntArray(line)

	newLength := 0
	for j := 0; j < consItems; j++ {
		newLength += itemLengths[j]
	}
	res := 0
	minLength := math.MaxInt32
	for i := 1; i < len(itemLengths)-consItems; i++ {

		if minLength > newLength {
			minLength = newLength
			res = i
		}

		newLength += itemLengths[i]
		newLength -= itemLengths[i-1]
	}

	fmt.Println(res + 1)
}

// 363B-mic
package main

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

func main() {
    z := bufio.NewReader(os.Stdin)
    var n, k int
    var sum, num, a [200005]int
    fmt.Scan(&n, &k)
    for i := 0; i < n; i++ {
        sum[0] = 0
        for i := 1; i <= n; i++ {
            fmt.Fscan(z, &num[i])
            sum[i] = sum[i-1] + num[i]
        }
        for i := 1; i <= n-k+1; i++ {
            a[i] = sum[i+k-1] - sum[i-1]
        }
        id := 0
        sma := 2000000
        for i := 1; i <= n-k+1; i++ {
            if sma > a[i] {
                id = i
                sma = a[i]
            }
        }
        fmt.Println(id)
        return
    }
}

// 363B-mic
package main

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

func main() {
    z := bufio.NewReader(os.Stdin)
    var n, k int
    var sum, num, a [200005]int
    fmt.Scan(&n, &k)
    for i := 0; i < n; i++ {
        sum[0] = 0
        for i := 1; i <= n; i++ {
            fmt.Fscan(z, &num[i])
            sum[i] = sum[i-1] + num[i]
        }
        for i := 1; i <= n-k+1; i++ {
            a[i] = sum[i+k-1] - sum[i-1]
        }
        id := 0
        sma := 2000000
        for i := 1; i <= n-k+1; i++ {
            if sma > a[i] {
                id = i
                sma = a[i]
            }
        }
        fmt.Println(id)
    }
    return
}


package main

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

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	tc := readNum(reader)

	for tc > 0 {
		tc--
		var a, b uint64
		s, _ := reader.ReadBytes('\n')
		pos := readUint64(s, 0, &a)
		readUint64(s, pos+1, &b)
		fmt.Println(solve(a, b))
	}
}

func solve(a, b uint64) int {
	if a == 0 {
		if b == 0 {
			return 0
		}
		return -1
	}

	if b == 0 {
		return -1
	}

	x, y := a, b
	var d int
	for x&1 != 1 {
		x >>= 1
		d--
	}
	for y&1 != 1 {
		y >>= 1
		d++
	}

	if x != y {
		return -1
	}
	if d < 0 {
		d = -d
	}
	res := d / 3
	d %= 3
	res += d / 2
	d %= 2
	res += d
	return res
}

package main

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

func min(a, b int64) int64 {
	return int64(math.Min(float64(a), float64(b)))
}

func max(a, b int) int {
	return int(math.Max(float64(a), float64(b)))
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscanf(in, "%v\n", &t)
	for now := 0; now < t;now++{
		var a, b int64
		fmt.Fscanf(in, "%v %v\n", &a, &b)
		if a == b {
			fmt.Fprintln(out, 0)
			continue
		}
		if a > b {
			ans := 0
			for a > b{
				ans++
				if a % 2 != 0 {
					break
				}
				a /= 2
			}
			if a == b{
				fmt.Fprintln(out, int64((ans) / 3) + min(int64(ans % 3), int64(1)))
			} else {
				fmt.Fprintln(out, -1)
			}
		} else{
			a, b = b, a
			ans := 0
			for a > b{
				ans++
				if a % 2 != 0 {
					break
				}
				a /= 2
			}
			if a == b{
				fmt.Fprintln(out, int64((ans) / 3) + min(int64(ans % 3), int64(1)))
			} else {
				fmt.Fprintln(out, -1)
			}
		}

	}
	return
}

package main

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

func div(v int64) {
    var cnt int64 = 0
    for ; v > 1; {
        if v % 8 == 0 {
            v /= 8
            cnt++
        } else if v % 4 == 0 {
            v /= 4
            cnt++
        } else if v % 2 == 0 {
            v /= 2
            cnt++
        } else {
            cnt = -1
            break
        }
    }
    fmt.Println(cnt)
}
func main(){
    var t int
    var a, b int64

    in := bufio.NewReader(os.Stdin)
    fmt.Fscan(in, &t)
    for ; t > 0; t-- {
        fmt.Fscan(in, &a, &b)
        if a == b {
            fmt.Println(0)
            continue
        } else if a > b {
            if a % b != 0 {
                fmt.Println(-1)
            } else {
                div(a/b)
            }
        } else {
            if b % a != 0 {
                fmt.Println(-1)
            } else {
                div(b/a)
            }
        }
    }
}

package main

import (
	"bufio"
	. "fmt"
	"os"
	"strconv"
)

var (
	inn = bufio.NewScanner(os.Stdin)
	in  = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
)

func main() {
	defer out.Flush()
	inn.Buffer([]byte{}, 10000000)
	inn.Split(bufio.ScanWords)

	for tt := rd(); tt > 0; tt-- {
		a, b := rdll(), rdll()
		cnt := 0
		if a < b {
			for a*8 <= b {
				a *= 8
				cnt++
			}
			for a*4 <= b {
				a *= 4
				cnt++
			}
			for a*2 <= b {
				a *= 2
				cnt++
			}
			if a != b {
				cnt = -1
			}
		} else {
			for a%8 == 0 && a/8 >= b {
				a /= 8
				cnt++
			}
			for a%4 == 0 && a/4 >= b {
				a /= 4
				cnt++
			}
			for a%2 == 0 && a/2 >= b {
				a /= 2
				cnt++
			}
			if a != b {
				cnt = -1
			}
		}
		Fprintln(out, cnt)

	}
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func rd() (x int) {
	inn.Scan()
	data := inn.Bytes()
	x, _ = strconv.Atoi(string(data))
	return x
}
func rdll() (x int64) {
	inn.Scan()
	data := inn.Bytes()
	x, _ = strconv.ParseInt(string(data), 10, 64)
	return x
}
func rds() string {
	inn.Scan()
	return string(inn.Bytes())
}

package main

import (
  "fmt"
)

func main() {
  var t int
  var a, b int64

  fmt.Scan(&t)
  for ;t > 0; t-- {
    ans := 0
    fmt.Scan(&a, &b)
    for a * 8 <= b {
      a *= 8
      ans++
    }
    for a * 4 <= b {
      a *= 4
      ans++
    }
    for a * 2 <= b {
      a *= 2
      ans++
    }
   for a % 8 == 0 && a / 8 >= b {
      a /= 8
      ans++
    }
   for a % 4== 0 && a / 4 >= b {
      a /= 4
      ans++
    }
   for a % 2 == 0 && a / 2 >= b {
      a /= 2
      ans++
    }
    if a != b {
        ans = -1
    }
    fmt.Println(ans)
  }
}

package main

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

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

func fastGetInt64(b []byte) int64 {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	var n int64
	n = 0
	for _, v := range b {
		n = n*10 + int64(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

//========== Implement Algorithm =======================
func solution(a int64, b int64) {
	count := 0
	if a == b {
		count = 0
	} else if a%2 == 1 && b%2 == 1 {
		count = -1
	} else if a > b {
		for a > b {
			if a%8 == 0 && a/8 >= b {
				a /= 8
				count++
			} else if a%4 == 0 && a/4 >= b {
				a /= 4
				count++
			} else if a%2 == 0 && a/2 >= b {
				a /= 2
				count++
			} else if count == 0 {
				count = -1
				break
			} else {
				break
			}
		}
	} else {
		for a < b {
			if a*8 <= b {
				a *= 8
				count++
			} else if a*4 <= b {
				a *= 4
				count++
			} else if a*2 <= b {
				a *= 2
				count++
			} else if count == 0 {
				count = -1
				break
			} else {
				break
			}
		}
	}
	if a != b {
		count = -1
	}
	fmt.Println(count)
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var num int
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	num = fastGetInt(scanner.Bytes())
	for x := 0; x < num; x++ {
		scanner.Scan()
		a := fastGetInt64(scanner.Bytes())
		scanner.Scan()
		b := fastGetInt64(scanner.Bytes())

		solution(a, b)
	}
	//======================================================

	//==================== OUTPUT ==========================

}

package main

import "fmt"

func main() {
	var test_case int
	fmt.Scan(&test_case)

	for t := 0; t < test_case; t++ {
		cnt := 0
		var n, m int64
		fmt.Scan(&n, &m)

		if n > m {
			for n > m {
				if n % 8 == 0 && n/8 >= m {
					n /= 8
					cnt++
				} else if n % 4 == 0 && n/4 >= m {
					n /= 4
					cnt++
				} else if n % 2 == 0 && n/2 >= m {
					n /= 2
					cnt++
				} else {
					break
				}
			}
		} else {
			for n < m {
				if n*8 <= m {
					n *= 8
					cnt++
				} else if n*4 <= m {
					n *= 4
					cnt++
				} else if n*2 <= m {
					n *= 2
					cnt++
				} else {
					break
				}
			}
		}

		if n == m {
			fmt.Println(cnt)
		} else {
			fmt.Println("-1")
		}
	}
}

package main

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

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input io.Reader

func main() {
	var (
		T int
	)

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &T)
	for i := 0; i < T; i++ {
		solver()
	}
}

func solver() {
	var a, b int64
	fmt.Fscan(input, &a, &b)
	if a < b {
		a, b = b, a
	}

	c1, c2 := 0, 0
	for a > b {

		if a % 2 == 0 {
			c1++
			a >>= 1
		} else {
			c2++
			b <<= 1
		}
	}

	if a != b {
		fmt.Println(-1)
	} else {
		ans := c1 / 3
		c1 %= 3
		ans += c1 / 2
		c1 %= 2
		ans += c1
		ans += c2 / 3
		c2 %= 3
		ans += c2 / 2
		c2 %= 2
		ans += c2
		fmt.Println(ans)
	}
}

package main

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

func main() {
	var t = nextInt()
	for i := int64(0); i < t; i++ {
		var a, b int64
		a = nextInt()
		b = nextInt()
		fmt.Println(solve(a, b))
	}
}

func solve(a, b int64) int64 {
	if a > b {
		a, b = b, a
	}
	if b%a != 0 {
		return -1
	}

	div := b / a
	if div == 1 {
		return 0
	}

	var c int64
	for div&1 == 0 {
		c++
		div /= 2
	}
	if div>>1 > 0 {
		return -1
	}

	var ans int64
	ans += c / 3
	c = c % 3
	ans += c / 2
	c = c % 2
	ans += c
	return ans
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

/*
URL:
https://codeforces.com/contest/1362/problem/A
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	t int

	a, b int64
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		a, b = ReadInt64_2()

		solve()
	}
}

func solve() {
	if a == b {
		fmt.Println(0)
		return
	} else if a < b {
		if b%a != 0 {
			fmt.Println(-1)
			return
		}

		q := b / a

		var e int64
		e = -1
		for i := 0; i <= 60; i++ {
			var beki int64
			beki = 1 << uint(i)
			if q == beki {
				e = int64(i)
				break
			}
		}

		if e == -1 {
			fmt.Println(-1)
			return
		}

		num := int64(0)
		num += e / 3
		e %= 3
		num += e / 2
		e %= 2
		num += e
		fmt.Println(num)
	} else {
		if a%b != 0 {
			fmt.Println(-1)
			return
		}

		q := a / b

		var e int64
		e = -1
		for i := 0; i <= 60; i++ {
			var beki int64
			beki = 1 << uint(i)
			if q == beki {
				e = int64(i)
				break
			}
		}

		if e == -1 {
			fmt.Println(-1)
			return
		}

		num := int64(0)
		num += e / 3
		e %= 3
		num += e / 2
		e %= 2
		num += e
		fmt.Println(num)
	}
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

/*
URL:
https://codeforces.com/contest/1362/problem/A
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	t int

	a, b int64
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		a, b = ReadInt64_2()

		solve()
	}
}

func solve() {
	if a == b {
		fmt.Println(0)
		return
	} else if a < b {
		if b%a != 0 {
			fmt.Println(-1)
			return
		}

		q := b / a

		var e int64
		e = -1
		for i := 0; i <= 60; i++ {
			var beki int64
			beki = 1 << uint(i)
			if q == beki {
				e = int64(i)
				break
			}
		}

		num := int64(0)
		num += e / 3
		e %= 3
		num += e / 2
		e %= 2
		num += e
		fmt.Println(num)
	} else {
		if a%b != 0 {
			fmt.Println(-1)
			return
		}

		q := a / b

		var e int64
		e = -1
		for i := 0; i <= 60; i++ {
			var beki int64
			beki = 1 << uint(i)
			if q == beki {
				e = int64(i)
				break
			}
		}

		num := int64(0)
		num += e / 3
		e %= 3
		num += e / 2
		e %= 2
		num += e
		fmt.Println(num)
	}
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

package main

import "fmt"

var nTest int
var a, b int64

func main() {
	fmt.Scanf("%d\n", &nTest)

	for i := 0; i < nTest; i++ {
		fmt.Scanf("%d %d\n", &a, &b)

		nOperation := 0
		if a > b {
			a, b = b, a
		}

		for a < b {
			if a*8 <= b {
				a *= 8
			} else if a*4 <= b {
				a *= 4
			} else if a*2 <= b {
				a *= 2
			} else {
				nOperation = -1
				break
			}
			nOperation++
		}

		fmt.Println(nOperation)
	}
}

package main

import "fmt"

var nTest int
var a, b int64

func main() {
	fmt.Scanf("%d\n", &nTest)

	for i := 0; i < nTest; i++ {
		fmt.Scanf("%d %d\n", &a, &b)

		nOperation := 0
		if a > b {
			a, b = b, a
		}

		for a < b {
			if a*8 <= b {
				a *= 8
			} else if a*4 <= b {
				a *= 4
			} else if a*2 <= b {
				a *= 2
			} else {
				nOperation = -1
				break
			}
			nOperation++
		}

		if a != b {
			fmt.Println(-1)
			continue
		}
		fmt.Println(nOperation)
	}
}

package main

import "fmt"

func main() {
	var test, a, b int64
	var count int64
	var i int64

	fmt.Scanln(&test)

	for i = 0; i < test; i++ {
		fmt.Scanf("%d%d\n", &a, &b)
		count = 0
		for a != b {
			if b > a {
				if a*8 <= b {
					a = a*8
					count++
				} else if a*4 <= b {
					a = a*4
					count++
				} else if a*2 <= b {
					a = a*2
					count++
				} else {
					count = -1
					break
				}
			}
			if a > b {
				if a%8 == 0 && a/8 >= b {
					a = a/8
					count++
				} else if a%4 == 0 && a/4 >= b {
					a = a/4
					count++
				} else if a%2 == 0 && a/2 >= b {
					a = a/2
					count++
				} else {
					count = -1
					break
				}
			}
		}
		fmt.Println(count)
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	defer out.Flush()
	for t := ScanInt(); t > 0; t-- {
		a, b := ScanInt64(), ScanInt64()
		P(solve(a, b))
	}
}

func solve(a, b int64) int {
	lastOneA, aStripped := lastOne(a)
	lastOneB, bStripped := lastOne(b)

	if aStripped != bStripped {
		return -1
	}

	dif := Abs(lastOneA - lastOneB)
	terms := dif / 3
	if dif%3 != 0 {
		terms++
	}
	return terms
}

func lastOne(x int64) (int, int64) {
	i := 0
	for x&1 == 0 {
		i++
		x = x >> 1
	}
	return i, x
}

/*********************** I/O ***********************/
var in *bufio.Scanner
var out *bufio.Writer

func init() {
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)
	out = bufio.NewWriter(os.Stdout)
}

func P(args ...interface{}) {
	print("\n", args...)
}

func PS(args ...interface{}) {
	print(" ", args...)
	print("\n", nil)
}

func print(seperator string, args ...interface{}) {
	for _, arg := range args {
		str := ""
		switch v := arg.(type) {
		case byte:
			str = string(v)
		case rune:
			str = string(v)
		case int:
			str = strconv.Itoa(v)
		case []int:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.Itoa(v[i]) + " ")
			}
			str = sb.String()
		case int64:
			str = strconv.FormatInt(v, 10)
		case []int64:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.FormatInt(v[i], 10) + " ")
			}
			str = sb.String()
		case string:
			str = v
		default:
			panic("invalid print arg: " + fmt.Sprintf("%v", arg))

		}
		out.WriteString(str + seperator)
	}
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanWords(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = ScanInt()
	}
	return a
}
func ScanInt64() int64 { i, _ := strconv.ParseInt(ScanWord(), 10, 64); return i }
func ScanInt64s(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = ScanInt64()
	}
	return a
}

/*********************** Utils int64 ***********************/
func MnMx64(args ...int64) (int64, int64) {
	minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn64(args ...int64) int64 { mn, _ := MnMx64(args...); return mn }
func Mx64(args ...int64) int64 { _, mx := MnMx64(args...); return mx }
func LCM64(a, b int64) int64   { return a / GCD64(a, b) * b }
func GCD64(a, b int64) int64 {
	if a == 0 {
		return b
	}
	return GCD64(b%a, a)
}
func SortInt64Slice(a []int64) { sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) }
func Abs64(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

/*********************** Utils int ***********************/
func MnMx(args ...int) (int, int) {
	minVal, maxVal := math.MaxInt32, math.MinInt32
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int) int { mn, _ := MnMx(args...); return mn }
func Mx(args ...int) int { _, mx := MnMx(args...); return mx }
func LCM(a, b int) int   { return a / GCD(a, b) * b }
func GCD(a, b int) int {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

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

func main() {
	var t = nextInt()
	for i := 0; i < t; i++ {
		var a, b int
		a = nextInt()
		b = nextInt()
		fmt.Println(solve(a, b))
	}
}

func solve(a, b int) int {
	if a > b {
		a, b = b, a
	}
	if b%a != 0 {
		return -1
	}

	div := b / a
	if div == 1 {
		return 0
	}

	c := 0
	for div&1 == 0 {
		c++
		div /= 2
	}
	if div>>1 > 0 {
		return -1
	}

	ans := 0
	ans += c / 3
	c = c % 3
	ans += c / 2
	c = c % 2
	ans += c
	return ans
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

package main

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

func main() {
	t := nextInt()
	for i := 0; i < t; i++ {
		fmt.Println(solve(nextInt(), nextInt()))
	}
}

func solve(a, b int) int {
	if a > b {
		a, b = b, a
	}
	if b%a != 0 {
		return -1
	}

	div := b / a
	if div == 1 {
		return 0
	}

	c := 0
	for div&1 == 0 {
		c++
		div /= 2
	}
	if div>>1 > 0 {
		return -1
	}

	ans := 0
	ans += c / 3
	c = c % 3
	ans += c / 2
	c = c % 2
	ans += c
	return ans
}

func max(xs ...int) int {
	ret := xs[0]
	for _, x := range xs[1:] {
		if ret < x {
			ret = x
		}
	}
	return ret
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

package main

import "fmt"

var nTest, a, b int

func main() {
	fmt.Scanf("%d\n", &nTest)

	for i := 0; i < nTest; i++ {
		fmt.Scanf("%d %d\n", &a, &b)

		nOperation := 0
		if a > b {
			a, b = b, a
		}

		for a < b {
			if a*8 <= b {
				a *= 8
			} else if a*4 <= b {
				a *= 4
			} else if a*2 <= b {
				a *= 2
			} else {
				nOperation = -1
				break
			}
			nOperation++
		}

		if a != b {
			fmt.Println(-1)
			continue
		}
		fmt.Println(nOperation)
	}
}

package main

import "fmt"

func main() {
	var test, a, b int64
	var count int64
	var i int64

	fmt.Scanln(&test)

	for i = 0; i < test; i++ {
		fmt.Scanf("%d%d\n", &a, &b)
		count = 0
		for a != b {
			if b > a {
				if a*8 <= b {
					a = a*8
					count++
				} else if a*4 <= b {
					a = a*4
					count++
				} else if a*2 <= b {
					a = a*2
					count++
				} else {
					count = -1
					break
				}
			}
			if a > b {
				if a%8 == 0 {
					a = a/8
					count++
				} else if a%4 == 0 {
					a = a/4
					count++
				} else if a%2 == 0 {
					a = a/2
					count++
				} else {
					count = -1
					break
				}
			}
		}
		fmt.Println(count)
	}
}

package main

import "fmt"

func main() {
	var test, a, b int
	var count int

	fmt.Scanln(&test)

	for i := 0; i < test; i++ {
		fmt.Scanf("%d%d\n", &a, &b)
		count = 0
		for a != b {
			if b > a {
				if a*8 <= b {
					a = a*8
					count++
				} else if a*4 <= b {
					a = a*4
					count++
				} else if a*2 <= b {
					a = a*2
					count++
				} else {
					count = -1
					break
				}
			}
			if a > b {
				if a%8 == 0 {
					a = a/8
					count++
				} else if a%4 == 0 {
					a = a/4
					count++
				} else if a%2 == 0 {
					a = a/2
					count++
				} else {
					count = -1
					break
				}
			}
		}
		fmt.Println(count)
	}
}

package main

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

func min(a, b int64) int64 {
	return int64(math.Min(float64(a), float64(b)))
}

func max(a, b int) int {
	return int(math.Max(float64(a), float64(b)))
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscanf(in, "%v\n", &t)
	for now := 0; now < t;now++{
		var a, b int64
		fmt.Fscanf(in, "%v %v\n", &a, &b)
		if a == b {
			fmt.Fprintln(out, 0)
			continue
		}
		if a > b {
			ans := 0
			for a >= b{
				ans++
				a /= 2
			}
			if a != b{
				fmt.Fprintln(out, int64((ans) / 3) + min(int64(ans % 3), int64(1)))
			} else {
				fmt.Fprintln(out, -1)
			}
		} else{
			a, b = b, a
			ans := 0
			for a >= b{
				ans++
				a /= 2
			}
			if a != b{
				fmt.Fprintln(out, int64((ans) / 3) + min(int64(ans % 3), int64(1)))
			} else {
				fmt.Fprintln(out, -1)
			}
		}

	}
	return
}

package main

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

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

func fastGetInt64(b []byte) int64 {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	var n int64
	n = 0
	for _, v := range b {
		n = n*10 + int64(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

//========== Implement Algorithm =======================
func solution(a int64, b int64) {
	count := 0
	if a == b {
		count = 0
	} else if a > b {
		for a > b {
			if a%8 == 0 && a/8 >= b {
				a /= 8
				count++
			} else if a%4 == 0 && a/4 >= b {
				a /= 4
				count++
			} else if a%2 == 0 && a/2 >= b {
				a /= 2
				count++
			} else if count == 0 {
				count = -1
				break
			} else {
				break
			}
		}
	} else {
		for a < b {
			if a*8 <= b {
				a *= 8
				count++
			} else if a*4 <= b {
				a *= 4
				count++
			} else if a*2 <= b {
				a *= 2
				count++
			} else if count == 0 {
				count = -1
				break
			} else {
				break
			}
		}
	}
	fmt.Println(count)
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var num int
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	num = fastGetInt(scanner.Bytes())
	for x := 0; x < num; x++ {
		scanner.Scan()
		a := fastGetInt64(scanner.Bytes())
		scanner.Scan()
		b := fastGetInt64(scanner.Bytes())

		solution(a, b)
	}
	//======================================================

	//==================== OUTPUT ==========================

}

package main

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

func fastGetInt(b []byte) int {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

func fastGetInt64(b []byte) int64 {
	neg := false
	if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	var n int64
	n = 0
	for _, v := range b {
		n = n*10 + int64(v-'0')
	}
	if neg {
		return -n
	}
	return n
}

//========== Implement Algorithm =======================
func solution(a int64, b int64) {
	count := 0
	if a == b {
		count = 0
	} else if a%2 == 1 && b%2 == 1 {
		count = -1
	} else if a > b {
		for a > b {
			if a%8 == 0 && a/8 >= b {
				a /= 8
				count++
			} else if a%4 == 0 && a/4 >= b {
				a /= 4
				count++
			} else if a%2 == 0 && a/2 >= b {
				a /= 2
				count++
			} else if count == 0 {
				count = -1
				break
			} else {
				break
			}
		}
	} else {
		for a < b {
			if a*8 <= b {
				a *= 8
				count++
			} else if a*4 <= b {
				a *= 4
				count++
			} else if a*2 <= b {
				a *= 2
				count++
			} else if count == 0 {
				count = -1
				break
			} else {
				break
			}
		}
	}
	fmt.Println(count)
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var num int
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	num = fastGetInt(scanner.Bytes())
	for x := 0; x < num; x++ {
		scanner.Scan()
		a := fastGetInt64(scanner.Bytes())
		scanner.Scan()
		b := fastGetInt64(scanner.Bytes())

		solution(a, b)
	}
	//======================================================

	//==================== OUTPUT ==========================

}


package main

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

const (
	SCANNER_BUF_SIZE = 2 << 20

	INF = int64(math.MaxInt64)
	MOD = 1e9 + 7
)

var (
	writer  *bufio.Writer
	scanner *bufio.Scanner
)

func init() {
	writer = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, SCANNER_BUF_SIZE), SCANNER_BUF_SIZE)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func lcm(a, b int64) int64 {
	return a * b / gcd(a, b)
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

func main() {
	defer writer.Flush()
	t := sint64()
	for ; t > 0; t-- {
		n, m := sint64(), sint64()
		in := make([][]int64, n)
		for i := range in {
			in[i] = make([]int64, m)
		}
		for i := range in {
			for j := range in[i] {
				in[i][j] = sint64()
			}
		}
		ans := sol(in)
		for i := range ans {
			for j := range ans[i] {
				printf("%d ", ans[i][j])
			}
			printf("\n")
		}
	}
}

func sol(in [][]int64) [][]int64 {
	for i := range in {
		for j := range in[i] {
			if (i + j) & 1 == 0 && in[i][j] & 1 == 0 {
				in[i][j]++
			}
			if (i + j) & 1 == 1 && in[i][j] & 1 == 1 {
				in[i][j]++
			}
		}
	}
	return in
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

/*
3
3 2
1 2
4 5
7 8
2 2
1 1
3 3
2 2
1 3
2 2

1 2
5 6
7 8
2 1
4 3
2 4
3 2
*/

func EngineerArtem(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T, rows, columns, target int64
	var result [][]int64

	for Fscan(in, &T); T > int64(0); T-- {
		Fscan(in, &rows)
		Fscan(in, &columns)
		result = make([][]int64, rows)
		for i := int64(0); i < rows; i++ {
			result[i] = make([]int64, columns)
		}

		for i := int64(0); i < rows; i++ {
			for j := int64(0); j < columns; j++ {
				Fscan(in, &target)
				result[i][j] = target
			}
		}

		for i := 0; i < len(result); i++ {
			for j := 0; j < len(result[i]); j++ {
				if (i+j)%2 == 0 {
					if result[i][j]%2 != 0 {
						result[i][j]++
					}
				} else {
					if result[i][j]%2 == 0 {
						result[i][j]++
					}
				}
			}
		}

		for i := 0; i < len(result); i++ {
			for j := 0; j < len(result[i]); j++ {
				Fprintf(out, "%d ", result[i][j])
			}
			Fprintf(out, "\n")
		}

	}

}

func main() {
	EngineerArtem(os.Stdin, os.Stdout)
}

// Written by : Syed Mujtaba
// Seek knowledge from the cradle to the grave
package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

func main() {
  defer writer.Flush()
  var t int
  fmt.Scanf("%d\n", &t)

  for T := 0; T < t; T++ {
  	var n, m int
  	scanf("%d %d\n", &n, &m)
  	var arr [102][102]int
  	for i := 1; i <= n; i++ {
  		for j := 1; j <= m; j++ {
  			scanf("%d", &arr[i][j])
  			if j != m {
  				scanf(" ")
  			} else {
  				scanf("\n")
  			}
  			if (arr[i][j] + i + j) % 2 == 1 {
  				arr[i][j] = arr[i][j] + 1
  			}
  			printf("%d ", arr[i][j])
  		}
  		printf("\n")
  	}
  }
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func solveA() {
	n := 0
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		printf("1 ")
	}
	printf("\n")
}

func solveB() {
	n := 0
	scanf("%d\n", &n)
	d := make(map[int]int)
	ans := "NO"
	for k, i := 0, 0; i < n; i++ {
		if i + 1 == n {
			scanf("%d\n", &k)
		} else {
			scanf("%d ", &k)
		}
		d[k]++
		if d[k] > 1 {
			ans = "YES"
		}
	}
	printf(ans + "\n")
}

func solveC() {
	n, m := 0, 0
	scanf("%d %d\n", &n, &m)
	g := make([][]int, n)
	for i := 0; i < n; i++ {
		g[i] = make([]int, m)
	}
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if j + 1 == m {
				scanf("%d\n", &g[i][j])
			} else {
				scanf("%d ", &g[i][j])
			}
			if g[i][j] % 2 != (i + j) % 2 {
				g[i][j]++
			}
		}
	}
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			printf("%d ", g[i][j])
		}
		printf("\n")
	}
}

func main() {
	defer writer.Flush()
	var t int
	scanf("%d\n", &t)
	for ; t > 0; t-- {
		solveC()
	}
}

/*
URL:
https://codeforces.com/contest/1438/problem/C
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

var (
	t int

	n, m int
	A    [][]int
)

func main() {
	defer stdout.Flush()

	t = readi()
	for tc := 0; tc < t; tc++ {
		n, m = readi2()
		A = [][]int{}
		for i := 0; i < n; i++ {
			row := readis(m)
			A = append(A, row)
		}

		solve()
	}
}

func solve() {
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			sum := i + j
			if (sum % 2) != (A[i][j] % 2) {
				A[i][j]++
			}
		}
	}

	for i := 0; i < n; i++ {
		printf("%s\n", PrintIntsLine(A[i]...))
	}
}

/*******************************************************************/

/********** common constants **********/

const (
	MOD = 1000000000 + 7
	// MOD          = 998244353
	ALPH_N  = 26
	INF_I64 = math.MaxInt64
	INF_B60 = 1 << 60
	INF_I32 = math.MaxInt32
	INF_B30 = 1 << 30
	NIL     = -1
	EPS     = 1e-10
)

/********** bufio setting **********/

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	reads = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

// mod can calculate a right residual whether value is positive or negative.
func mod(val, m int) int {
	res := val % m
	if res < 0 {
		res += m
	}
	return res
}

// min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// chmin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func chmin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// chmax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func chmax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// sum returns multiple integers sum.
func sum(integers ...int) int {
	var s int
	s = 0

	for _, i := range integers {
		s += i
	}

	return s
}

// abs is integer version of math.Abs
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// pow is integer version of math.Pow
// pow calculate a power by Binary Power (二分累乗法(O(log e))).
func pow(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := pow(a, halfE)
		return half * half
	}

	return a * pow(a, e-1)
}

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := reads()
//i := readi()
//X := readis(n)
//S := readrs()
//a := readf()
//A := readfs(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*********** Input ***********/

var (
	// reads returns a WORD string.
	reads  func() string
	stdout *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// readi returns an integer.
func readi() int {
	return int(_readInt64())
}
func readi2() (int, int) {
	return int(_readInt64()), int(_readInt64())
}
func readi3() (int, int, int) {
	return int(_readInt64()), int(_readInt64()), int(_readInt64())
}
func readi4() (int, int, int, int) {
	return int(_readInt64()), int(_readInt64()), int(_readInt64()), int(_readInt64())
}

// readll returns as integer as int64.
func readll() int64 {
	return _readInt64()
}
func readll2() (int64, int64) {
	return _readInt64(), _readInt64()
}
func readll3() (int64, int64, int64) {
	return _readInt64(), _readInt64(), _readInt64()
}
func readll4() (int64, int64, int64, int64) {
	return _readInt64(), _readInt64(), _readInt64(), _readInt64()
}

func _readInt64() int64 {
	i, err := strconv.ParseInt(reads(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// readis returns an integer slice that has n integers.
func readis(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readi()
	}
	return b
}

// readlls returns as int64 slice that has n integers.
func readlls(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = readll()
	}
	return b
}

// readf returns an float64.
func readf() float64 {
	return float64(_readFloat64())
}

func _readFloat64() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func readfs(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = readf()
	}
	return b
}

// readrs returns a rune slice.
func readrs() []rune {
	return []rune(reads())
}

/*********** Output ***********/

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// Printf is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func printf(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

/*********** Debugging ***********/

// debugf is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func debugf(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	min := func(a, b int) int {
		if a < b {
			return a
		}
		return b
	}
	max := func(a, b int) int {
		if a > b {
			return a
		}
		return b
	}
	type data struct{ x, y int }
	solve := func(Case int) {
		var n, m int
		Fscan(in, &n, &m)
		a := make([][]int, n)
		for i := range a {
			a[i] = make([]int, m)
			for j := range a[i] {
				Fscan(in, &a[i][j])
			}
		}
		for s := 0; s < n+m-1; s++ {
			l := max(0, s-n+1)
			r := min(m-1, s)
			for j := l; j <= r; j++ {
				i := s-j
				if s&1==0 {
					if a[i][j]&1==1 {
						a[i][j]++
					}
				} else {
					if a[i][j]&1==0 {
						a[i][j]++
					}
				}
			}
		}
		for _, r := range a {
			for _, v := range r {
				Fprint(out, v, " ")
			}
			Fprintln(out)
		}
	}

	var t int
	Fscan(in, &t)
	for Case := 1; Case <= t; Case++ {
		solve(Case)
	}
}

func main() { run(os.Stdin, os.Stdout) }

package main

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

func main() {
	//rd, _ := os.Open("input")
	//in := bufio.NewReader(rd)
	in := bufio.NewReader(os.Stdin)

	var t, n, m int
	var a [][]int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		fmt.Fscan(in, &n, &m)
		a = make([][]int, n)
		for i := range a {
			a[i] = make([]int, m)
			for j := range a[i] {
				fmt.Fscan(in, &a[i][j])
				if (i+j)%2 != a[i][j]%2 {
					a[i][j]++
				}
			}
		}
		for i := range a {
			for j := range a[i] {
				fmt.Printf("%d ", a[i][j])
			}
			fmt.Println()
		}
	}
}

package main

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

var reader = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(reader, &t)

	for i := 0; i < t; i++ {
		var n, m int
		fmt.Fscan(reader, &n, &m)

		matrix := make([][]int, n)
		for j := 0; j < n; j++ {
			matrix[j] = make([]int, m)
			for k := 0; k < m; k++ {
				fmt.Fscan(reader, &matrix[j][k])
			}
		}

		for j := 0; j < n; j++ {
			mod := j % 2

			for k := 0; k < m; k++ {
				if matrix[j][k]%2 == (mod+1)%2 {
					matrix[j][k]++
				}

				mod = (mod + 1) % 2
			}
		}

		for j := 0; j < n; j++ {
			for k := 0; k < m; k++ {
				fmt.Printf("%d ", matrix[j][k])
			}
			fmt.Println()
		}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	min := func(a, b int) int {
		if a < b {
			return a
		}
		return b
	}
	max := func(a, b int) int {
		if a > b {
			return a
		}
		return b
	}
	type pair struct{ x, y int }
	dir4 := []pair{{-1, 0}, {1, 0}, {0, -1}, {0, 1}} // 上下左右

	solve := func(Case int) {
		var n, m int
		Fscan(in, &n, &m)
		a := make([][]int, n)
		for i := range a {
			a[i] = make([]int, m)
			for j := range a[i] {
				Fscan(in, &a[i][j])
			}
		}
		for s := 0; s < n+m-1; s++ {
			l := max(0, s-n+1)
			r := min(m-1, s)
			o:
			for j := l; j <= r; j++ {
				i := s - j
				for _, d := range dir4 {
					if xx, yy := i+d.x, j+d.y; 0 <= xx && xx < n && 0 <= yy && yy < m  {
						if a[i][j] +1 == a[xx][yy] {
							continue o
						}
					}
				}
				a[i][j]++
			}
		}
		for _, r := range a {
			for _, v := range r {
				Fprint(out, v, " ")
			}
			Fprintln(out)
		}
	}

	var t int
	Fscan(in, &t)
	for Case := 1; Case <= t; Case++ {
		solve(Case)
	}
}

func main() { run(os.Stdin, os.Stdout) }

package main

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

const (
	SCANNER_BUF_SIZE = 2 << 20

	INF = int64(math.MaxInt64)
	MOD = 1e9 + 7
)

var (
	writer  *bufio.Writer
	scanner *bufio.Scanner
)

func init() {
	writer = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, SCANNER_BUF_SIZE), SCANNER_BUF_SIZE)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func lcm(a, b int64) int64 {
	return a * b / gcd(a, b)
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

func main() {
	defer writer.Flush()
	t := sint64()
	for ; t > 0; t-- {
		n, m := sint64(), sint64()
		in := make([][]int64, n)
		for i := range in {
			in[i] = make([]int64, m)
		}
		for i := range in {
			for j := range in[i] {
				in[i][j] = sint64()
			}
		}
		ans := sol(in)
		for i := range ans {
			for j := range ans[i] {
				printf("%d ", ans[i][j])
			}
			printf("\n")
		}
	}
}

func sol(in [][]int64) [][]int64 {
	explored := map[[2]int64]bool{}
	var explore func(int64, int64)
	explore = func(i, j int64) {
		if explored[[2]int64{i, j}] {
			return
		}
		explored[[2]int64{i, j}] = true
		if i+1 < int64(len(in)) && j+1 < int64(len(in[i])) {
			addi := false
			addj := false
			if in[i+1][j] == in[i][j] {
				in[i+1][j]++
				addi = true
			}
			if in[i][j+1] == in[i][j] {
				in[i][j+1]++
				addj = true
			}
			// make sure bot and right are the same or 2 apart
			// this ensures that the btm right number always has a way to
			// be valid
			if abs(in[i+1][j]-in[i][j+1]) == 1 {
				if !addi {
					in[i+1][j]++
				} else if !addj {
					in[i][j+1]++
				} else {
					panic("should not happen")
				}
			}
			explore(i+1, j)
			explore(i, j+1)
			return
		}
		if i+1 < int64(len(in)) {
			if in[i+1][j] == in[i][j] {
				in[i+1][j]++
			}
			explore(i+1, j)
			return
		}
		if j+1 < int64(len(in[0])) {
			if in[i][j+1] == in[i][j] {
				in[i][j+1]++
			}
			explore(i, j+1)
			return
		}
	}
	explore(0, 0)
	return in
}

package main

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

const (
	SCANNER_BUF_SIZE = 2 << 20

	INF = int64(math.MaxInt64)
	MOD = 1e9 + 7
)

var (
	writer  *bufio.Writer
	scanner *bufio.Scanner
)

func init() {
	writer = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, SCANNER_BUF_SIZE), SCANNER_BUF_SIZE)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func lcm(a, b int64) int64 {
	return a * b / gcd(a, b)
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

func main() {
	defer writer.Flush()
	t := sint64()
	for ; t > 0; t-- {
		n, m := sint64(), sint64()
		in := make([][]int64, n)
		for i := range in {
			in[i] = make([]int64, m)
		}
		for i := range in {
			for j := range in[i] {
				in[i][j] = sint64()
			}
		}
		ans := sol(in)
		for i := range ans {
			for j := range ans[i] {
				printf("%d ", ans[i][j])
			}
			printf("\n")
		}
	}
}

func sol(in [][]int64) [][]int64 {
	explored := map[[2]int64]bool{}
	var explore func(int64, int64)
	explore = func(i, j int64) {
		if explored[[2]int64{i, j}] {
			return
		}
		explored[[2]int64{i, j}] = true
		if i+1 < int64(len(in)) && j+1 < int64(len(in[i])) {
			if in[i+1][j] == in[i][j] {
				in[i+1][j]++
			}
			if in[i][j+1] == in[i][j] {
				in[i][j+1]++
			}
			if in[i+1][j]-in[i][j+1] == 1 {
				in[i][j+1]++
			}
			if in[i][j+1]-in[i+1][j] == 1 {
				in[i+1][j]++
			}
			explore(i+1, j)
			explore(i, j+1)
			return
		}
		if i+1 < int64(len(in)) {
			if in[i+1][j] == in[i][j] {
				in[i+1][j]++
			}
			explore(i+1, j)
			return
		}
		if j+1 < int64(len(in[0])) {
			if in[i][j+1] == in[i][j] {
				in[i][j+1]++
			}
			explore(i, j+1)
			return
		}
	}
	explore(0, 0)
	return in
}