package main

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

var in *bufio.Reader
var out *bufio.Writer

func printf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, x, a...)
}

func scanf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fscanf(in, x, a...)
}

var err error

func nextInt() (n int) {
	for {
		_, err = scanf("%v", &n)
		if err == nil {
			return n
		}
		if err.Error() == "EOF" {
			return 0
		}
	}
}

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

func main() {
	out = bufio.NewWriterSize(os.Stdout, 8192)
	defer out.Flush()
	if false {
		file, err := os.Open("b.in")
		if err != nil {
			log.Fatal(err)
		}
		in = bufio.NewReaderSize(file, 8192)
	} else {
		in = bufio.NewReaderSize(os.Stdin, 8192)
	}

	t := nextInt()
	for ; t > 0; t-- {
		n := nextInt()
		for ; n > 0; n-- {
			if n%2 == 0 {
				printf("%d ", -abs(nextInt()))
			} else {
				printf("%d ", abs(nextInt()))
			}
		}
		printf("\n")
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var t int
	fmt.Scan(&t)
	for ; t >= 0; t-- {
		n := 0
		fmt.Scan(&n)
		for i := 0; i < n; i++ {
			var x float64
			fmt.Scan(&x)
			if i%2 == 0 {
				x = math.Abs(x)
			} else {
				x = -math.Abs(x)
			}
			fmt.Printf("%d ", int64(x))
		}
		fmt.Println()
	}
}

package main

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

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

	tc := readNum(reader)

	for tc > 0 {
		tc--
		n := readNum(reader)
		A := readNNums(reader, n)
		solve(n, A)
		var buf bytes.Buffer
		for i := 0; i < n; i++ {
			buf.WriteString(fmt.Sprintf("%d ", A[i]))
		}
		fmt.Println(buf.String())
	}
}

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 solve(n int, A []int) {
	f := make([]int, n)
	f[0] = 1

	var a, b int
	for i := 1; i < n; i++ {
		f[i] = 1

		if A[i-1] == A[i] {
			continue
		}

		if A[i-1] < A[i] {
			if a > b {
				// 4, 5, 6 => -4, -5, 6
				// -3, -2, -1 => 3, 2, -1
				// -3, -2, 1 => 3, 2, 1
				if -A[i-1] < A[i] {
					// it is ok to just flip A[i-1]
					f[i-1] = -1
					a, b = b, a
				} else {
					// -A[i-1] > A[i], then after flip, b > a, and we need to incrase b, not correct, but we can flip before i - 2
					f[i-2] *= -1
					// to revert A[i-2] > A[i-1]
					a--
					a, b = b, a
					if f[i-2]*A[i-2] < A[i-1] {
						a++
					} else if f[i-2]*A[i-2] > A[i-1] {
						b++
					}
				}
			}
			a++
		} else {
			//A[i-1] > A[i]
			// 6, 5, 4
			// -1, -2, -3
			if b > a {
				if -A[i-1] > A[i] {
					f[i-1] = -1
					a, b = b, a
				} else {
					f[i-2] *= -1
					b--
					a, b = b, a
					if f[i-2]*A[i-2] < A[i-1] {
						a++
					} else if f[i-2]*A[i-2] > A[i-1] {
						b++
					}
				}
			}
			b++
		}
	}

	for i := n - 2; i >= 0; i-- {
		f[i] *= f[i+1]
		A[i] *= f[i]
	}
}

package main

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

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

	tc := readNum(reader)

	for tc > 0 {
		tc--
		n := readNum(reader)
		A := readNNums(reader, n)
		solve(n, A)
		var buf bytes.Buffer
		for i := 0; i < n; i++ {
			buf.WriteString(fmt.Sprintf("%d ", A[i]))
		}
		fmt.Println(buf.String())
	}
}

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 solve(n int, A []int) {

	for i := 0; i < n; i += 2 {
		if A[i] < 0 {
			A[i] = -A[i]
		}
		if i+1 < n && A[i+1] > 0 {
			A[i+1] = -A[i+1]
		}
	}
}

func solve1(n int, A []int) {
	f := make([]int, n)
	f[0] = 1

	var a, b int
	for i := 1; i < n; i++ {
		f[i] = 1

		if A[i-1] == A[i] {
			continue
		}

		if A[i-1] < A[i] {
			if a > b {
				// 4, 5, 6 => -4, -5, 6
				// -3, -2, -1 => 3, 2, -1
				// -3, -2, 1 => 3, 2, 1
				if -A[i-1] < A[i] {
					// it is ok to just flip A[i-1]
					f[i-1] = -1
					a, b = b, a
				} else {
					// -A[i-1] > A[i], then after flip, b > a, and we need to incrase b, not correct, but we can flip before i - 2
					f[i-2] *= -1
					// to revert A[i-2] > A[i-1]
					a--
					a, b = b, a
					if f[i-2]*A[i-2] < A[i-1] {
						a++
					} else if f[i-2]*A[i-2] > A[i-1] {
						b++
					}
				}
			}
			a++
		} else {
			//A[i-1] > A[i]
			// 6, 5, 4
			// -1, -2, -3
			if b > a {
				if -A[i-1] > A[i] {
					f[i-1] = -1
					a, b = b, a
				} else {
					f[i-2] *= -1
					b--
					a, b = b, a
					if f[i-2]*A[i-2] < A[i-1] {
						a++
					} else if f[i-2]*A[i-2] > A[i-1] {
						b++
					}
				}
			}
			b++
		}
	}

	for i := n - 2; i >= 0; i-- {
		f[i] *= f[i+1]
		A[i] *= f[i]
	}
}

package main

import (
    "fmt"
)

func main() {
    var t int
    fmt.Scan(&t)
    for t > 0 {
        t--
        solve()
    }
}

func solve() {
    var n int
    fmt.Scan(&n)
    a := make([]int, n)
    for i := 0; i < len(a); i++ {
        fmt.Scan(&a[i])
    }
    for i := 0; i < len(a); i++ {
        a[i] = abs(a[i])
        if i & 1 == 1 { a[i] *= -1 }
    }

    for i := 0; i < len(a); i++ {
        if i == 0 {
            fmt.Print(a[i])
        } else {
            fmt.Print(" ", a[i])
        }
    }
    fmt.Println()
}

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

package main

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

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(in, &n)
		a := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &a[j])
		}

		for j := 0; j < n; j++ {
			if j == 0 {
				continue
			}

			if abs(a[j]) > abs(a[j-1]) {
				if (j%2 != 0 && a[j]-a[j-1] > 0) || (j%2 == 0 && a[j]-a[j-1] < 0) {
					a[j] = -a[j]
				}
			} else if abs(a[j]) <= abs(a[j-1]) {
				if (j%2 != 0 && a[j]-a[j-1] > 0) || (j%2 == 0 && a[j]-a[j-1] < 0) {
					a[j-1] = -a[j-1]
				}
			}
		}
		for j := 0; j < n; j++ {
			fmt.Print(a[j], " ")
		}
		fmt.Println()
	}
}

package main
import (
	"fmt"
	"math"
)
var a[100] float64
var t int

func main() {
	fmt.Scan(&t)
	for j := 0; j < t; j++ {
		var n int
		fmt.Scan(&n)
		for i := 0; i < n; i++ {
			fmt.Scan(&a[i])
			a[i] = math.Abs(a[i])
			if i % 2 == 1 {
				a[i] = -a[i]
			}
			fmt.Printf("%d ", int64(a[i]))
		}
		fmt.Println()
	}

}

package main

import (
	"fmt"
	"math"
)

func main() {
	var t int
	fmt.Scan(&t)
	for ; t >= 0; t-- {
		n := 0
		fmt.Scan(&n)
		for i := 0; i < n; i++ {
			var x float64
			fmt.Scan(&x)
			if i%2 == 0 {
				x = math.Abs(float64(x))
			} else {
				x = -math.Abs(float64(x))
			}
			fmt.Print(x + ' ')
		}
		fmt.Println()
	}
}


// 1613A. Long Comparison
package main

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

func main() {
	var T int
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &T)
	for t := 1; t <= T; t++ {
		var x1, p1, x2, p2 int
		fmt.Fscan(reader, &x1, &p1, &x2, &p2)
		digits1 := len(strconv.Itoa(x1)) + p1
		digits2 := len(strconv.Itoa(x2)) + p2
		if digits1 < digits2 {
			fmt.Println("<")
		} else if digits1 > digits2 {
			fmt.Println(">")
		} else {
			for len(strconv.Itoa(x1)) != len(strconv.Itoa(x2)) {
				if x1 < x2 {
					x1 = x1 * 10
				} else {
					x2 = x2 * 10
				}
			}
			if x1 < x2 {
				fmt.Println("<")
			} else if x1 > x2 {
				fmt.Println(">")
			} else {
				fmt.Println("=")
			}
		}

	}
}

package main

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

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

func main() {
	var ntc int
	fmt.Fscan(in, &ntc)
	for t := 0; t < ntc; t++ {
		var aint, bint, a0, b0 int
		fmt.Fscan(in, &aint, &a0, &bint, &b0)
		var astr = strconv.Itoa(aint)
		var bstr = strconv.Itoa(bint)
		if len(astr)+a0 != len(bstr)+b0 {
			if len(astr)+a0 < len(bstr)+b0 {
				fmt.Fprintln(out, "<")
			} else {
				fmt.Fprintln(out, ">")
			}
		} else {
			for ; a0 < b0; b0-- {
				bint *= 10
			}
			for ; a0 > b0; a0-- {
				aint *= 10
			}
			if aint == bint {
				fmt.Fprintln(out, "=")
			} else if aint < bint {
				fmt.Fprintln(out, "<")
			} else {
				fmt.Fprintln(out, ">")
			}
		}
	}
	out.Flush()
}

package main

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

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

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

func main() {
	defer out.Flush()

	var tc int
	for fmt.Fscan(in, &tc); tc > 0; tc-- {
		var x1, x2 string
		var p1, p2 int
		fmt.Fscan(in, &x1, &p1, &x2, &p2)
		p1, p2 = p1-min(p1, p2), p2-min(p1, p2)
		for len(x1) < len(x2) && p1 > 0 {
			x1 += "0"
			p1--
		}
		for len(x2) < len(x1) && p2 > 0 {
			x2 += "0"
			p2--
		}
		l1, l2 := len(x1)+p1, len(x2)+p2
		d := l1 - l2
		if l1 == l2 {
			d = strings.Compare(x1, x2)
		}
		if d < 0 {
			fmt.Fprintln(out, "<")
		} else if d > 0 {
			fmt.Fprintln(out, ">")
		} else {
			fmt.Fprintln(out, "=")
		}
	}
}

package main

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

var sc = bufio.NewScanner(os.Stdin)

func scan() string {
	for sc.Scan() {
		break
	}
	return sc.Text()
}

func scanInt() int {
	i, err := strconv.Atoi(scan())
	if err != nil {
		panic(err)
	}
	return i
}

func scanInt8() int8 {
	i, err := strconv.ParseInt(scan(), 10, 8)
	if err != nil {
		panic(err)
	}
	return int8(i)
}

func scanInt64() int64 {
	i, err := strconv.ParseInt(scan(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

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

func min(ints ...int) int {
	a := ints[0]
	n := len(ints)
	for i := 1; i < n; i++ {
		if ints[i] < a {
			a = ints[i]
		}
	}
	return a
}

func max(ints ...int) int {
	a := ints[0]
	n := len(ints)
	for i := 1; i < n; i++ {
		if ints[i] > a {
			a = ints[i]
		}
	}
	return a
}

func proc() {
	x1, p1 := scanInt(), scanInt()
	x2, p2 := scanInt(), scanInt()
	s1, s2 := fmt.Sprintf("%d", x1), fmt.Sprintf("%d", x2)
	l1, l2 := len(s1), len(s2)
	n1, n2 := l1+p1, l2+p2
	if n1 < n2 {
		fmt.Println("<")
	} else if n1 > n2 {
		fmt.Println(">")
	} else {
		for l1 < l2 {
			l1++
			s1 += "0"
		}
		for l2 < l1 {
			l2++
			s2 += "0"
		}
		x1, _ = strconv.Atoi(s1)
		x2, _ = strconv.Atoi(s2)
		if x1 < x2 {
			fmt.Println("<")
		} else if x1 > x2 {
			fmt.Println(">")
		} else {
			fmt.Println("=")
		}
	}
}

func main() {
	sc.Split(bufio.ScanWords)
	t := scanInt()
	for i := 0; i < t; i++ {
		proc()
	}
}

package main

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

func main() {
	writer := bufio.NewWriter(os.Stdout)
	var (
		n, p1, p2 int
		in1, in2 string
	)

	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&in1)
		fmt.Scan(&p1)
		fmt.Scan(&in2)
		fmt.Scan(&p2)
		d, e := len(in1) + p1, len(in2) + p2

		if d > e {
			writer.WriteString(">\n")
		} else if e > d {
			writer.WriteString("<\n")
		} else {
			for len(in1) > len(in2) {
				in2 += "0"
			}

			for len(in1) < len(in2) {
				in1 += "0"
			}

			if in1 > in2 {
				writer.WriteString(">\n")
			} else if in2 > in1 {
				writer.WriteString("<\n")
			} else {
				writer.WriteString("=\n")
			}
		}
	}

	writer.Flush()
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)

	for t := 0; t < T; t++ {
		var a, p1 int
		fmt.Fscan(in, &a, &p1)

		var b, p2 int
		fmt.Fscan(in, &b, &p2)

		s1 := fmt.Sprintf("%d", a)
		s2 := fmt.Sprintf("%d", b)

		if len(s1)+p1 < len(s2)+p2 {
			fmt.Fprintln(out, "<")
		} else if len(s1)+p1 > len(s2)+p2 {
			fmt.Fprintln(out, ">")
		} else {
			limit := len(s1)
			if len(s2) < limit {
				limit = len(s2)
			}

			var d int
			for i := 0; i < limit; i++ {
				if s1[i] > s2[i] {
					d = 1
					break
				} else if s1[i] < s2[i] {
					d = -1
					break
				}
			}

			if d == 0 {
				if len(s1) > len(s2) {
					for i := limit; i < len(s1); i++ {
						if s1[i] > '0' {
							d = 1
						}
					}
				} else if len(s2) > len(s1) {
					for i := limit; i < len(s2); i++ {
						if s2[i] > '0' {
							d = -1
						}
					}
				}
			}

			if d > 0 {
				fmt.Fprintln(out, ">")
			} else if d < 0 {
				fmt.Fprintln(out, "<")
			} else {
				fmt.Fprintln(out, "=")
			}
		}
	}
}

package main

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

var (
	reader            = bufio.NewReader(os.Stdin)
	t, x1, x2, p1, p2 int
)

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

func pow10(x int) int64 {
	k := int64(1)
	for ; x > 0; x-- {
		k *= 10
	}
	return k
}

func solve(x1, p1, x2, p2 int) string {
	if p1-p2 > 6 {
		return ">"
	}
	if p2-p1 > 6 {
		return "<"
	}
	p1, p2 = p1-min(p1, p2), p2-min(p1, p2)
	v1, v2 := int64(x1)*pow10(p1), int64(x2)*pow10(p2)
	if v1 > v2 {
		return ">"
	}
	if v1 < v2 {
		return "<"
	}
	return "="
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &x1, &p1, &x2, &p2)
		fmt.Println(solve(x1, p1, x2, p2))
	}
}

package main

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

var (
	reader            = bufio.NewReader(os.Stdin)
	t, x1, x2, p1, p2 int
)

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

func solve(x1, p1, x2, p2 int) string {
	if p1-p2 > 6 {
		return ">"
	}
	if p2-p1 > 6 {
		return "<"
	}
	p1, p2 = p1-min(p1, p2), p2-min(p1, p2)
	v1, v2 := int64(x1)*int64(math.Pow10(p1)), int64(x2)*int64(math.Pow10(p2))
	if v1 > v2 {
		return ">"
	}
	if v1 < v2 {
		return "<"
	}
	return "="
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &x1, &p1, &x2, &p2)
		fmt.Println(solve(x1, p1, x2, p2))
	}
}

package main

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

var (
	reader            = bufio.NewReader(os.Stdin)
	t, x1, x2, p1, p2 int
)

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

func solve(x1, p1, x2, p2 int) string {
	if p1-p2 > 6 {
		return ">"
	}
	if p2-p1 > 6 {
		return "<"
	}
	d := min(p1, p2)
	p1 -= d
	p2 -= d
	v1, v2 := int64(x1)*int64(math.Pow10(p1)), int64(x2)*int64(math.Pow10(p2))
	if v1 > v2 {
		return ">"
	}
	if v1 < v2 {
		return "<"
	}
	return "="
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &x1, &p1, &x2, &p2)
		fmt.Println(solve(x1, p1, x2, p2))
	}
}

package main

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

func solve() {
	f := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	N := 0
	fmt.Fscan(f, &N)
	for i := 0; i < N; i++ {
		x1, x2, p1, p2 := 0.0, 0.0, 0.0, 0.0
		fmt.Fscan(f, &x1, &p1)
		fmt.Fscan(f, &x2, &p2)
		a, b := math.Log10(x1)+p1, math.Log10(x2)+p2
		if a-b > 1e-9 {
			fmt.Fprintln(w, ">")
		} else if a-b < -1e-9 {
			fmt.Fprintln(w, "<")
		} else {
			fmt.Fprintln(w, "=")
		}
	}
	w.Flush()
}

func main() {
	solve()
}

package main

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

func main(){
	var t uint16
	var x1, p1, x2, p2 uint32
	r := bufio.NewReader(os.Stdin)
	fmt.Fscanf(r, "%v\n", &t)
	var i uint16
	for i=0; i<t; i++{
		fmt.Fscanf(r, "%v %v\n%v %v\n", &x1, &p1, &x2, &p2)
		if p1 < p2{
			p1, p2 = 0, p2-p1
		} else {
			p2, p1 = 0, p1-p2
		}
		if p1 >= 7 {
			fmt.Println(">")
		} else if p2 >= 7 {
			fmt.Println("<")
		} else {
			if x1*uint32(math.Pow(10, float64(p1))) < x2*uint32(math.Pow(10, float64(p2))) {
				fmt.Println("<")
			} else if  x1*uint32(math.Pow(10, float64(p1))) > x2*uint32(math.Pow(10, float64(p2))){
				fmt.Println(">")
			} else {
				fmt.Println("=")
			}
		}
	}
}

package main

import (
	"fmt"
)

const eps = 1e-9

func cmp(x float64) int {
	if x > eps {
		return 1
	} else if x < -eps {
		return -1
	} else {
		return 0
	}
}

func solve() {
	var x1, p1, x2, p2 int
	fmt.Scan(&x1, &p1, &x2, &p2)
	if x1 == x2 && p1 == p2 {
		fmt.Println("=")
		return
	}
	var y1, y2 float64
	y1 = float64(x1)
	y2 = float64(x2)
	for i := 0; i < p1-p2 && cmp(y2) != 0; i++ {
		y2 /= 10
	}
	for i := 0; i < p2-p1 && cmp(y1) != 0; i++ {
		y1 /= 10
	}
	ret := cmp(y1 - y2)
	if ret == 1 {
		fmt.Println(">")
	} else if ret == 0 {
		fmt.Println("=")
	} else {
		fmt.Println("<")
	}
}

func main() {
	var t int
	fmt.Scan(&t)
	for k := 0; k < t; k++ {
		solve()
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(in, &t)
	for t > 0 {
		t -= 1
		var x1, p1, x2, p2 int
		fmt.Fscan(in, &x1, &p1, &x2, &p2)
		var first, second = strconv.Itoa(x1), strconv.Itoa(x2)

		if len(first) + p1 < len(second) + p2 {
			fmt.Println("<")
			continue
		} else if len(first) + p1 > len(second) + p2 {
			fmt.Println(">")
			continue
		}

		if len(first) < len(second){
			for len(first) != len(second){
				first += "0"
			}
		}else{
			for len(first) != len(second){
				second += "0"
			}
		}

		if first < second {
			fmt.Println("<")
		} else if first > second {
			fmt.Println(">")
		} else {
			fmt.Println("=")
		}
	}
}

package main

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

/*
3
4 2
2 4
2 3
5 1
100 0
1 2
---
<
>
=
*/

//goland:noinspection GoUnhandledErrorResult
func main() {
	defer writer.Flush()

	bld := strings.Builder{}

	var t = 1
	scanf("%d\n", &t)

	for ; t > 0; t-- {
		var x1, p1, x2, p2 int
		scanf("%d %d\n %d %d\n", &x1, &p1, &x2, &p2)

		lenN1 := int(math.Log10(float64(x1))) + 1
		lenN2 := int(math.Log10(float64(x2))) + 1

		fx1 := float64(x1)
		fx2 := float64(x2)

		if lenN1 < lenN2 {
			fx2 /= math.Pow10(lenN2 - lenN1)
			p2 += lenN2 - lenN1
		} else {
			fx1 /= math.Pow10(lenN1 - lenN2)
			p1 += lenN1 - lenN2
		}

		var cmpRes int

		if p1 == p2 {
			if fx1 < fx2 {
				cmpRes = -1
			} else if fx1 > fx2 {
				cmpRes = 1
			}
		} else {
			if p1 < p2 {
				cmpRes = -1
			} else if p1 > p2 {
				cmpRes = 1
			}
		}

		switch cmpRes {
		case -1:
			fmt.Fprintln(&bld, "<")
		case 0:
			fmt.Fprintln(&bld, "=")
		case 1:
			fmt.Fprintln(&bld, ">")
		}
	}

	printf("%s", bld.String())
}

const maxUint = ^uint(0)

//goland:noinspection GoUnusedConst
const minUint = 0
const maxInt = int(maxUint >> 1)

//goland:noinspection GoUnusedConst
const minInt = -maxInt - 1

//goland:noinspection GoUnusedType
type pair struct {
	x int64
	y int64
}

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

//goland:noinspection GoUnusedFunction
func printf(f string, a ...interface{}) {
	if _, err := fmt.Fprintf(writer, f, a...); err != nil {
		panic(err)
	}
}

func scanf(f string, a ...interface{}) {
	if _, err := fmt.Fscanf(reader, f, a...); err != nil {
		panic(err)
	}
}

//goland:noinspection GoUnusedFunction
func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

//goland:noinspection GoUnusedFunction
func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

//goland:noinspection GoUnusedFunction
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//goland:noinspection GoUnusedFunction
func isPrime(n int) bool {
	if n == 2 || n == 3 {
		return true
	}

	if n <= 1 || n%2 == 0 || n%3 == 0 {
		return false
	}

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

	return true
}

//goland:noinspection GoUnusedFunction
func gcd(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

//goland:noinspection GoUnusedFunction
func lcm(a, b int) int {
	return abs(a) / gcd(a, b) * abs(b)
}

// Examples:
//	digitAt(1234, -1) -> panic!
//	digitAt(1234, 0) -> 4
//	digitAt(1234, 1) -> 3
//	digitAt(1234, 2) -> 2
//	digitAt(1234, 3) -> 1
//	digitAt(1234, 4) -> panic!
//goland:noinspection GoUnusedFunction
func digitAt(num, pos int) int {
	num = abs(num)

	lenNum := int(math.Log10(float64(num))) + 1
	if pos < 0 || pos >= lenNum {
		err := fmt.Sprintf("Out of bound access for digit. Position passed %d, number %d", pos, num)
		panic(err)
	}

	rem := num % int(math.Pow10(pos+1))
	return rem / int(math.Pow10(pos))
}

// 从控制台读取输入:
package main
import "fmt"

var (
	T int
	x1,x2,p1,p2 int
)

func GetNumLen(num int) int {
	var cnt = 1;
	for num > 0 {
		cnt ++
		num /= 10
	}
	return cnt
}

func pow( a , b int) int {
	ans := 1
	for i := 0 ; i < b ; i ++ {
		ans *= a
	}
	return ans
}

func main() {

	_ , _ = fmt.Scanln(&T)
	for i := 0 ; i < T ; i ++ {
		_ , _ = fmt.Scanln(&x1,&p1)
		_ , _ = fmt.Scanln(&x2,&p2)
		if GetNumLen(x1) + p1 == GetNumLen(x2) + p2 {
			if x1 > x2 {
				x2 *= pow(10,GetNumLen(x1)-GetNumLen(x2))
			}else{
				x1 *= pow(10,GetNumLen(x2)-GetNumLen(x1))
			}

			if x1 == x2 {
				fmt.Println("=")
			} else if x1 > x2 {
				fmt.Printf("%c\n",'>')
			}else {
				fmt.Printf("%c\n",'<')
			}
		}else{
			if GetNumLen(x1) + p1 > GetNumLen(x2) + p2 {
				fmt.Printf("%c\n",'>')
			} else {
				fmt.Printf("%c\n",'<')
			}
		}
	}

}

package main

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

// var m []int
// err = json.Unmarshal([]byte(r.FormValue("example")), &m)

// for i := 0; i < len(m); i++ {
// 	fmt.Println(m[i])
// }

// sort.Slice(arr, func(i, j int) bool {
// 	return arr[i] > arr[j]
// })

func MIN(x, y int64) int64 {
	if x > y {
		return y
	} else {
		return x
	}
}

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

func MAX(x, y int64) int64 {
	if x > y {
		return x
	} else {
		return y
	}
}

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

func LCM(x, y int) int {
	if x >= y {
		initial := x
		for i := 1; i < y+2; i++ {
			if initial%y == 0 {
				break
			} else {
				initial = initial + x
			}

		}
		return initial
	} else {
		initial := y
		for i := 1; i < x+2; i++ {
			if initial%x == 0 {
				break
			} else {
				initial = initial + y
			}

		}
		return initial
	}
}

func GCD(x, y int64) int64 {
	if x*y == 0 {
		return MAX(x, y)
	} else {
		var l, q int64
		l = MAX(x, y)
		q = MIN(x, y)
		var m int64
		for l*q > 0 {
			a := l % q
			b := l - a
			cc := int64(b / q)
			remain := l - cc*q
			l = MAX(remain, q)
			q = MIN(remain, q)
			if l*q == 0 {
				m = l + q
				break
			}

		}
		return m
	}
}

func IsItPrime(x int) bool {
	if x < 10 {
		if x == 2 || x == 3 || x == 5 || x == 7 {
			return true
		} else {
			return false
		}
	} else {
		j := 0
		k := math.Sqrt(float64(x))
		for m := 3; m <= int(k); {
			if x%m == 0 {
				j = 1
				break
			}
			m = m + 2
		}
		if j == 1 {
			return false
		} else {
			return true
		}
	}
}

func PrimeFactorization(n int) (pfs map[int]int) {
	pfs = make(map[int]int)

	// Get the number of 2s that divide n
	for n%2 == 0 {
		if _, ok := pfs[2]; ok {
			pfs[2] += 1
		} else {
			pfs[2] = 1
		}
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			if _, ok := pfs[i]; ok {
				pfs[i] += 1
			} else {
				pfs[i] = 1
			}
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs[n] = 1
	}

	return
}

func NumberOfDivisors(n int) int {
	pfs := PrimeFactorization(n)

	num := 1
	for _, exponents := range pfs {
		num *= (exponents + 1)
	}

	return num
}

func KthPrime(x int) (y int) {
	if x == 1 {
		y = 2
	}
	if x == 2 {
		y = 3
	}
	if x > 2 {
		var sum int = 2
		begin := 5
		for sum < x+1 {
			if IsItPrime(begin) == true {
				sum++
			}
			if sum == x {
				y = begin
				break
			} else {
				if begin%6 == 1 {
					begin = begin + 4
				} else {
					begin = begin + 2
				}
			}
		}
	}
	return
}

func MODULE(x, y int) int {
	if x > y {
		return x - y
	} else {
		return y - x
	}
}

func BITAND(x, y int64) int64 {
	var ans int64
	begin := x
	sec := y
	var count int64 = 1
	for 1 == 1 {
		if (begin%2)*(sec%2) == 1 {
			ans = ans + count
			count = count * 2
			begin = int64(begin / 2)
			sec = int64(sec / 2)
			if begin*sec == 0 {
				break
			}

		} else {
			count = count * 2
			begin = int64(begin / 2)
			sec = int64(sec / 2)
			if begin*sec == 0 {
				break
			}
		}
	}
	return ans
}

func Sum(n, m int) int {
	var ans int

	if n == 1 {
		return 0
	} else {
		for i := 2; i < n; i++ {
			ans = (ans + Sum(i, m)) % m
		}
		for j := 2; j < n+1; j++ {
			ans = (ans + Sum(n/j, m)) % m
		}
		return ans
	}
}

func ChangeStringToDate(x string) (t time.Time, err error) {
	t, err = time.Parse("2006-01-02", x)
	return
}

func DiffrenceBetweenTwoDates(first, second time.Time) int64 {
	date := first
	date2 := second
	k := date.Unix() - date2.Unix()
	return k
}

func Union(a, b []int) []int {
	m := make(map[int]bool)

	for _, item := range a {
		m[item] = true
	}

	for _, item := range b {
		if _, ok := m[item]; !ok {
			a = append(a, item)
		}
	}
	return a
}

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

func DIVI(x []int) string {
	if len(x) == 1 {
		if x[0]%2 == 0 {
			return "NO"
		} else {
			return "YES"

		}
	} else {
		q := len(x)
		if DIVI(x[:q-1]) == "YES" {
			b := 0
			for j := 2; j < q+2; j++ {
				if x[q-1]%j != 0 {
					b = 1
					break
				}
			}
			if b == 1 {
				return "YES"
			} else {
				return "NO"

			}
		} else {
			return "NO"
		}
	}
}

var t int

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &t)
	for o := 0; o < t; o++ {
		var x1, x2 string
		var p1, p2 int
		fmt.Fscan(input, &x1, &p1, &x2, &p2)

		first := len(x1) + p1
		second := len(x2) + p2

		if first > second {
			fmt.Println(">")
		}
		if first < second {
			fmt.Println("<")
		}

		if first == second {
			t1 := p1 - MINN(p1, p2)
			t2 := p2 - MINN(p1, p2)
			for i := 1; i <= t1; i++ {
				x1 = x1 + "0"
			}
			for i := 1; i <= t2; i++ {
				x2 = x2 + "0"
			}

			// sort.Strings(array)
			// f := 0
			// s := 0
			// if array[o] == x1 {
			// 	f++
			// }
			// if array[0] == x2 {
			// 	s++
			// }
			// if f+s == 2 {
			// 	fmt.Println("=")
			// } else {
			// 	if f == 1 {
			// 		fmt.Println("<")
			// 	} else {
			// 		fmt.Println(">")

			// 	}
			// }

			if x1 > x2 {
				fmt.Println(">")
			}
			if x1 < x2 {
				fmt.Println("<")

			}
			if x1 == x2 {
				fmt.Println("=")

			}
		}
	}
}

package main

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

func main() {
	defer _w.Flush()
	t := ReadInt()
	for i := 0; i < t; i++ {
		solve()
	}
}
func solve() {
	s1, p1 := ReadString(), ReadInt()
	s2, p2 := ReadString(), ReadInt()

	f1, f2 := f(s1, p1), f(s2, p2)
	if f1 != f2 {
		if f1 < f2 {
			println("<")
		} else {
			println(">")
		}
		return
	}

	if len(s1) < len(s2) {
		s1 += strings.Repeat("0", len(s2)-len(s1))
	} else {
		s2 += strings.Repeat("0", len(s1)-len(s2))
	}

	if s1 < s2 {
		println("<")
	} else if s1 == s2 {
		println("=")
	} else {
		println(">")
	}
}
func f(x string, p int) int {
	return len(x) + p
}

var _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func ReadString() (s string) { fmt.Fscan(_r, &s); return }
func ReadInt() (i int)       { fmt.Fscan(_r, &i); return }
func ReadInts(n int) (a []int) {
	for ; n > 0; n-- {
		a = append(a, ReadInt())
	}
	return
}
func print(a ...interface{})   { fmt.Fprint(_w, a...) }
func println(a ...interface{}) { fmt.Fprintln(_w, a...) }
func prints(s []int)           { v := fmt.Sprint(s); println(v[1 : len(v)-1]) }

package main

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

func main() {
	writer := bufio.NewWriter(os.Stdout)
	var (
		n, in1, in2, p1, p2 int
	)

	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&in1)
		fmt.Scan(&p1)
		fmt.Scan(&in2)
		fmt.Scan(&p2)
		mn := int(math.Min(float64(p2), float64(p1)))
		p1 -= mn
		p2 -= mn
		if p1 >= 7 {
			writer.WriteString(">\n")
		} else if p2 >= 7 {
			writer.WriteString("<\n")
		} else {
			if in1 * int(math.Pow(float64(10), float64(p1))) > in2 * int(math.Pow(float64(10), float64(p2))) {
				writer.WriteString(">\n")
			} else if in1 * int(math.Pow(float64(10), float64(p1))) < in2 * int(math.Pow(float64(10), float64(p2))) {
				writer.WriteString("<\n")

			} else {
				writer.WriteString("=\n")

			}
		}

	}

	writer.Flush()
}

package main

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

func main() {
	writer := bufio.NewWriter(os.Stdout)
	var (
		n, in1, in2, p1, p2 int
	)

	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&in1)
		fmt.Scan(&p1)
		fmt.Scan(&in2)
		fmt.Scan(&p2)
		mn := int(math.Min(float64(p2), float64(p1)))
		p1 -= mn
		p2 -= mn
		if p1 >= 7 {
			writer.WriteString("<\n")
		} else if p2 >= 7 {
			writer.WriteString(">\n")
		} else {
			if in1 * int(math.Pow(float64(10), float64(p1))) > in2 * int(math.Pow(float64(10), float64(p2))) {
				writer.WriteString(">\n")
			} else if in1 * int(math.Pow(float64(10), float64(p1))) < in2 * int(math.Pow(float64(10), float64(p2))) {
				writer.WriteString("<\n")

			} else {
				writer.WriteString("=\n")

			}
		}

	}

	writer.Flush()
}

package main

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

func main() {
	writer := bufio.NewWriter(os.Stdout)
	var (
		n, in1, in2, p1, p2 int
	)

	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&in1)
		fmt.Scan(&p1)
		fmt.Scan(&in2)
		fmt.Scan(&p2)
		mn := int(math.Min(float64(p2), float64(p1)))
		p1 -= mn
		p2 -= mn
		if p1 >= 7 {
			writer.WriteString("<\n")
		}
		if p2 >= 7 {
			writer.WriteString(">\n")
		}
		if in1 * int(math.Pow(float64(10), float64(p1))) > in2 * int(math.Pow(float64(10), float64(p2))) {
			writer.WriteString(">\n")
		} else if in1 * int(math.Pow(float64(10), float64(p1))) < in2 * int(math.Pow(float64(10), float64(p2))) {
			writer.WriteString("<\n")

		} else {
			writer.WriteString("=\n")

		}
	}

	writer.Flush()
}

package main

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

func main() {
	writer := bufio.NewWriter(os.Stdout)
	var (
		n, in1, in2, p1, p2 int
	)

	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&in1)
		fmt.Scan(&p1)
		fmt.Scan(&in2)
		fmt.Scan(&p2)
		mn := int(math.Min(float64(p2), float64(p1)))
		p1 -= mn
		p2 -= mn
		if p1 >= 7 {
			writer.WriteString("<\n")
		} else if p2 >= 7 {
			writer.WriteString(">\n")
		}
		if in1 * int(math.Pow(float64(10), float64(p1))) > in2 * int(math.Pow(float64(10), float64(p2))) {
			writer.WriteString(">\n")
		} else if in1 * int(math.Pow(float64(10), float64(p1))) < in2 * int(math.Pow(float64(10), float64(p2))) {
			writer.WriteString("<\n")

		} else {
			writer.WriteString("=\n")

		}
	}

	writer.Flush()
}

package main

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

func main() {
	writer := bufio.NewWriter(os.Stdout)
	var (
		n, in1, in2, p1, p2 int
	)

	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&in1)
		fmt.Scan(&p1)
		fmt.Scan(&in2)
		fmt.Scan(&p2)
		if in1 * int(math.Pow(float64(10), float64(p1))) > in2 * int(math.Pow(float64(10), float64(p2))) {
			writer.WriteString(">\n")
		} else if in1 * int(math.Pow(float64(10), float64(p1))) < in2 * int(math.Pow(float64(10), float64(p2))) {
			writer.WriteString("<\n")

		} else {
			writer.WriteString("=\n")

		}
	}

	writer.Flush()
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var (
		n, in1, in2, p1, p2 int
	)

	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&in1)
		fmt.Scan(&p1)
		fmt.Scan(&in2)
		fmt.Scan(&p2)
		if in1 * int(math.Pow(float64(10), float64(p1))) > in2 * int(math.Pow(float64(10), float64(p2))) {
			fmt.Println(">")
		} else if in1 * int(math.Pow(float64(10), float64(p1))) < in2 * int(math.Pow(float64(10), float64(p2))) {
			fmt.Println("<")
		} else {
			fmt.Println("=")
		}
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var (
		n, in1, in2, p1, p2 int
	)

	fmt.Scanf("%d", &n)
	for i := 0; i < n; i++ {
		fmt.Scanf( "%d %d", &in1, &p1)
		fmt.Scanf( "%d %d", &in2, &p2)
		if in1 * int(math.Pow(float64(10), float64(p1))) > in2 * int(math.Pow(float64(10), float64(p2))) {
			fmt.Println(">")
		} else if in1 * int(math.Pow(float64(10), float64(p1))) < in2 * int(math.Pow(float64(10), float64(p2))) {
			fmt.Println("<")
		} else {
			fmt.Println("=")
		}
	}
}

package main

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

func main() {
	writer := bufio.NewWriter(os.Stdout)

	var (
		n, in1, in2, p1, p2 int
	)

	fmt.Scanf("%d", &n)
	for i := 0; i < n; i++ {
		fmt.Scanf( "%d %d", &in1, &p1)
		fmt.Scanf( "%d %d", &in2, &p2)
		if in1 * int(math.Pow(float64(10), float64(p1))) > in2 * int(math.Pow(float64(10), float64(p2))) {
			writer.WriteString(">\n")
		} else if in1 * int(math.Pow(float64(10), float64(p1))) < in2 * int(math.Pow(float64(10), float64(p2))) {
			writer.WriteString("<\n")
		} else {
			writer.WriteString("=\n")
		}
	}

	writer.Flush()
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)

	for t := 0; t < T; t++ {
		var a, p1 int
		fmt.Fscan(in, &a, &p1)

		var b, p2 int
		fmt.Fscan(in, &b, &p2)

		s1 := fmt.Sprintf("%d", a)
		s2 := fmt.Sprintf("%d", b)

		if len(s1)+p1 < len(s2)+p2 {
			fmt.Fprintln(out, "<")
		} else if len(s1)+p1 > len(s2)+p2 {
			fmt.Fprintln(out, ">")
		} else {
			limit := len(s1)
			if len(s2) < limit {
				limit = len(s2)
			}

			var d int
			for i := 0; i < limit; i++ {
				if s1[i] > s2[i] {
					d = 1
				} else if s1[i] < s2[i] {
					d = -1
				}
			}

			if d == 0 {
				if len(s1) > len(s2) {
					for i := limit; i < len(s1); i++ {
						if s1[i] > '0' {
							d = 1
						}
					}
				} else if len(s2) > len(s1) {
					for i := limit; i < len(s2); i++ {
						if s2[i] > '0' {
							d = -1
						}
					}
				}
			}

			if d > 0 {
				fmt.Fprintln(out, ">")
			} else if d < 0 {
				fmt.Fprintln(out, "<")
			} else {
				fmt.Fprintln(out, "=")
			}
		}
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)

	for t := 0; t < T; t++ {
		var a, p1 int
		fmt.Fscan(in, &a, &p1)

		var b, p2 int
		fmt.Fscan(in, &b, &p2)

		s1 := fmt.Sprintf("%d", a)
		s2 := fmt.Sprintf("%d", b)

		if len(s1)+p1 < len(s2)+p2 {
			fmt.Fprintln(out, "<")
		} else if len(s1)+p1 > len(s2)+p2 {
			fmt.Fprintln(out, ">")
		} else {
			var d int
			for i := range s1 {
				if i > len(s2)-1 {
					if s1[i] > '0' {
						d = 1
					}
					break
				}

				if s1[i] > s2[i] {
					d = 1
					break
				} else if s1[i] < s2[i] {
					d = -1
					break
				}
			}

			if d > 0 {
				fmt.Fprintln(out, ">")
			} else if d < 0 {
				fmt.Fprintln(out, "<")
			} else if len(s2) > len(s1) && s2[len(s2)-1] > '0' {
				fmt.Fprintln(out, "<")
			} else {
				fmt.Fprintln(out, "=")
			}
		}
	}
}

package main

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

var (
	reader            = bufio.NewReader(os.Stdin)
	t, x1, x2, p1, p2 int
)

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

func solve(x1, p1, x2, p2 int) string {
	if p1-p2 > 6 {
		return ">"
	}
	if p2-p1 > 6 {
		return "<"
	}
	p1 -= min(p1, p2)
	p2 -= min(p1, p2)
	v1, v2 := int64(x1)*int64(math.Pow10(p1)), int64(x2)*int64(math.Pow10(p2))
	if v1 > v2 {
		return ">"
	}
	if v1 < v2 {
		return "<"
	}
	return "="
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &x1, &p1, &x2, &p2)
		fmt.Println(solve(x1, p1, x2, p2))
	}
}

package main

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

func solve() {
	f := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	N := 0
	fmt.Fscan(f, &N)
	for i := 0; i < N; i++ {
		x1, x2, p1, p2 := 0.0, 0.0, 0.0, 0.0
		fmt.Fscan(f, &x1, &p1)
		fmt.Fscan(f, &x2, &p2)
		a, b := int64(math.Log10(x1)+p1), int64(math.Log10(x2)+p2)
		if a < b {
			fmt.Fprintln(w, "<")
		} else if a > b {
			fmt.Fprintln(w, ">")
		} else {
			fmt.Fprintln(w, "=")
		}
	}
	w.Flush()
}

func main() {
	solve()
}

package main

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

func solve() {
	f := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	N := 0
	fmt.Fscan(f, &N)
	for i := 0; i < N; i++ {
		x1, x2, p1, p2 := 0.0, 0.0, 0.0, 0.0
		fmt.Fscan(f, &x1, &p1)
		fmt.Fscan(f, &x2, &p2)
		a, b := math.Log10(x1)+p1, math.Log10(x2)+p2
		if a < b {
			fmt.Fprintln(w, "<")
		} else if a > b {
			fmt.Fprintln(w, ">")
		} else {
			fmt.Fprintln(w, "=")
		}
	}
	w.Flush()
}

func main() {
	solve()
}

package main

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

func main(){
	var t uint16
	var x1, p1, x2, p2 uint32
	r := bufio.NewReader(os.Stdin)
	fmt.Fscanf(r, "%v\n", &t)
	var i uint16
	for i=0; i<t; i++{
		fmt.Fscanf(r, "%v %v\n%v %v\n", &x1, &p1, &x2, &p2)
		if p1 < p2{
			p1, p2 = 0, p2-p1
		} else {
			p2, p1 = 0, p1-p2
		}
		if x1*uint32(math.Pow(10, float64(p1))) < x2*uint32(math.Pow(10, float64(p2))) {
			fmt.Println("<")
		} else if  x1*uint32(math.Pow(10, float64(p1))) > x2*uint32(math.Pow(10, float64(p2))){
			fmt.Println(">")
		} else {
			fmt.Println("=")
		}
	}
}

package main

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

func main(){
	var t uint16
	var x1, p1, x2, p2 uint32
	r := bufio.NewReader(os.Stdin)
	fmt.Fscanf(r, "%v\n", &t)
	var i uint16
	for i=0; i<=t; i++{
		fmt.Fscanf(r, "%v %v\n%v %v\n", &x1, &p1, &x2, &p2)
		if p1 < p2{
			p1, p2 = 0, p2-p1
		} else {
			p2, p1 = 0, p1-p2
		}
		if x1*uint32(math.Pow(10, float64(p1))) < x2*uint32(math.Pow(10, float64(p2))) {
			fmt.Println("<")
		} else if  x1*uint32(math.Pow(10, float64(p1))) > x2*uint32(math.Pow(10, float64(p2))){
			fmt.Println(">")
		} else {
			fmt.Println("=")
		}
	}
}

package main

import (
	"fmt"
)

const eps = 1e-9

func cmp(x float64) int {
	if x > eps {
		return 1
	} else if x < -eps {
		return -1
	} else {
		return 0
	}
}

func solve() {
	var x1, p1, x2, p2 int
	fmt.Scan(&x1, &p1, &x2, &p2)
	if x1 == x2 && p1 == p2 {
		println("=")
		return
	}
	var y1, y2 float64
	y1 = float64(x1)
	y2 = float64(x2)
	for i := 0; i < p1-p2 && cmp(y2) != 0; i++ {
		y2 /= 10
	}
	for i := 0; i < p2-p1 && cmp(y1) != 0; i++ {
		y1 /= 10
	}
	ret := cmp(y1 - y2)
	if ret == 1 {
		println(">")
	} else if ret == 0 {
		println("=")
	} else {
		println("<")
	}
}

func main() {
	var t int
	fmt.Scan(&t)
	for k := 0; k < t; k++ {
		solve()
	}
}

package main

import (
	"fmt"
)

const eps = 1e-9

func cmp(x float64) int {
	if x > eps {
		return 1
	} else if x < -eps {
		return -1
	} else {
		return 0
	}
}

func solve() {
	var x1, p1, x2, p2 int
	fmt.Scanf("%d%d\n%d%d\n", &x1, &p1, &x2, &p2)
	if x1 == x2 && p1 == p2 {
		println("=")
		return
	}
	var y1, y2 float64
	y1 = float64(x1)
	y2 = float64(x2)
	for i := 0; i < p1-p2 && cmp(y2) != 0; i++ {
		y2 /= 10
	}
	for i := 0; i < p2-p1 && cmp(y1) != 0; i++ {
		y1 /= 10
	}
	ret := cmp(y1 - y2)
	if ret == 1 {
		println(">")
	} else if ret == 0 {
		println("=")
	} else {
		println("<")
	}
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for k := 0; k < t; k++ {
		solve()
	}
}

// 从控制台读取输入:
package main
import "fmt"

var (
	T int
	x1,x2,p1,p2 int
)

func GetNumLen(num int) int {
	var cnt = 1;
	for num > 0 {
		cnt ++
		num /= 10
	}
	return cnt
}

func pow( a , b int) int {
	ans := 1
	for i := 0 ; i < b ; i ++ {
		ans *= a
	}
	return ans
}

func main() {

	_ , _ = fmt.Scanln(&T)
	for i := 0 ; i < T ; i ++ {
		_ , _ = fmt.Scanln(&x1,&p1)
		_ , _ = fmt.Scanln(&x2,&p2)
		fmt.Println(x1,p1,x2,p2)
		if GetNumLen(x1) + p1 == GetNumLen(x2) + p2 {
			if x1 > x2 {
				x2 *= pow(10,GetNumLen(x1)-GetNumLen(x2))
			}else{
				x1 *= pow(10,GetNumLen(x2)-GetNumLen(x1))
			}

			if x1 == x2 {
				fmt.Println("=")
			} else if x1 > x2 {
				fmt.Printf("%c\n",'>')
			}else {
				fmt.Printf("%c\n",'<')
			}
		}else{
			if GetNumLen(x1) + p1 > GetNumLen(x2) + p2 {
				fmt.Printf("%c\n",'>')
			} else {
				fmt.Printf("%c\n",'<')
			}
		}
	}

}


package main
import "fmt"

func main(){
    var q int
    fmt.Scan(&q)
    for i:=0;i<q;i++ {
        var a,b,c int64
        fmt.Scan(&a,&b,&c)
        fmt.Println((a+b+c)/2)
    }
}

package main

import "fmt"
import "sort"

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var arr []int64 = make([]int64, 3)
		for i, _ := range arr {
			fmt.Scan(&arr[i])
		}
		sort.Slice(arr, func(i, j int) bool {
			return arr[i] < arr[j]
		})
		A := arr[0]
		B := arr[1]
		C := arr[2] - (B - A)
		fmt.Println(B + C/2)
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	var a, b, c, result int64
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a, &b, &c)
		result = (a + b + c) / 2
		fmt.Println(result)
	}
}

package main
import "fmt"
func main(){
    var x int
    fmt.Scan(&x)
    for i:=0; i<x; i++{
        var a uint64
        var b uint64
        var c uint64
        fmt.Scan(&a,&b,&c)
        fmt.Println((a+b+c)/2)
    }
}

package main

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

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

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

	for i := 0; i < n; i++ {
		as := make([]int64, 3)
		fmt.Fscanf(input, "%d %d %d\n", &as[0], &as[1], &as[2])

		var sum int64
		for j := range as {
			sum += as[j]
		}
		fmt.Println(sum / 2)
	}
}

package main

import "fmt"

type Triple struct{ a, b, c int64 }

func main() {
	var q int // query
	fmt.Scan(&q)
	t := make([]Triple, q) // triples
	for i := 0; i < q; i++ {
		fmt.Scan(&t[i].a, &t[i].b, &t[i].c)
		res := (t[i].a + t[i].b + t[i].c) / 2
		fmt.Println(res)
	}
}

package main

import "fmt"

func main() {
    var a,b,c,q int64
    fmt.Scan(&q)
    for q>0 {
        fmt.Scan(&a, &b, &c)
        a = (a+b+c)>>1
        fmt.Println(a)
        q-=1
    }
}

package main

import "fmt"

func main() {
	var num int

	_, err := fmt.Scan(&num)
	if err != nil {
	}

	for num > 0 {
		num -= 1
		var candy int64
		var result int64 = 0
		for i := 0; i < 3; i++ {
			_, err := fmt.Scan(&candy)
			if err != nil {
			}
			result += candy
		}
		fmt.Println(result / 2)
	}

}

package main

import "fmt"

func main() {
	var q, a, b, c int64
	fmt.Scan(&q)
	for ; q > 0; q-- {
		fmt.Scan(&a, &b, &c)
		fmt.Println((a + b + c) / 2)
	}
}

package main

import "fmt"

func main() {
	var n int
	var a, b, c int64
	fmt.Scanln(&n)
	for i := 0; i < n;  i++{
		fmt.Scanln(&a, &b, &c)
		fmt.Println((a + b + c)/2)
	}
}

package main

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

func main() {

	//stdin, err := os.Open("test.txt")
	//if err != nil {
	//	panic(err)
	//}
	//defer stdin.Close()
	stdin := os.Stdin
	reader := bufio.NewReaderSize(stdin, 1024*1024)

	//stdout, err := os.Create("test.txt")
	//if err != nil {
	//	panic(err)
	//}
	//defer stdout.Close()
	stdout := os.Stdout
	writer := bufio.NewWriterSize(stdout, 1024*1024)

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

	for i := 0; i < n; i++ {
		var a, b, c int64
		fmt.Fscanf(reader, "%d %d %d\n", &a, &b, &c)
		fmt.Fprintf(writer, "%d\n", (a+b+c)/2)
	}

	writer.Flush()
}

// Author: sighduck
// URL: https://codeforces.com/contest/1196/problem/A

package main

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

func Solve(a, b, c int64) int64 {
	arr := []int64{a, b, c}
	sort.Slice(arr, func(i, j int) bool { return arr[i] < arr[j] })
	return (arr[2]-arr[1]+arr[0])/2 + arr[1]
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var q int
	fmt.Fscanf(reader, "%d\n", &q)
	for i := 0; i < q; i++ {
		var a, b, c int64
		fmt.Fscanf(reader, "%d %d %d\n", &a, &b, &c)
		fmt.Fprintf(writer, "%d\n", Solve(a, b, c))
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	for ; n > 0; n-- {
		var a, b, c uint64
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		fmt.Println((a + b + c) / 2)
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	for ; n > 0; n-- {
		var a, b, c int64
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		fmt.Println((a + b + c) / 2)
	}
}

package main

import "fmt"

func main(){
	var n, a, b, c, i int64;
	fmt.Scan(&n);
	for i=0; i < n; i++{
		fmt.Scan(&a, &b, &c);
		fmt.Println((a + b + c) / 2)
	}
}

package main

import (
	"fmt"
)

func main() {
	var q, x int64

	// scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Scanln(&q)

	for i := int64(0); i < q; i++ {
		var sum int64
		for j := int64(0); j < 3; j++ {
			fmt.Scanf("%d", &x)
			sum += x
		}
		fmt.Scanln(&x)

		fmt.Println(sum / 2)
	}

}

package main

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

func main() {
	var n, a, b, c int64

	scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Fscanln(scr, &n)

	for i := int64(0); i < n; i++ {
		fmt.Fscanln(scr, &a, &b, &c)
		fmt.Println((a + b + c) / 2)
	}

}

package main

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

func main() {
	var t int
	var a, b, c int64
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		aa := make([]int64, 0)
		fmt.Fscan(in, &a, &b, &c)
		aa = append(aa, a)
		aa = append(aa, b)
		aa = append(aa, c)
		sort.Slice(aa, func(i, j int) bool {
			return aa[i] < aa[j]
		})
		left := aa[2] - aa[1] + aa[0]
		fmt.Println(left/2 + aa[1])
	}
}

package main

import "fmt"

func main() {
	var query int
	var pile1, pile2, pile3, sum uint64
	fmt.Scan(&query)
	for i := 0; i < query; i++ {
		fmt.Scan(&pile1)
		fmt.Scan(&pile2)
		fmt.Scan(&pile3)
		sum = pile1 + pile2 + pile3;
		fmt.Println(sum/2)
	}
}

// A. Three Piles of Candies
/*
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split between Alice and Bob as they want: for example, it is possible that Alice takes the whole pile, and Bob gets nothing from it.

After taking the candies from the piles, if Alice has more candies than Bob, she discards some candies so that the number of candies she has is equal to the number of candies Bob has. Of course, Bob does the same if he has more candies.

Alice and Bob want to have as many candies as possible, and they plan the process of dividing candies accordingly. Please calculate the maximum number of candies Alice can have after this division process (of course, Bob will have the same number of candies).

You have to answer 𝑞 independent queries.

Let's see the following example: [1,3,4]. Then Alice can choose the third pile, Bob can take the second pile, and then the only candy from the first pile goes to Bob — then Alice has 4 candies, and Bob has 4 candies.

Another example is [1,10,100]. Then Alice can choose the second pile, Bob can choose the first pile, and candies from the third pile can be divided in such a way that Bob takes 54 candies, and Alice takes 46 candies. Now Bob has 55 candies, and Alice has 56 candies, so she has to discard one candy — and after that, she has 55 candies too.

Input
The first line of the input contains one integer 𝑞 (1≤𝑞≤1000) — the number of queries. Then 𝑞 queries follow.

The only line of the query contains three integers 𝑎,𝑏 and 𝑐 (1≤𝑎,𝑏,𝑐≤1016) — the number of candies in the first, second and third piles correspondingly.

Output
Print 𝑞 lines. The 𝑖-th line should contain the answer for the 𝑖 -th query — the maximum number of candies Alice can have after the division, if both Alice and Bob act optimally (of course, Bob will have the same number of candies).

Example
Input
4
1 3 4
1 10 100
10000000000000000 10000000000000000 10000000000000000
23 34 45

Output
4
55
15000000000000000
51
*/
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input1, _ := reader.ReadString('\n')
	q, _ := strconv.Atoi(strings.TrimSpace(input1))

	for ; q > 0; q-- {
		input2, _ := reader.ReadString('\n')
		arr := strings.Split(strings.TrimSpace(input2), " ")

		a, _ := strconv.ParseInt(arr[0], 10, 64)
		b, _ := strconv.ParseInt(arr[1], 10, 64)
		c, _ := strconv.ParseInt(arr[2], 10, 64)

		fmt.Println((a + b + c) / 2)
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var q int
	fmt.Scan(&q)
	for ; q > 0; q-- {
		a := make([]uint64, 3, 3)
		fmt.Scan(&a[0], &a[1], &a[2])
		sort.Slice(a, func(i, j int) bool {
			return a[i] < a[j]
		})
		fmt.Println(a[1] + (a[2] - a[1] + a[0]) / 2)
	}
}

package main

import (
	"fmt"
)

func main() {
	var q int
	fmt.Scan(&q)
	for ; q > 0; q-- {
		var a, b, c int64
		fmt.Scan(&a, &b, &c)
		fmt.Println((a + b + c) / 2)
	}
}

package main

import "fmt"

func main(){
    var n, a, b, c, i int64;
    fmt.Scan(&n);
    for ; i < n; i++{
        fmt.Scan(&a, &b, &c);
        fmt.Println((a + b + c) / 2)
    }
}

package main

import "fmt"

func main() {
	var testCase int

	if _, err := fmt.Scan(&testCase); err != nil {

	}

	for testCase > 0 {
		testCase -= 1
		var (
			p1 int64
			p2 int64
			p3 int64
		)
		if _, err := fmt.Scan(&p1, &p2, &p3); err != nil {

		}

		sum := p1 + p2 + p3
		if sum%2 == 0 {
			fmt.Println(sum / 2)
		} else {
			fmt.Println((sum - 1) / 2)
		}
	}
}

package main

import (
	"fmt"
)

func main()  {
	var requests int
	fmt.Scan(&requests)
	for i:=0;i< requests;i++ {
		ledges := make([]uint64, 3)
		for k:=0;k<3;k++ {
			fmt.Scan(&ledges[k])
		}
		var count uint64
		for _,j:= range ledges{
			count += j
		}
		fmt.Printf("%d\n", count/2)
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, q, x int

	// scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Scanln(&q)

	for i := 0; i < q; i++ {
		fmt.Scanln(&n)
		sum := 0
		for j := 0; j < n; j++ {
			fmt.Scanf("%d", &x)
			sum += x
		}
		fmt.Scanln(&x)

		fmt.Println(x / 2)
	}

}

package main

import (
	"fmt"
)

func main() {
	var q, x int

	// scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Scanln(&q)

	for i := 0; i < q; i++ {
		sum := 0
		for j := 0; j < 3; j++ {
			fmt.Scanf("%d", &x)
			sum += x
		}
		fmt.Scanln(&x)

		fmt.Println(sum / 2)
	}

}

package main

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

func main() {
	var n, a, b, c int

	scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Fscanln(scr, &n)

	for i := 0; i < n; i++ {
		fmt.Fscanln(scr, &a, &b, &c)
		fmt.Println((a + b + c) / 2)
	}

}

package main

import (
	"fmt"
)

func main() {
	var q, x int

	// scr := bufio.NewReader(os.Stdin)
	// ocr := bufio.NewWriter(os.Stdout)

	fmt.Scanln(&q)

	for i := 0; i < q; i++ {
		sum := 0
		for j := 0; j < 3; j++ {
			fmt.Scanf("%d", &x)
			sum += x
		}
		fmt.Scanln(&x)

		fmt.Println(x / 2)
	}

}

package main

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

func main() {
	var t, a, b, c int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		aa := make([]int, 0)
		fmt.Fscan(in, &a, &b, &c)
		aa = append(aa, a)
		aa = append(aa, b)
		aa = append(aa, c)
		sort.Slice(aa, func(i, j int) bool {
			return aa[i] < aa[j]
		})
		left := aa[2] - aa[1] + aa[0]
		fmt.Println(left/2 + aa[1])
	}
}

// A. Three Piles of Candies
/*
Alice and Bob have received three big piles of candies as a gift. Now they want to divide these candies as fair as possible. To do this, Alice takes one pile of candies, then Bob takes one of the other two piles. The last pile is split between Alice and Bob as they want: for example, it is possible that Alice takes the whole pile, and Bob gets nothing from it.

After taking the candies from the piles, if Alice has more candies than Bob, she discards some candies so that the number of candies she has is equal to the number of candies Bob has. Of course, Bob does the same if he has more candies.

Alice and Bob want to have as many candies as possible, and they plan the process of dividing candies accordingly. Please calculate the maximum number of candies Alice can have after this division process (of course, Bob will have the same number of candies).

You have to answer 𝑞 independent queries.

Let's see the following example: [1,3,4]. Then Alice can choose the third pile, Bob can take the second pile, and then the only candy from the first pile goes to Bob — then Alice has 4 candies, and Bob has 4 candies.

Another example is [1,10,100]. Then Alice can choose the second pile, Bob can choose the first pile, and candies from the third pile can be divided in such a way that Bob takes 54 candies, and Alice takes 46 candies. Now Bob has 55 candies, and Alice has 56 candies, so she has to discard one candy — and after that, she has 55 candies too.

Input
The first line of the input contains one integer 𝑞 (1≤𝑞≤1000) — the number of queries. Then 𝑞 queries follow.

The only line of the query contains three integers 𝑎,𝑏 and 𝑐 (1≤𝑎,𝑏,𝑐≤1016) — the number of candies in the first, second and third piles correspondingly.

Output
Print 𝑞 lines. The 𝑖-th line should contain the answer for the 𝑖 -th query — the maximum number of candies Alice can have after the division, if both Alice and Bob act optimally (of course, Bob will have the same number of candies).

Example
Input
4
1 3 4
1 10 100
10000000000000000 10000000000000000 10000000000000000
23 34 45

Output
4
55
15000000000000000
51
*/
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input1, _ := reader.ReadString('\n')
	q, _ := strconv.Atoi(strings.TrimSpace(input1))

	for ; q > 0; q-- {
		input2, _ := reader.ReadString('\n')
		arr := strings.Split(strings.TrimSpace(input2), " ")

		a, _ := strconv.Atoi(arr[0])
		b, _ := strconv.Atoi(arr[1])
		c, _ := strconv.Atoi(arr[2])

		fmt.Println((a + b + c) / 2)
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var q int
	fmt.Scan(&q)
	for ; q > 0; q-- {
		a := make([]int, 3, 3)
		fmt.Scan(&a[0], &a[1], &a[2])
		sort.Ints(a)
		fmt.Println(a[1] + ((a[2] - (a[1] - a[0])) / 2))
	}
}

package main

import (
	"fmt"
)

func main()  {
	var requests int
	fmt.Scan(&requests)
	for i:=0;i< requests;i++ {
		ledges := make([]int, 3)
		for k:=0;k<3;k++ {
			fmt.Scan(&ledges[k])
		}
		count := 0
		for _,j:= range ledges{
			count += j
		}
		fmt.Printf("%d\n", count/2)
	}

}

package main

import (
	"fmt"
)

func main()  {
	var requests int
	fmt.Scan(&requests)
	for i:=0;i< requests;i++ {
		ledges := make([]int, 3)
		for k:=0;k<3;k++ {
			fmt.Scan(&ledges[k])
		}
		count := 0
		for _,j:= range ledges{
			count += j
		}
		fmt.Println(count/2)
	}

}

package main

import "fmt"
import "sort"

func main() {
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		var arr []int = make([]int, 3)
		for i, _ := range arr {
			fmt.Scan(&arr[i])
		}
		sort.Ints(arr)
		A := arr[0]
		B := arr[1]
		C := arr[2] - (B - A)
		fmt.Println(B + C/2)
	}
}

package main
import "fmt"

func main(){
    var q int
    fmt.Scan(&q)
    for i:=0;i<q;i++ {
        var a,b,c int
        fmt.Scan(&a,&b,&c)
        fmt.Println("%d",(a+b+c)/2)
    }
}

package main
import "fmt"

func main(){
    var q int
    fmt.Scan(&q)
    for i:=0;i<q;i++ {
        var a,b,c int
        fmt.Scan(&a,&b,&c)
        fmt.Println((a+b+c)/2)
    }
}

package main

import (
	"fmt"
)

func main() {
	var q int // query
	fmt.Scan(&q)

	for i := 0; i < q; i++ {
		var a, b, c int
		fmt.Scan(&a, &b, &c)
		res := (a + b + c) / 2
		fmt.Println(res)
	}
}

package main

import (
	"fmt"
)

type Triple struct{ a, b, c int }

func main() {
	var q int // query
	fmt.Scan(&q)
	t := make([]Triple, q) // triples
	for i := 0; i < q; i++ {
		fmt.Scan(&t[i].a, &t[i].b, &t[i].c)
	}

	for i := 0; i < q; i++ {
		res := (t[i].a + t[i].b + t[i].c) / 2
		fmt.Println(res)
	}
}

package main

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

var sc = bufio.NewScanner(os.Stdin)

func ri() (n int) {
	sc.Scan()
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	q := ri() // query

	for i := 0; i < q; i++ {
		a, b, c := ri(), ri(), ri()
		res := (a + b + c) / 2
		fmt.Println(res)
	}
}

package main

import "fmt"

type Triple struct{ a, b, c int }

func main() {
	var q int // query
	fmt.Scan(&q)
	t := make([]Triple, q) // triples
	for i := 0; i < q; i++ {
		fmt.Scan(&t[i].a, &t[i].b, &t[i].c)
		res := (t[i].a + t[i].b + t[i].c) / 2
		fmt.Println(res)
	}
}

// 15000000000000000

// 2147483647
// 9223372036854775807

package main

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

func main() {

	//stdin, err := os.Open("test.txt")
	//if err != nil {
	//	panic(err)
	//}
	//defer stdin.Close()
	stdin := os.Stdin
	reader := bufio.NewReaderSize(stdin, 1024*1024)

	//stdout, err := os.Create("test.txt")
	//if err != nil {
	//	panic(err)
	//}
	//defer stdout.Close()
	stdout := os.Stdout
	writer := bufio.NewWriterSize(stdout, 1024*1024)

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

	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Fscanf(reader, "%d %d %d\n", &a, &b, &c)
		fmt.Fprintf(writer, "%d\n", (a+b+c)/2)
	}

	writer.Flush()
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	for ; n > 0; n-- {
		var a, b, c int
		fmt.Scan(&a, &b, &c)
		fmt.Println((a + b + c) / 2)
	}
}

package main

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

func solve(s string) int {
	p := strings.Split(s, " ")
	a, _ := strconv.Atoi(p[0])
	b, _ := strconv.Atoi(p[1])
	c, _ := strconv.Atoi(p[2])
	return (a + b + c) / 2
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < n; i++ {
		scanner.Scan()
		fmt.Println(solve(scanner.Text()))
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	for ; n > 0; n-- {
		var a, b, c int
		fmt.Scanf("%d %d %d\n", &a, &b, &c)
		fmt.Println((a + b + c) / 2)
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, a, b, c int
	fmt.Scan(&n)
	for ; n > 0; n-- {
		fmt.Scan(&a, &b, &c)
		fmt.Println((a + b + c) / 2)
	}
}


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--
		s, _ := reader.ReadString('\n')
		res := solve(s[:len(s)-1])
		fmt.Printf("%d\n", res)
	}
}

func solve(s string) int {
	//fmt.Fprintln(os.Stderr, s)
	// all 0, all 1,
	// half 0, half 1
	var one int
	n := len(s)
	cnt := make([]int, n)

	for i := 0; i < n; i++ {
		if s[i] != '0' && s[i] != '1' {
			n = i
			break
		}
		one += int(s[i] - '0')
		cnt[i] = one
	}

	ans := min(cnt[n-1], n-cnt[n-1])

	for i := n - 2; i >= 0; i-- {
		right := cnt[n-1] - cnt[i]
		left := cnt[i]
		// 01
		ans = min(ans, n-1-i-right+left)
		// or 10
		ans = min(ans, right+(i+1)-left)
	}

	return ans
}

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

package main

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

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++ {
		s := ""
		fmt.Fscanf(in, "%s\n", &s)
		n := len(s)
		a := make([]int, n)
		if s[0] == '0' {
			a[0] = 1
		}
		for i := 1; i < n; i++ {
			a[i] = a[i-1]
			if s[i] == '0' {
				a[i]++
			}
		}
		ans := n
		allZero := a[n-1]
		allOne := n - a[n-1]
		for i := 0; i <= n; i++ {
			// before all 0
			beforeZero := 0
			if i == 0 {
				beforeZero = 0
			} else {
				beforeZero = a[i-1]
			}
			beforeOne := i - beforeZero
			afterZero := allZero - beforeZero
			afterOne := allOne - beforeOne
			tmpAns := beforeOne + afterZero
			if tmpAns < ans {
				ans = tmpAns
			}
			tmpAns = beforeZero + afterOne
			if tmpAns < ans {
				ans = tmpAns
			}
			// before all 1
		}
		fmt.Fprintf(out, "%d\n", ans)
	}
	return
}

package main

import (
	"fmt"
	"math"
)

var (
	n     int
	input string
)

func main() {
	fmt.Scanln(&n)
	for i := 0; i < n; i++ {
		fmt.Scanln(&input)
		ans := len(input)
		one, zero := 0, 0
		for _, c := range input {
			if c == '1' {
				one++
			} else {
				zero++
			}
		}
		x0, x1 := 0, 0
		for _, c := range input {
			if c == '1' {
				x1++
			} else {
				x0++
			}
			r1 := x0 + (one - x1)
			r2 := x1 + (zero - x0)
			res := math.Min(float64(r1), float64(r2))
			ans = int(math.Min(res, float64(ans)))
		}
		fmt.Println(ans)
	}
}

/*
URL:
https://codeforces.com/problemset/problem/1363/B
*/

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
	S []rune
	n int
)

func main() {
	t = ReadInt()
	for i := 0; i < t; i++ {
		S = ReadRuneSlice()
		n = len(S)

		solve()
	}
}

func solve() {
	if n <= 2 {
		fmt.Println(0)
		return
	}

	ans := 100000
	A, B := make([]rune, n), make([]rune, n)
	for i := 0; i < n; i++ {
		A[i] = '0'
		B[i] = '1'
	}

	ChMin(&ans, diff(S, A))
	ChMin(&ans, diff(S, B))
	for i := 0; i < n; i++ {
		A[i] = '1'
		B[i] = '0'
		ChMin(&ans, diff(S, A))
		ChMin(&ans, diff(S, B))
	}
	fmt.Println(ans)
}

func diff(S, T []rune) int {
	res := 0
	for i := 0; i < n; i++ {
		if S[i] != T[i] {
			res++
		}
	}
	return res
}

// 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
}

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

/*********** 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 (
	"bufio"
	"fmt"
	"math"
	"os"
)

var nTest int
var s string

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)

	fmt.Fscan(in, &nTest)
	for t := 0; t < nTest; t++ {
		fmt.Fscan(in, &s)
		l := len(s)
		cnt0 := make([]int, l+2)
		cnt1 := make([]int, l+2)

		for i := 0; i < l; i++ {
			if s[i] == '0' {
				cnt0[i+1] = cnt0[i] + 1
				cnt1[i+1] = cnt1[i]
			} else {
				cnt1[i+1] = cnt1[i] + 1
				cnt0[i+1] = cnt0[i]
			}
		}
		cnt1[l+1] = cnt1[l]
		cnt0[l+1] = cnt0[l]

		res := math.MaxInt32
		for i := 1; i <= l; i++ {
			res01 := cnt0[i] - cnt0[0] + cnt1[l] - cnt1[i+1]
			res10 := cnt1[i] - cnt1[0] + cnt0[l] - cnt0[i+1]

			if res > res01 {
				res = res01
			}
			if res > res10 {
				res = res10
			}
		}

		fmt.Fprintln(out, res)
	}

	out.Flush()
}

package main

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

var nTest int
var s string

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)

	fmt.Fscan(in, &nTest)
	for t := 0; t < nTest; t++ {
		fmt.Fscan(in, &s)
		l := len(s)
		cnt0 := make([]int, l+1)
		cnt1 := make([]int, l+1)

		for i := 1; i <= l; i++ {
			if s[i-1] == '0' {
				cnt0[i] = cnt0[i-1] + 1
				cnt1[i] = cnt1[i-1]
			} else {
				cnt1[i] = cnt1[i-1] + 1
				cnt0[i] = cnt0[i-1]
			}
		}

		res := math.MaxInt32
		for i := 0; i < l; i++ {
			res01 := cnt0[i] + cnt1[l] - cnt1[i+1]
			res10 := cnt1[i] + cnt0[l] - cnt0[i+1]

			if res > res01 {
				res = res01
			}
			if res > res10 {
				res = res10
			}
		}

		fmt.Fprintln(out, res)
	}

	out.Flush()
}

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1363B(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	min := func(a, b int) int {
		if a < b {
			return a
		}
		return b
	}

	var t int
	var S []byte
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &S)
		n := len(S)
		s := make([][2]int, n+1)
		for i, b := range S {
			s[i+1] = s[i]
			s[i+1][b-'0']++
		}
		ans := n
		for _, p := range s {
			ans = min(ans, min(p[1]+s[n][0]-p[0], p[0]+s[n][1]-p[1]))
		}
		Fprintln(out, ans)
	}
}

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

package main

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

func min(vars ...int) int {
	res := vars[0]
	for _, value := range vars {
		if value < res {
			res = value
		}
	}
	return res
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	scan := func(x ...interface{}) (n int, err error) {
		return fmt.Fscan(in, x...)
	}
	println := func(x ...interface{}) (n int, err error) {
		return fmt.Fprintln(out, x...)
	}

	var t int
	for scan(&t); t > 0; t-- {
		var s string
		scan(&s)
		prefSums := make([]int, len(s))
		for i := 0; i < len(s); i++ {
			if i > 0 {
				prefSums[i] = prefSums[i-1]
			}
			prefSums[i] += int(s[i] - '0')
		}
		ans := len(s)
		wholeSum := prefSums[len(prefSums)-1]
		for i, prefSum := range prefSums {
			sufSum := wholeSum - prefSum
			prefLen, sufLen := i+1, len(prefSums)-i-1
			cost := min(
				prefSum+sufSum,
				prefSum+(sufLen-sufSum),
				(prefLen-prefSum)+sufSum,
				(prefLen-prefSum)+(sufLen-sufSum))
			if cost < ans {
				ans = cost
			}
		}
		println(ans)
	}
}

package main

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

func min(a ...int) int {
	ret := a[0]
	for i := 1; i < len(a); i++ {
		if ret > a[i] {
			ret = a[i]
		}
	}
	return ret
}

func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()
	var t int
	fmt.Fscan(r, &t)
	for ; t > 0; t-- {
		var s string
		fmt.Fscan(r, &s)
		ans := len(s)
		for i := 0; i < len(s); i++ {
			var l0, l1, r0, r1 int
			for j := 0; j < i; j++ {
				if s[j] == '0' {
					l1++
				} else {
					l0++
				}
			}
			for j := i; j < len(s); j++ {
				if s[j] == '0' {
					r1++
				} else {
					r0++
				}
			}
			ans = min(ans, l0+r0, l0+r1, l1+r0, l1+r1)
		}
		fmt.Fprintln(w, ans)
	}
}

package main

import (
	"fmt"
)

func main() {
	var tt int
	fmt.Scanln(&tt)
	for t := 0; t < tt; t++ {
		var s string
		fmt.Scanln(&s)
		n := len(s)
		var count1, count0 int = 0, 0
		one := make([]int, n)
		zero := make([]int, n)
		for i := 0; i < n; i++ {
			if s[i] == '1' {
				count1++
			} else {
				count0++
			}
			one[i] = count1
			zero[i] = count0
		}

		var ans int = 1005
		for i := 0; i < n; i++ {
			var c1, c2 int
			c1 = one[i] + (count0 - zero[i])
			c2 = (count1 - one[i]) + zero[i]

			if ans > c1 {
				ans = c1
			}
			if ans > c2 {
				ans = c2
			}
		}
		fmt.Println(ans)
	}
}

package main

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

func readline(r *bufio.Reader) string {
	l, _, err := r.ReadLine()
	if err != nil {
		panic(err)
	}
	return string(l)
}

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

	r := bufio.NewReader(os.Stdin)
	for i := 0; i < t; i++ {
		s := readline(r)
		n := len(s)

		ks := make([]int, n+1)
		ls := make([]int, n+1)

		var k, l int
		for i := 1; i <= n; i++ {
			ks[i] = ks[i-1]
			ls[i] = ls[i-1]

			isZero := s[i-1] == '0'
			if isZero {
				ks[i]++
				k++
			} else {
				ls[i]++
				l++
			}
		}

		ans := math.MaxInt32
		for i := 0; i <= n; i++ {
			c := ls[i] + (k - ks[i])
			if c < ans {
				ans = c
			}

			c = ks[i] + (l - ls[i])
			if c < ans {
				ans = c
			}
		}
		fmt.Printf("%d\n", ans)
	}
}

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--
		s, _ := reader.ReadString('\n')
		fmt.Println(solve(s[:len(s)-1]))
	}
}

func solve(s string) int {
	fmt.Fprintln(os.Stderr, s)
	// all 0, all 1,
	// half 0, half 1
	var one int
	n := len(s)
	cnt := make([]int, n)

	for i := 0; i < n; i++ {
		one += int(s[i] - '0')
		cnt[i] = one
	}

	ans := min(cnt[n-1], n-cnt[n-1])

	for i := n - 2; i >= 0; i-- {
		right := cnt[n-1] - cnt[i]
		left := cnt[i]
		// 01
		ans = min(ans, n-1-i-right+left)
		// or 10
		ans = min(ans, right+(i+1)-left)
	}

	return ans
}

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

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--
		s, _ := reader.ReadString('\n')
		res := solve(s[:len(s)-1])
		fmt.Printf("%d\n", res)
	}
}

func solve(s string) int {
	//fmt.Fprintln(os.Stderr, s)
	// all 0, all 1,
	// half 0, half 1
	var one int
	n := len(s)
	cnt := make([]int, n)

	for i := 0; i < n; i++ {
		one += int(s[i] - '0')
		cnt[i] = one
	}

	ans := min(cnt[n-1], n-cnt[n-1])

	for i := n - 2; i >= 0; i-- {
		right := cnt[n-1] - cnt[i]
		left := cnt[i]
		// 01
		ans = min(ans, n-1-i-right+left)
		// or 10
		ans = min(ans, right+(i+1)-left)
	}

	return ans
}

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

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--
		s, _ := reader.ReadString('\n')
		fmt.Println(solve(s[:len(s)-1]))
	}
}

func solve(s string) int {
	// all 0, all 1,
	// half 0, half 1
	var one int
	n := len(s)
	cnt := make([]int, n)

	for i := 0; i < n; i++ {
		one += int(s[i] - '0')
		cnt[i] = one
	}

	ans := min(cnt[n-1], n-cnt[n-1])

	for i := n - 2; i >= 0; i-- {
		right := cnt[n-1] - cnt[i]
		left := cnt[i]
		// 01
		ans = min(ans, n-1-i-right+left)
		// or 10
		ans = min(ans, right+(i+1)-left)
	}

	return ans
}

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

package main

import (
	"fmt"
	"math"
	"strings"
)

var (
	n     int
	input string
)

func main() {
	fmt.Scanln(&n)
	for i := 0; i < n; i++ {
		fmt.Scanln(&input)
		ans := 0
		//01
		tmp := strings.TrimLeft(input, "0")
		tmp = strings.TrimRight(tmp, "1")
		a, b := 0, 0
		for _, c := range tmp {
			if c == '0' {
				a++
			} else {
				b++
			}
		}
		ans = int(math.Min(float64(a), float64(b)))
		//10
		tmp = strings.TrimLeft(input, "1")
		tmp = strings.TrimRight(tmp, "0")
		a, b = 0, 0
		for _, c := range tmp {
			if c == '0' {
				a++
			} else {
				b++
			}
		}
		res := int(math.Min(float64(a), float64(b)))
		ans = int(math.Min(float64(res), float64(ans)))
		fmt.Println(ans)
	}
}

package main

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

func min(vars ...int) int {
	res := vars[0]
	for _, value := range vars {
		if value < res {
			res = value
		}
	}
	return res
}

func main() {
	in := bufio.NewReader(os.Stdin)
	scan := func(x ...interface{}) (n int, err error) {
		return fmt.Fscan(in, x...)
	}

	var t int
	for scan(&t); t > 0; t-- {
		var s string
		scan(&s)
		prefSums := make([]int, len(s))
		for i := 0; i < len(s); i++ {
			if i > 0 {
				prefSums[i] = prefSums[i-1]
			}
			prefSums[i] += int(s[i] - '0')
		}
		ans := len(s)
		wholeSum := prefSums[len(prefSums)-1]
		for i, prefSum := range prefSums {
			sufSum := wholeSum - prefSum
			prefLen, sufLen := i+1, len(prefSums)-i-1
			cost := min(
				prefSum+sufSum,
				prefSum+(sufLen-sufSum),
				(prefLen-prefSum)+sufSum,
				(prefLen-prefSum)+(sufLen-sufSum))
			if cost < ans {
				ans = cost
			}
		}
		println(ans)
	}
}