package main

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

var _, _, _ = main, rw, do

func main() {
	r, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer w.Flush()
	rw(r, w)
}

func rw(r io.Reader, w io.Writer) {
	var t int = 1
	// fmt.Fscan(r, &t)
	for ti := 0; ti < t; ti++ {
		var n, k int
		fmt.Fscan(r, &n, &k)
		w1 := do(n, k)
		for _, v := range w1 {
			fmt.Fprint(w, v, " ")
		}
		// fmt.Fprintln(w)
	}
}

const mod = 998244353

func do(n, k int) []int {
	r := make([]int, n+1)
	d := make([]int, n+1)
	d[0] = 1
	for x := k; x <= n; x += k {
		s := make([]int, k)
		for i := 0; i <= n; i++ {
			d[i], s[i%k] = s[i%k], (s[i%k]+d[i])%mod
			r[i] = (r[i] + d[i]) % mod
		}
		k++
	}
	return r[1:]
}

package main

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

var rr = bufio.NewReader(os.Stdin)
var ww = bufio.NewWriter(os.Stdout)

func main() {
	defer ww.Flush()
	var n, k int
	fmt.Fscan(rr, &n, &k)
	const mod = 998244353
	dp0, dp1 := make([]int, n+1), make([]int, n+1)
	dp0[k] = 1
	ans := make([]int, n)
	for j:=0;j<=640;j++ {
		for i:=1;i<=n;i++ {
			if i+j+k <= n {
				dp0[i+j+k] += dp0[i]
				dp0[i+j+k] %= mod
			}
			if i+j+k+1 <= n {
				dp1[i+j+k+1] += dp0[i]
				dp1[i+j+k+1] %= mod
			}
			ans[i-1] += dp0[i]
			ans[i-1] %= mod
		}
		dp0 = dp1
		dp1 = make([]int, n+1)
	}
	for i:=0;i<len(ans);i++ {
		fmt.Fprintf(ww, "%d ", ans[i])
	}
	fmt.Fprintln(ww)
}

package main

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

func CF1716D(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var n, k int
	Fscan(in, &n, &k)
	res := make([]int, n+1)
	dp := make([]int, n+1)
	dp1 := make([]int, n+1)
	dp[0] = 1
	st := 0
	for st+k <= n {
		for i := 0; i < k; i++ {
			idx := st + i
			cur := dp[idx]
			idx += k
			for idx <= n {
				dp1[idx] = cur
				res[idx] = (res[idx] + cur) % 998244353
				cur = (dp[idx] + cur) % 998244353
				idx += k
			}
		}
		dp, dp1 = dp1, dp
		st += k
		k += 1
	}
	for idx, i := range res[1:] {
		Fprint(out, i)
		if idx < len(res)-1 {
			Fprint(out, " ")
		}
	}

}

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

package main

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

func CF1716D(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var n, k int
	Fscan(in, &n, &k)
	res := make([]int, n+1)
	dp := make([]int, n+1)
	dp[0] = 1
	st := 0
	for st+k <= n {
		dp1 := make([]int, n+1)
		for i := 0; i < k; i++ {
			idx := st + i
			cur := dp[idx]
			idx += k
			for idx <= n {
				dp1[idx] = cur
				res[idx] = (res[idx] + cur) % 998244353
				cur = (dp[idx] + cur) % 998244353
				idx += k
			}
		}
		dp = dp1
		st += k
		k += 1
	}
	for idx, i := range res[1:] {
		Fprint(out, i)
		if idx < len(res)-1 {
			Fprint(out, " ")
		}
	}

}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1716D(in io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mod = 998244353

	var n, k int
	Fscan(in, &n, &k)
	ans := make([]int, n+1)
	f := make([]int, n+1)
	f[0] = 1
	for i, s := k, 0; s+i <= n; i++ {
		s += i
		g := make([]int, n+1)
		for j := i; j <= n; j++ {
			g[j] = (g[j-i] + f[j-i]) % mod
			ans[j] = (ans[j] + g[j]) % mod
		}
		f = g
	}
	for _, v := range ans[1:] {
		Fprint(out, v, " ")
	}
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1716D(in io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mod = 998244353

	var n, k int
	Fscan(in, &n, &k)
	ans := make([]int, n+1)
	f := make([]int, n+1)
	f[0] = 1
	for i, s := k, 0; s+i <= n; i++ {
		s += i
		g := make([]int, n+1)
		for j := i; j <= n; j++ {
			g[j] = (g[j-i] + f[j-i]) % mod
		}
		for j, v := range g {
			ans[j] = (ans[j] + v) % mod
		}
		f = g
	}
	for _, v := range ans[1:] {
		Fprint(out, v, " ")
	}
}

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

package main

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

func CF1716D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	var n, k int
	Fscan(in, &n, &k)
	res := make([]int, n+1)
	dp := make([]int, n+1)
	dp1 := make([]int, n+1)
	dp[0] = 1
	st := 0
	for st+k <= n {
		for i := 0; i < k; i++ {
			idx := st + i
			cur := dp[idx]
			idx += k
			for idx <= n {
				dp1[idx] = cur
				res[idx] = (res[idx] + cur) % 998244353
				cur = (dp[idx] + cur) % 998244353
				idx += k
			}
		}
		dp, dp1 = dp1, dp
		st += k
		k += 1
	}
	for idx, i := range res[1:] {
		Fprint(out, i)
		if idx < len(res)-1 {
			Fprint(out, " ")
		}
	}

}

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

package main

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

var rr = bufio.NewReader(os.Stdin)
var ww = bufio.NewWriter(os.Stdout)

func main() {
	defer ww.Flush()
	var n, k int
	fmt.Fscan(rr, &n, &k)
	dp := make([][]int, n+1)
	const mod = 998244353
	for i := range dp {
		dp[i] = make([]int, 200)
	}
	for i:=k;i<n+1;i+=k {
		dp[i][0] = 1
	}
	ans := make([]int, n)
	for i:=1;i<=n;i++ {
		ans[i-1] += dp[i][0]
		for j:=1;j<200&&j<=i-k;j++ {
			dp[i][j] = dp[i-j-k][j] + dp[i-j-k][j-1]
			dp[i][j] %= mod
			ans[i-1] += dp[i][j]
			ans[i-1] %= mod
		}
	}
	for i:=0;i<len(ans);i++ {
		fmt.Fprintf(ww, "%d ", ans[i])
	}
	fmt.Fprintln(ww)
}

package main

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

func CF1716D(_r io.Reader, out io.Writer) {
	in := bufio.NewReader(_r)
	var n, k int
	Fscan(in, &n, &k)
	res := make([]int64, n+1)
	dp := make([]int64, n+1)
	dp[0] = int64(1)
	st := 0
	for st+k <= n {
		dp1 := make([]int64, n+1)
		for i := 0; i < k; i++ {
			idx := st + i
			cur := dp[idx]
			idx += k
			for idx <= n {
				dp1[idx] = cur
				res[idx] = (res[idx] + cur) % 998244353
				cur += dp[idx]
				idx += k
			}
		}
		dp = dp1
		st += k
		k += 1
	}
	for idx, i := range res[1:] {
		Fprint(out, i)
		if idx < len(res)-1 {
			Fprint(out, " ")
		}
	}

}

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

package main

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

var _, _, _ = main, rw, do

func main() {
	r, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer w.Flush()
	rw(r, w)
}

func rw(r io.Reader, w io.Writer) {
	var t int = 1
	// fmt.Fscan(r, &t)
	for ti := 0; ti < t; ti++ {
		var n, k int
		fmt.Fscan(r, &n, &k)
		w1 := do(n, k)
		for _, v := range w1 {
			fmt.Fprint(w, v, " ")
		}
		// fmt.Fprintln(w)
	}
}

func do(n, k int) []int {
	r := make([]int, n+1)
	d := make([]int, n+1)
	d[0] = 1
	for x := k; x <= n; x += k {
		s := make([]int, k)
		for i := 0; i <= n; i++ {
			d[i], s[i%k] = s[i%k], s[i%k]+d[i]
			r[i] += d[i]
		}
		k++
	}
	return r[1:]
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)
var wrtr = bufio.NewWriterSize(os.Stdout, 10_000_000)
var rdr = bufio.NewScanner(os.Stdin)
func gs() string  { rdr.Scan(); return rdr.Text() }
func gi() int     { i,e := strconv.Atoi(gs()); if e != nil {panic(e)}; return i }
func gis(n int) []int  { res := make([]int,n); for i:=0;i<n;i++ { res[i] = gi() }; return res }
func gf() float64 { f,e := strconv.ParseFloat(gs(),64); if e != nil {panic(e)}; return f }
func gbs() []byte { return []byte(gs()) }
func gfs(n int) []float64  { res := make([]float64,n); for i:=0;i<n;i++ { res[i] = gf() }; return res }
func gss(n int) []string  { res := make([]string,n); for i:=0;i<n;i++ { res[i] = gs() }; return res }
func gi64() int64     { i,e := strconv.ParseInt(gs(),10,64); if e != nil {panic(e)}; return i }
func gis64(n int) []int64  { res := make([]int64,n); for i:=0;i<n;i++ { res[i] = gi64() }; return res }

func ia(m int) []int { return make([]int,m) }
func iai(m int,v int) []int { a := make([]int,m); for i:=0;i<m;i++ { a[i] = v }; return a }
func twodi(n int,m int,v int) [][]int {
	r := make([][]int,n); for i:=0;i<n;i++ { x := make([]int,m); for j:=0;j<m;j++ { x[j] = v }; r[i] = x }; return r
}
func fill2(m int) ([]int,[]int) { a,b := ia(m),ia(m); for i:=0;i<m;i++ {a[i],b[i] = gi(),gi()}; return a,b }
func fill3(m int) ([]int,[]int,[]int) { a,b,c := ia(m),ia(m),ia(m); for i:=0;i<m;i++ {a[i],b[i],c[i] = gi(),gi(),gi()}; return a,b,c }
func fill4(m int) ([]int,[]int,[]int,[]int) { a,b,c,d := ia(m),ia(m),ia(m),ia(m); for i:=0;i<m;i++ {a[i],b[i],c[i],d[i] = gi(),gi(),gi(),gi()}; return a,b,c,d }
func abs(a int) int { if a < 0 { return -a }; return a }
func rev(a []int) { i,j := 0,len(a)-1; for i < j { a[i],a[j] = a[j],a[i]; i++; j-- } }
func max(a,b int) int { if a > b { return a }; return b }
func min(a,b int) int { if a > b { return b }; return a }
func maxarr(a []int) int { ans := a[0]; for _,aa := range(a) { if aa > ans { ans = aa } }; return ans }
func minarr(a []int) int { ans := a[0]; for _,aa := range(a) { if aa < ans { ans = aa } }; return ans }
func sumarr(a []int) int { ans := 0; for _,aa := range(a) { ans += aa }; return ans }
func zeroarr(a []int) { for i:=0; i<len(a); i++ { a[i] = 0 } }
func powmod(a,e,mod int) int { res, m := 1, a; for e > 0 { if e&1 != 0 { res = res * m % mod }; m = m * m % mod; e >>= 1 }; return res }
func powint(a,e int) int { res, m := 1, a; for e > 0 { if e&1 != 0 { res = res * m }; m = m * m; e >>= 1 }; return res }
func gcd(a,b int) int { for b != 0 { t:=b; b=a%b; a=t }; return a }
func gcdExtended(a,b int) (int,int,int) { if a == 0 { return b,0,1 }; gcd,x1,y1 := gcdExtended(b%a,a); return gcd, y1-(b/a)*x1,x1 }
func modinv(a,m int) (int,bool) { g,x,_ := gcdExtended(a,m); if g != 1 { return 0,false }; return (x % m + m) % m,true  }
func vecintstring(a []int) string { astr := make([]string,len(a)); for i,a := range a { astr[i] = strconv.Itoa(a) }; return strings.Join(astr," ") }
func makefact(n int,mod int) ([]int,[]int) {
	fact,factinv := make([]int,n+1),make([]int,n+1)
	fact[0] = 1; for i:=1;i<=n;i++ { fact[i] = fact[i-1] * i % mod }
	factinv[n] = powmod(fact[n],mod-2,mod); for i:=n-1;i>=0;i-- { factinv[i] = factinv[i+1] * (i+1) % mod }
	return fact,factinv
}

func ia64(m int) []int64 { return make([]int64,m) }
func iai64(m int,v int64) []int64 { a := make([]int64,m); for i:=0;i<m;i++ { a[i] = v }; return a }
func twodi64(n int,m int,v int64) [][]int64 {
	r := make([][]int64,n); for i:=0;i<n;i++ { x := make([]int64,m); for j:=0;j<m;j++ { x[j] = v }; r[i] = x }; return r
}
func fill264(m int) ([]int64,[]int64) { a,b := ia64(m),ia64(m); for i:=0;i<m;i++ {a[i],b[i] = gi64(),gi64()}; return a,b }
func fill364(m int) ([]int64,[]int64,[]int64) { a,b,c := ia64(m),ia64(m),ia64(m); for i:=0;i<m;i++ {a[i],b[i],c[i] = gi64(),gi64(),gi64()}; return a,b,c }
func fill464(m int) ([]int64,[]int64,[]int64,[]int64) { a,b,c,d := ia64(m),ia64(m),ia64(m),ia64(m); for i:=0;i<m;i++ {a[i],b[i],c[i],d[i] = gi64(),gi64(),gi64(),gi64()}; return a,b,c,d }
func abs64(a int64) int64 { if a < 0 { return -a }; return a }
func rev64(a []int64) { i,j := 0,len(a)-1; for i < j { a[i],a[j] = a[j],a[i]; i++; j-- } }
func max64(a,b int64) int64 { if a > b { return a }; return b }
func min64(a,b int64) int64 { if a > b { return b }; return a }
func maxarr64(a []int64) int64 { ans := a[0]; for _,aa := range(a) { if aa > ans { ans = aa } }; return ans }
func minarr64(a []int64) int64 { ans := a[0]; for _,aa := range(a) { if aa < ans { ans = aa } }; return ans }
func sumarr64(a []int64) int64 { ans := int64(0); for _,aa := range(a) { ans += aa }; return ans }
func zeroarr64(a []int64) { for i:=0; i<len(a); i++ { a[i] = 0 } }
func powmod64(a,e,mod int64) int64 { res, m := int64(1), a; for e > 0 { if e&1 != 0 { res = res * m % mod }; m = m * m % mod; e >>= 1 }; return res }
func powint64(a,e int64) int64 { res, m := int64(1), a; for e > 0 { if e&1 != 0 { res = res * m }; m = m * m; e >>= 1 }; return res }
func gcd64(a,b int64) int64 { for b != 0 { t:=b; b=a%b; a=t }; return a }
func gcdExtended64(a,b int64) (int64,int64,int64) { if a == 0 { return b,0,1 }; gcd,x1,y1 := gcdExtended64(b%a,a); return gcd, y1-(b/a)*x1,x1 }
func modinv64(a,m int64) (int64,bool) { g,x,_ := gcdExtended64(a,m); if g != 1 { return 0,false }; return (x % m + m) % m,true  }
func vecint64string(a []int64) string { astr := make([]string,len(a)); for i,a := range a { astr[i] = strconv.FormatInt(a,10) }; return strings.Join(astr," ") }
func makefact64(n int,mod int64) ([]int64,[]int64) {
	fact,factinv := make([]int64,n+1),make([]int64,n+1)
	fact[0] = 1; for i:=1;i<=n;i++ { fact[i] = fact[i-1] * int64(i) % mod }
	factinv[n] = powmod64(fact[n],mod-2,mod); for i:=n-1;i>=0;i-- { factinv[i] = factinv[i+1] * int64(i+1) % mod }
	return fact,factinv
}
func main() {
	//f1, _ := os.Create("cpu.prof"); pprof.StartCPUProfile(f1); defer pprof.StopCPUProfile()
	defer wrtr.Flush()
	infn := ""; if infn == "" && len(os.Args) > 1 {	infn = os.Args[1] }
	if infn != "" {	f, e := os.Open(infn); if e != nil { panic(e) }; rdr = bufio.NewScanner(f) }
	rdr.Split(bufio.ScanWords); rdr.Buffer(make([]byte,1024),1_000_000_000)
	// PROGRAM STARTS HERE
	T := gi()
	for tt:=1;tt<=T;tt++ {
		N := gi()
		if N % 2 == 1 { fmt.Fprintln(wrtr,-1) } else { fmt.Fprintf(wrtr,"%v %v %v\n",0,0,N/2) }
	}
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
	t, n   int
)

func solve(n int) string {
	if n%2 == 1 {
		return "-1"
	}
	return fmt.Sprintf("%d %d %d", 0, 0, n/2)
}

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

package main

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

type CF1699A struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1699A) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1699A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1699A) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1699A) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1699A) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1699A
Date: 10/07/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1699/A
Problem: CF1699A
**/
func (in *CF1699A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt64()
		if n%2 == 0 {
			fmt.Println( n/2, n/2, 0)
		} else {
			fmt.Println(-1)
		}

	}
}

func NewCF1699A(r *bufio.Reader) *CF1699A {
	return &CF1699A{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1699A(bufio.NewReader(os.Stdin)).Run()
}

package main

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

func Solve(testCaseIndex int, reader io.Reader) {
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var n int
	fmt.Fscanln(reader, &n)
	if n % 2 == 1 {
		fmt.Fprintln(writer, "-1")
	} else {
		fmt.Fprintf(writer, "0 %d %d\n", n / 2, n / 2)
	}
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	var testCaseCount int
	fmt.Fscanln(reader, &testCaseCount)
	for t := 0; t < testCaseCount; t++ {
		Solve(t, reader)
	}
}

package main

import "fmt"

func main() {
	var test int
	fmt.Scanln(&test)

	for test > 0 {
		test--
		var n int
		fmt.Scanln(&n)
		if n%2 == 0 {
			fmt.Println(n/2, 0, 0)
		} else {
			fmt.Println(-1)
		}
	}
}

package main

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

var r = bufio.NewReader(os.Stdin)
var w = bufio.NewWriter(os.Stdout)

func tc() {
	var n int
	fmt.Fscan(r, &n)
	if n%2 == 1 {
		fmt.Fprintln(w, -1)
	} else {
		fmt.Fprintln(w, 0, 0, n/2)
	}

}

func main() {
	defer w.Flush()
	var t int
	fmt.Fscan(r, &t)
	for i := 0; i < t; i++ {
		tc()
	}
}

package main

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

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

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

	var T int
	var x int

	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &x)

		if x&1 == 1 {
			Fprintln(out, -1)

		} else {
			Fprintln(out, 0, 0^(x/2), 0^(x/2))
		}
	}
}

package main

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

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

	var n int
	var arr []uint32

	_, err := fmt.Fscan(in, &n)
	if err != nil {
		os.Exit(2)
	}

	for i := 0; i < n; i++ {
		var tmp uint32 = 0
		if _, err = fmt.Fscan(in, &tmp); err != nil {
			os.Exit(2)
		}
		arr = append(arr, tmp)
	}

	for _, el := range arr {
		ok, a, b, c := FindABC(el)
		if !ok {
			fmt.Fprintln(out, -1)
		} else {
			fmt.Fprintln(out, a, b, c)
		}
	}

	out.Flush()
}

func FindABC(n uint32) (ok bool, a, b, c uint32) {
	if n%2 == 1 {
		return
	}

	n /= 2

	var i uint32 = 1
	for ; i <= n; i <<= 1 {
		if n&i != 0 {
			a |= i
		} else {
			a |= i
			b |= i
		}
	}

	ok = true
	c = a
	return
}

// 1328A. Divisibility Problem
package main

import (
	"fmt"
)

func main() {
	var t, n int
	fmt.Scan(&t)
	for i := 1; i <= t; i++ {
		fmt.Scan(&n)
		if n%2 == 0 {
			fmt.Println(n/2, n/2, 0)
		} else {
			fmt.Println(-1)
		}

	}

}

package main

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

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

func main() {
	defer out.Flush()

	var tc int
	for fmt.Fscan(in, &tc); tc > 0; tc-- {
		var n int
		fmt.Fscan(in, &n)
		if n%2 == 1 {
			fmt.Fprintln(out, -1)
			continue
		}
		var a, b int
		n /= 2
		for p := 1; n > 0; n, p = n/2, p*2 {
			if n%2 == 1 {
				a, b = a+p, b+p
			}
		}
		fmt.Fprintln(out, a, b, 0)
	}
}

package main

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

var r = bufio.NewReader(os.Stdin)
var w = bufio.NewWriter(os.Stdout)

func solve() {
	var n int
	fmt.Fscan(r, &n)
	if n%2 == 1 {
		fmt.Fprintln(w, -1)
	} else {
		fmt.Fprintln(w, 0, 0, n/2)
	}

}
func main() {
	defer w.Flush()
	var t int
	fmt.Fscan(r, &t)
	for ; t > 0; t-- {
		solve()
	}
}

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 n int
		fmt.Fscan(in, &n)

		if n%2 != 0 {
			fmt.Fprintln(out, -1)
		} else {
			n /= 2
			fmt.Fprintln(out, n, n, 0)
		}
	}
}

package main

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

var rr = bufio.NewReader(os.Stdin)
var ww = bufio.NewWriter(os.Stdout)

func slove() {
	var n int
	fmt.Fscan(rr, &n)
	if n % 2 == 1 {
		fmt.Fprintln(ww, -1)
	} else {
		fmt.Fprintln(ww, n/2, n/2, 0)
	}
}

func main() {
	defer ww.Flush()
	var n int
	fmt.Fscan(rr, &n)
	for i:=1;i<=n;i++ {
		slove()
	}
}

package main

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

func A1() {
	_in, _out := os.Stdin, os.Stdout
	in, out := bufio.NewReader(_in), bufio.NewWriter(_out)
	defer out.Flush()
	var cas int = 1
	Fscan(in, &cas)
	var sol func()
	// Coding...beg!
	sol = func() {
		var n int
		Fscan(in, &n)
		if n%2 == 0 {
			Fprintln(out, 0, 0, n/2)
		} else {
			Fprintln(out, -1)
		}
	}
	// Coding...ove!
	for i := 0; i < cas; i++ {
		sol()
	}
}
func main() { A1() }

package main
import "fmt"

func main() {
    var testCase int
    fmt.Scanf("%d ", &testCase)
    for testCase>0 {
        var n int

        fmt.Scanf("%d ", &n)
        if (n%2 == 0) {
            fmt.Printf("0 0 %d\n", n/2)
        } else {
            fmt.Println("-1")
        }

        testCase--;
    }
}

package main

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

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

	solve := func(Case int) {
		var n int
		Fscan(in, &n)
		if n%2==1{
			Fprintln(out,-1)
		}else{
			Fprintln(out,"0 0 ",n/2)
		}
	}

	T := 1
	Fscan(in, &T) //
	for Case := 1; Case <= T; Case++ {
		solve(Case)
	}

}

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

package main

import "fmt"

func main() {
	var t int
	fmt.Scanln(&t)
	for ; t>0; t-- {
		var n int
		fmt.Scanln(&n)
		if n%2==1 {
			fmt.Println("-1")
		}else {
			fmt.Println("0 0 ",n/2)
		}
	}
}

package main
import(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Fscan(in,&n)
		if n%2 == 0 {
			fmt.Fprintln(out,n/2,0,0)
		} else {
			fmt.Fprintln(out,-1)
		}
	}
}

package main

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

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

func main() {
	defer out.Flush()
	var t, n int
	for fmt.Fscan(in, &t); t > 0; t-- {
		fmt.Fscan(in, &n)
		if n%2 == 0 {
			fmt.Fprintln(out, "0 0", n/2)
		} else {
			fmt.Fprintln(out, -1)
		}
	}
}

package main
import "fmt"

func main() {
    var testCase int
    fmt.Scanln("%d", &testCase)
    for testCase>0 {
        var n int

        fmt.Scanln("%d", &n)
        if (n%2 == 0) {
            fmt.Printf("0 0 %d\n", n/2)
        } else {
            fmt.Println("-1")
        }

        testCase--;
    }
}

package main
import "fmt"

func main() {
    var testCase int
    fmt.Scanf("%d", &testCase)
    for testCase>0 {
        var n int

        fmt.Scanf("%d", &n)
        if (n%2 == 0) {
            fmt.Printf("0 0 %d\n", n/2)
        } else {
            fmt.Println("-1")
        }

        testCase--;
    }
}

package main
import "fmt"

func main() {
    var testCase int
    fmt.Scanf("%d", &testCase)
    for testCase>0 {
        var n int

        fmt.Scanf("%d", &n)
        if (n%2 == 0) {
            fmt.Println("0 0", n/2)
        } else {
            fmt.Println("-1")
        }

        testCase--;
    }
}


package main

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

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

func main() {
	defer out.Flush()

	var test int
	fmt.Fscan(in, &test)
	for i := 0; i < test; i++ {
		fmt.Fprintln(out, solve())
	}
}

func solve() int64 {
	var l, r int64
	fmt.Fscan(in, &l, &r)
	if l == r {
		x := int64(math.Sqrt(float64(l)))
		if x*x > l {
			x--
		}
		if l%x == 0 {
			return 1
		}
		return 0
	}

	lo := int64(math.Sqrt(float64(l)))
	hi := int64(math.Sqrt(float64(r)))

	if lo*lo > l {
		lo--
	}
	if hi*hi > r {
		hi--
	}
	hi++

	// fmt.Println(lo, hi)

	if hi-lo == 1 {
		res := int64(0)
		for i := lo * lo; i <= hi*hi; i += lo {
			if i >= l && i <= r {
				res++
			}
		}
		return res
	}
	res := (hi - lo - 2) * 3
	mid := lo + 1
	for i := lo * lo; i < mid*mid; i += lo {
		if i >= l && i <= r {
			res++
		}
	}
	mid = hi - 1
	for i := mid * mid; i <= hi*hi; i += mid {
		if i >= l && i <= r {
			res++
		}
	}
	return res
}

package main

import (
	"fmt"
)

func main() {
	var T int
	fmt.Scan(&T)
	for tt:=0; tt<T; tt++ {
		var l, r uint64
		fmt.Scan(&l, &r)

		cnt := func (x uint64) uint64 {
			var res uint64 = 0
			if x == 0 {
				return res
			}
			low, high, sq := uint64(1), uint64(2e9), uint64(0)
			for low <= high {
				mid := low + (high - low) / 2
				if mid * mid <= x {
					sq = mid
					low = mid + 1
					continue
				}
				high = mid - 1
			}

			res = (sq - 1) * 3
			cur := sq * sq
			for cur <= x {
				res++
				cur += sq
			}
			return res
		}
		res := cnt(r) - cnt(l-1)
		fmt.Println(res)
	}
}

package main

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

const cf = true

func solve() {
	var l, r uint64
	fmt.Fscan(in, &l, &r)
	start, end := sqrt(l), sqrt(r)
	ans := (end - start) + (end-start-1)*2
	for i := l; i < (start+1)*(start+1); i = (i + start) - i%start {
		if i%start == 0 {
			ans++
		}
	}
	for i := end*end + 1; i <= r; i = (i + end) - i%end {
		if i%end == 0 {
			ans++
		}
	}
	fmt.Fprintln(out, ans)
}

func main() {
	defer out.Flush()
	t := 1
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		solve()
	}
}

type SqrtInt interface {
	SignedSqrt | UnsignedSqrt
}

type SignedSqrt interface {
	~int | ~int32 | ~int64
}

type UnsignedSqrt interface {
	~uint | ~uint32 | ~uint64 | ~uintptr
}

func sqrt[T SqrtInt](x T) T {
	l, r := T(0), T(2000000123)
	for l < r {
		mid := (l + r) / 2
		if mid*mid > x {
			r = mid
		} else {
			l = mid + 1
		}
	}
	return l - 1
}

func ConvertInt(val string, base, toBase int) (string, error) {
	i, err := strconv.ParseInt(val, base, 64)
	if err != nil {
		return "", err
	}
	return strconv.FormatInt(i, toBase), nil
}

type set[T Ordered] struct {
	itms map[T]struct{}
}

func (s *set[T]) init() {
	if s.itms == nil {
		s.itms = make(map[T]struct{})
	}
}

func (s *set[T]) add(item T) *set[T] {
	s.init()
	s.itms[item] = exists
	return s
}

func (s *set[T]) remove(item T) *set[T] {
	s.init()
	delete(s.itms, item)
	return s
}

func (s *set[T]) has(item T) bool {
	s.init()
	_, c := s.itms[item]
	return c
}

func (s *set[T]) sortedItems() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	sort.Slice(items, func(i, j int) bool {
		return items[i] < items[j]
	})
	return items
}

func (s *set[T]) items() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	return items
}

func (s *set[T]) size() int {
	s.init()
	return len(s.itms)
}

var exists = struct{}{}

const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1

func reverseStr(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

type Ordered interface {
	Integer | Float | ~string
}

func abs[T Signed](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func min[T Ordered](x, y T) T {
	if x < y {
		return x
	}
	return y
}

func max[T Ordered](x, y T) T {
	if x > y {
		return x
	}
	return y
}

var (
	in  = getReader()
	out = getWriter()
)

func getReader() *bufio.Reader {
	if cf {
		return bufio.NewReader(os.Stdin)
	} else {
		in, _ := os.Open("input.txt")
		return bufio.NewReader(in)
	}
}

func getWriter() *bufio.Writer {
	if cf {
		return bufio.NewWriter(os.Stdout)
	} else {
		out, _ := os.Create("output.txt")
		return bufio.NewWriter(out)
	}
}

package main

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

func get_sqrt(l, r, s int) int {
	if r-l <= 1 { return l }
	m := (l + r)/2
	if m > 1e9 || m*m > s { return get_sqrt(l, m, s) }
	return get_sqrt(m, r, s)
}

func get_cnt(l, r, x int) int {
	cnt := 0
	if x*x >= l && x*x <= r { cnt++ }
	if x*x+x >= l && x*x+x <= r { cnt++ }
	if x*x + 2*x >=l && x*x + 2*x <=r { cnt++ }
	return cnt
}

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

	var T int
	for fmt.Fscan(r, &T); T > 0; T-- {

		var a, b, res int
		fmt.Fscan(r, &a, &b)

		x := get_sqrt(1, a, a)
		y := get_sqrt(1, b, b)

		/*
		fmt.Fprintf(w, "a:%d b:%d x:%d y:%d\n", a, b, x, y) // ***
		fmt.Fprintf(w, "A:%d\n", get_cnt(a, b, x)) // ***
		fmt.Fprintf(w, "B1:%d B2:%d B3:%d\n", 3*(y-x-1), get_cnt(a, x*x+2*x, x), get_cnt(y*y, b, y)) // ***
		*/
		if x == y {
			res = get_cnt(a, b, x)
		} else {
			res = 3*(y-x-1) + get_cnt(a, x*x+2*x, x) + get_cnt(y*y, b, y)
		}

		fmt.Fprintln(w, res)

	}

}

package main

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

const cf = true

func sqrt(val uint64) uint64 {
	return uint64(math.Floor(math.Sqrt(float64(val))))
}

func solve() {
	var l, r uint64
	fmt.Fscan(in, &l, &r)
	start, end := sqrt(l), sqrt(r)
	ans := (end - start) + (end-start-1)*2
	for i := l; i < (start+1)*(start+1); i = (i + start) - i%start {
		if i%start == 0 {
			ans++
		}
	}
	for i := end*end + 1; i <= r; i = (i + end) - i%end {
		if i%end == 0 {
			ans++
		}
	}
	fmt.Fprintln(out, ans)
}

func main() {
	defer out.Flush()
	t := 1
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		solve()
	}
}

func ConvertInt(val string, base, toBase int) (string, error) {
	i, err := strconv.ParseInt(val, base, 64)
	if err != nil {
		return "", err
	}
	return strconv.FormatInt(i, toBase), nil
}

type set[T Ordered] struct {
	itms map[T]struct{}
}

func (s *set[T]) init() {
	if s.itms == nil {
		s.itms = make(map[T]struct{})
	}
}

func (s *set[T]) add(item T) *set[T] {
	s.init()
	s.itms[item] = exists
	return s
}

func (s *set[T]) remove(item T) *set[T] {
	s.init()
	delete(s.itms, item)
	return s
}

func (s *set[T]) has(item T) bool {
	s.init()
	_, c := s.itms[item]
	return c
}

func (s *set[T]) sortedItems() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	sort.Slice(items, func(i, j int) bool {
		return items[i] < items[j]
	})
	return items
}

func (s *set[T]) items() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	return items
}

func (s *set[T]) size() int {
	s.init()
	return len(s.itms)
}

var exists = struct{}{}

const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1

func reverseStr(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

type Ordered interface {
	Integer | Float | ~string
}

func abs[T Signed](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func min[T Ordered](x, y T) T {
	if x < y {
		return x
	}
	return y
}

func max[T Ordered](x, y T) T {
	if x > y {
		return x
	}
	return y
}

var (
	in  = getReader()
	out = getWriter()
)

func getReader() *bufio.Reader {
	if cf {
		return bufio.NewReader(os.Stdin)
	} else {
		in, _ := os.Open("input.txt")
		return bufio.NewReader(in)
	}
}

func getWriter() *bufio.Writer {
	if cf {
		return bufio.NewWriter(os.Stdout)
	} else {
		out, _ := os.Create("output.txt")
		return bufio.NewWriter(out)
	}
}

package main

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

const cf = true

func sqrt(val int) int {
	return int(math.Sqrt(float64(val)))
}

func solve() {
	var l, r int
	fmt.Fscan(in, &l, &r)
	start, end := sqrt(l), sqrt(r)
	ans := (end - start) + (end-start-1)*2
	for i := l; i < (start+1)*(start+1); i = (i + start) - i%start {
		if i%start == 0 {
			ans++
		}
	}
	for i := end*end + 1; i <= r; i = (i + end) - i%end {
		if i%end == 0 {
			ans++
		}
	}
	fmt.Fprintln(out, ans)
}

func main() {
	defer out.Flush()
	t := 1
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		solve()
	}
}

func ConvertInt(val string, base, toBase int) (string, error) {
	i, err := strconv.ParseInt(val, base, 64)
	if err != nil {
		return "", err
	}
	return strconv.FormatInt(i, toBase), nil
}

type set[T Ordered] struct {
	itms map[T]struct{}
}

func (s *set[T]) init() {
	if s.itms == nil {
		s.itms = make(map[T]struct{})
	}
}

func (s *set[T]) add(item T) *set[T] {
	s.init()
	s.itms[item] = exists
	return s
}

func (s *set[T]) remove(item T) *set[T] {
	s.init()
	delete(s.itms, item)
	return s
}

func (s *set[T]) has(item T) bool {
	s.init()
	_, c := s.itms[item]
	return c
}

func (s *set[T]) sortedItems() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	sort.Slice(items, func(i, j int) bool {
		return items[i] < items[j]
	})
	return items
}

func (s *set[T]) items() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	return items
}

func (s *set[T]) size() int {
	s.init()
	return len(s.itms)
}

var exists = struct{}{}

const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1

func reverseStr(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

type Ordered interface {
	Integer | Float | ~string
}

func abs[T Signed](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func min[T Ordered](x, y T) T {
	if x < y {
		return x
	}
	return y
}

func max[T Ordered](x, y T) T {
	if x > y {
		return x
	}
	return y
}

var (
	in  = getReader()
	out = getWriter()
)

func getReader() *bufio.Reader {
	if cf {
		return bufio.NewReader(os.Stdin)
	} else {
		in, _ := os.Open("input.txt")
		return bufio.NewReader(in)
	}
}

func getWriter() *bufio.Writer {
	if cf {
		return bufio.NewWriter(os.Stdout)
	} else {
		out, _ := os.Create("output.txt")
		return bufio.NewWriter(out)
	}
}

package main

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

const cf = true

func sqrt(val int) int {
	return int(math.Sqrt(float64(val)))
}

func solve() {
	var l, r int
	fmt.Fscan(in, &l, &r)
	if l == r {
		if l%sqrt(l) == 0 {
			fmt.Fprintln(out, 1)
		} else {
			fmt.Fprintln(out, 0)
		}
		return
	} else if r < 4 {
		fmt.Fprintln(out, r-l+1)
		return
	}
	start, end := sqrt(l), sqrt(r)
	ans := (end - start) + (end-start-1)*2
	for i := l; i < (start+1)*(start+1); i = (i + start) / start * start {
		if i%start == 0 {
			ans++
		}
	}
	for i := r; i > end*end; i = (i - (end - 1)) / (end - 1) * (end - 1) {
		if i%end == 0 {
			ans++
		}
	}
	fmt.Fprintln(out, ans)
}

func main() {
	defer out.Flush()
	t := 1
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		solve()
	}
}

func ConvertInt(val string, base, toBase int) (string, error) {
	i, err := strconv.ParseInt(val, base, 64)
	if err != nil {
		return "", err
	}
	return strconv.FormatInt(i, toBase), nil
}

type set[T Ordered] struct {
	itms map[T]struct{}
}

func (s *set[T]) init() {
	if s.itms == nil {
		s.itms = make(map[T]struct{})
	}
}

func (s *set[T]) add(item T) *set[T] {
	s.init()
	s.itms[item] = exists
	return s
}

func (s *set[T]) remove(item T) *set[T] {
	s.init()
	delete(s.itms, item)
	return s
}

func (s *set[T]) has(item T) bool {
	s.init()
	_, c := s.itms[item]
	return c
}

func (s *set[T]) sortedItems() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	sort.Slice(items, func(i, j int) bool {
		return items[i] < items[j]
	})
	return items
}

func (s *set[T]) items() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	return items
}

func (s *set[T]) size() int {
	s.init()
	return len(s.itms)
}

var exists = struct{}{}

const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1

func reverseStr(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

type Ordered interface {
	Integer | Float | ~string
}

func abs[T Signed](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func min[T Ordered](x, y T) T {
	if x < y {
		return x
	}
	return y
}

func max[T Ordered](x, y T) T {
	if x > y {
		return x
	}
	return y
}

var (
	in  = getReader()
	out = getWriter()
)

func getReader() *bufio.Reader {
	if cf {
		return bufio.NewReader(os.Stdin)
	} else {
		in, _ := os.Open("input.txt")
		return bufio.NewReader(in)
	}
}

func getWriter() *bufio.Writer {
	if cf {
		return bufio.NewWriter(os.Stdout)
	} else {
		out, _ := os.Create("output.txt")
		return bufio.NewWriter(out)
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var T int
	fmt.Scan(&T)
	for tt:=0; tt<T; tt++ {
		var l, r uint64
		fmt.Scan(&l, &r)

		cnt := func (x uint64) uint64 {
			var res uint64 = 0
			if x == 0 {
				return res
			}
			sq := uint64(math.Sqrt(float64(x)))
			res = (sq - 1) * 3
			cur := sq * sq
			for cur <= x {
				res++
				cur += sq
			}
			return res
		}
		res := cnt(r) - cnt(l-1)
		fmt.Println(res)
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var T int
	fmt.Scan(&T)
	for tt:=0; tt<T; tt++ {
		var l, r int64
		fmt.Scan(&l, &r)

		cnt := func (x int64) int64 {
			var res int64 = 0
			if x == 0 {
				return res
			}
			sq := int64(math.Sqrt(float64(x)))
			res = (sq - 1) * 3
			cur := sq * sq
			for cur <= x {
				res++
				cur += sq
			}
			return res
		}
		res := cnt(r) - cnt(l-1)
		fmt.Println(res)
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var T int
	fmt.Scan(&T)
	for tt:=0; tt<T; tt++ {
		var l, r int64
		fmt.Scan(&l, &r)

		// cnt := func (x int64) int64 {
		// 	var res int64 = 0
		// 	var cur int64 = 1
		// 	var val int64 = 1
		// 	rem := 0
		// 	for val <= x {
		// 		res++
		// 		rem++
		// 		val += cur
		// 		if rem == 3 {
		// 			cur++
		// 			val = cur * cur
		// 			rem = 0
		// 			continue
		// 		}
		// 	}
		// 	return res
		// }

		cnt1 := func (x int64) int64 {
			var res int64 = 0
			if x == 0 {
				return res
			}
			sq := int64(math.Sqrt(float64(x)))
			res += (sq - 1) * 3
			cur := sq * sq
			// fmt.Println(res, cur, sq)
			for cur <= x {
				res++
				cur += sq
				// fmt.Println(res, cur, sq)
			}
			return res
		}
		res := cnt1(r) - cnt1(l-1)
		fmt.Println(res)
	}
}

package main

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

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

func main() {
	defer out.Flush()

	var test int
	fmt.Fscan(in, &test)
	for i := 0; i < test; i++ {
		fmt.Fprintln(out, solve())
	}
}

func solve() int64 {
	var l, r int64
	fmt.Fscan(in, &l, &r)
	if l == r {
		x := int64(math.Sqrt(float64(l)))
		if x*x > l {
			x--
		}
		if l%x == 0 {
			return 1
		}
		return 0
	}

	lo := int64(math.Sqrt(float64(l)))
	hi := int64(math.Sqrt(float64(r))) + 1

	if lo*lo > l {
		lo--
	}
	if hi*hi < r {
		hi++
	}

	// fmt.Println(lo, hi)

	if hi-lo == 1 {
		res := int64(0)
		for i := lo * lo; i <= hi*hi; i += lo {
			if i >= l && i <= r {
				res++
			}
		}
		return res
	}
	res := (hi - lo - 2) * 3
	mid := lo + 1
	for i := lo * lo; i < mid*mid; i += lo {
		if i >= l && i <= r {
			res++
		}
	}
	mid = hi - 1
	for i := mid * mid; i <= hi*hi; i += mid {
		if i >= l && i <= r {
			res++
		}
	}
	return res
}

package main

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

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

func main() {
	defer out.Flush()

	var test int
	fmt.Fscan(in, &test)
	for i := 0; i < test; i++ {
		fmt.Fprintln(out, solve())
	}
}

func solve() int64 {
	var l, r int64
	fmt.Fscan(in, &l, &r)
	if l == r {
		x := int64(math.Sqrt(float64(l)))
		if l%x == 0 {
			return 1
		}
		return 0
	}

	lo := int64(math.Sqrt(float64(l)))
	hi := int64(math.Sqrt(float64(r))) + 1

	if lo*lo > l {
		lo--
	}
	if hi*hi < r {
		hi++
	}

	// fmt.Println(lo, hi)

	if hi-lo == 1 {
		res := int64(0)
		for i := lo * lo; i <= hi*hi; i += lo {
			if i >= l && i <= r {
				res++
			}
		}
		return res
	}
	res := (hi - lo - 2) * 3
	mid := lo + 1
	for i := lo * lo; i < mid*mid; i += lo {
		if i >= l && i <= r {
			res++
		}
	}
	mid = hi - 1
	for i := mid * mid; i <= hi*hi; i += mid {
		if i >= l && i <= r {
			res++
		}
	}
	return res
}

package main

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

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

func main() {
	defer out.Flush()

	var test int
	fmt.Fscan(in, &test)
	for i := 0; i < test; i++ {
		fmt.Fprintln(out, solve())
	}
}

func solve() int64 {
	var l, r int64
	fmt.Fscan(in, &l, &r)
	if l == r {
		x := int64(math.Sqrt(float64(l)))
		if l%x == 0 {
			return 1
		}
		return 0
	}

	lo := int64(math.Sqrt(float64(l)))
	hi := int64(math.Sqrt(float64(r))) + 1

	// fmt.Println(lo, hi)

	if hi-lo == 1 {
		res := int64(0)
		for i := lo * lo; i <= hi*hi; i += lo {
			if i >= l && i <= r {
				res++
			}
		}
		return res
	}
	res := (hi - lo - 2) * 3
	mid := lo + 1
	for i := lo * lo; i < mid*mid; i += lo {
		if i >= l && i <= r {
			res++
		}
	}
	mid = hi - 1
	for i := mid * mid; i <= hi*hi; i += mid {
		if i >= l && i <= r {
			res++
		}
	}
	return res
}


package main

import "fmt"

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

	for range make([]struct{}, n) {
		var a, b int
		fmt.Scan(&a, &b)

		switch {
		case a > b:
			m++
		case b > a:
			c++
		}
	}

	switch {
	case m > c:
		fmt.Println("Mishka")
	case c > m:
		fmt.Println("Chris")
	default:
		fmt.Println("Friendship is magic!^^")
	}
}

package main

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

func main() {
	var n, a, b int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &n)
	count := 0
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a, &b)
		if a > b {
			count++
		} else if a < b {
			count--
		}
	}
	if count > 0 {
		fmt.Println("Mishka")
	} else if count < 0 {
		fmt.Println("Chris")
	} else {
		fmt.Println("Friendship is magic!^^")
	}
}

// A. Mishka and Game
/*
Mishka is a little polar bear. As known, little bears loves spending their
free time playing dice for chocolates. Once in a wonderful sunny morning,
walking around blocks of ice, Mishka met her friend Chris, and they started
playing the game.

Rules of the game are very simple: at first number of rounds n is defined.
In every round each of the players throws a cubical dice with distinct numbers
from 1 to 6 written on its faces. Player, whose value after throwing the dice
is greater, wins the round. In case if player dice values are equal, no one of
them is a winner.

In average, player, who won most of the rounds, is the winner of the game.
In case if two players won the same number of rounds, the result of the
game is draw.

Mishka is still very little and can't count wins and losses, so she asked you
to watch their game and determine its result. Please help her!

Input
The first line of the input contains single integer n n (1 ≤ n ≤ 100) —
the number of game rounds.

The next n lines contains rounds description. i-th of them contains pair of
integers mi and ci (1 ≤ mi,  ci ≤ 6) — values on dice upper face after
Mishka's and Chris' throws in i-th round respectively.

Output
If Mishka is the winner of the game, print "Mishka" (without quotes)
in the only line.

If Chris is the winner of the game, print "Chris" (without quotes) in the
only line.

If the result of the game is draw, print "Friendship is magic!^^"
(without quotes) in the only line.

Examples
Input
3
3 5
2 1
4 2

Output
Mishka

Input
2
6 1
1 6

Output
Friendship is magic!^^

Input
3
1 5
3 3
2 2

Output
Chris

Note
In the first sample case Mishka loses the first round, but wins second and
third rounds and thus she is the winner of the game.

In the second sample case Mishka wins the first round, Chris wins the second
round, and the game ends with draw with score 1:1.

In the third sample case Chris wins the first round, but there is no winner of
the next two rounds. The winner of the game is Chris.
*/
package main

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

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

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

		m, _ := strconv.Atoi(arr[0])
		c, _ := strconv.Atoi(arr[1])

		if m > c {
			mWin++
		} else if c > m {
			cWin++
		}
	}

	if mWin > cWin {
		fmt.Print("Mishka")
	} else if cWin > mWin {
		fmt.Print("Chris")
	} else {
		fmt.Print("Friendship is magic!^^")
	}
}

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.Fscan(bufin, &n)

	mwin := 0
	cwin := 0

	var m, c int
	for i := 0; i < n; i++ {
		fmt.Fscan(bufin, &m, &c)
		if m > c {
			mwin++
		} else if m < c {
			cwin++
		}
	}

	if mwin > cwin {
		fmt.Fprintln(bufout, "Mishka")
	} else if mwin < cwin {
		fmt.Fprintln(bufout, "Chris")
	} else {
		fmt.Fprintln(bufout, "Friendship is magic!^^")
	}
}

package main

import "fmt"

func main() {
	var n, m, c int
	var mishka, chris = 0, 0
	_, _ = fmt.Scan(&n)
	for ; n > 0; n-- {
		_, _ = fmt.Scan(&m, &c)
		if m > c {
			mishka += 1
		} else if m < c {
			chris += 1
		} else {
			continue
		}
	}
	if mishka > chris {
		fmt.Println("Mishka")
	} else if chris > mishka {
		fmt.Println("Chris")
	} else {
		fmt.Println("Friendship is magic!^^")
	}
}

package main

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

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	n := NextInt()
	m := 0
	c := 0
	for i := 0; i < n; i++ {
		mi := NextInt()
		ci := NextInt()
		switch {
		case mi > ci:
			m++
		case mi < ci:
			c++
		default:
		}
	}

	switch {
	case m > c:
		Println("Mishka")
	case c > m:
		Println("Chris")
	default:
		Println("Friendship is magic!^^")
	}
}

/******************/
/* IO boilerplate */
/******************/

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

func NextInt() int {
	ret, _ := strconv.Atoi(Next())
	return ret
}

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

func Print(s string) {
	writer.WriteString(s)
}

func Println(s string) {
	writer.WriteString(s)
	writer.WriteByte('\n')
}

package main

import (
	"fmt"
)

func main() {
	var a, b, n int
	r := 0
	fmt.Scanf("%d \n", &n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d %d\n", &a, &b)
		if a > b {
			r++
		}
		if b > a {
			r--
		}
	}
	if r > 0 {
		fmt.Print("Mishka")
	} else if r < 0 {
		fmt.Print("Chris")
	} else {
		fmt.Print("Friendship is magic!^^")
	}
}

package main

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

func main() {
    in := bufio.NewReader(os.Stdin)
    n := 0
    fmt.Fscan(in, &n)
    one := 0
    two := 0
    var a, b int
    for i := 0; i < n; i++ {
        fmt.Fscan(in, &a, &b)
        if a < b {
            two++
        } else if b < a {
            one++
        }
    }
    if one == two {
        fmt.Println("Friendship is magic!^^")
    } else if one > two {
        fmt.Println("Mishka")
    } else {
        fmt.Println("Chris")
    }
}

package main

import "fmt"

func new_game(result [2]int) [2]int {
	var a, b int
	fmt.Scan(&a, &b)
	if a > b {
		result[0] += 1
	} else if a < b {
		result[1] += 1
	}
	return result
}
func main() {
	result := [...]int{0, 0}
	var res1 int = 0
	var res2 int = 0
	var n int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		result := new_game(result)
		res1 += result[0]
		res2 += result[1]
	}
	if res1 == res2 {
		fmt.Print("Friendship is magic!^^")
	} else if res2 > res1 {
		fmt.Print("Chris")
	} else if res1 > res2 {
		fmt.Print("Mishka")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n, mi, ch, ms, cs int
	fmt.Scan(&n)

	for i:=0; i < n; i++{
		fmt.Scan(&mi, &ch)
		if mi > ch {
			ms++
		}else if ch > mi{
			cs++
		}
	}
	if ms > cs {
		fmt.Println("Mishka")
	}else if cs > ms {
		fmt.Println("Chris")
	}else{
		fmt.Println("Friendship is magic!^^")
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var n, a, b uint8
	var m, c uint8
	fmt.Fscanf(in, "%d\n", &n)
	for i := 0; uint8(i) < n; i++ {
		fmt.Fscanf(in, "%d %d\n", &a, &b)
		if a > b {
			m++
		} else if a < b {
			c++
		}
	}
	if c == m {
		fmt.Println("Friendship is magic!^^")
	} else if m > c {
		fmt.Println("Mishka")
	} else if m < c {
		fmt.Println("Chris")
	}

}

package main

import "fmt"

func newgame(result [2]int) [2]int {
	var a, b int
	fmt.Scan(&a, &b)
	if a > b {
		result[0] += 1
	} else if a < b {
		result[1] += 1
	}
	return result
}
func main() {
	result := [...]int{0, 0}
	var result1, result2 int = 0, 0
	var n int
	fmt.Scan(&n)
	for i := 1; i < n+1; i++ {
		result := newgame(result)
		//fmt.Print(result)
		result1 += result[0]
		result2 += result[1]
	}
	if result1 > result2 {
		fmt.Print("Mishka")
	} else if result2 > result1 {
		fmt.Print("Chris")
	} else if result1 == result2 {
		fmt.Print("Friendship is magic!^^")
	}
}

package main

import (
	"fmt"
)

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

	ans := 0
	for i := 0; i < n; i++ {
		m, c := 0, 0
		fmt.Scan(&m, &c)
		if m > c {
			ans++
		} else if c > m {
			ans--
		}
	}

	if ans > 0 {
		fmt.Println("Mishka")
	} else if ans < 0 {
		fmt.Println("Chris")
	} else {
		fmt.Println("Friendship is magic!^^")
	}
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var aw, bw int
	for i := 0; i < n; i++ {
		var a, b int
		fmt.Scan(&a, &b)
		if a > b {
			aw++
		}
		if b > a {
			bw++
		}
	}
	if aw > bw {
		fmt.Print("Mishka")
	} else if aw == bw {
		fmt.Print("Friendship is magic!^^")
	} else {
		fmt.Print("Chris")
	}
}

package main

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

import "strings"

func main() {
	reader := bufio.NewReader(os.Stdin)
	text, _ := reader.ReadString('\n')
	text = strings.TrimRight(text, "\r\n")
	s := strings.Split(text, " ")

	c, _ := strconv.Atoi(s[0])

	var ms int64
	var cs int64
	//x, _ := strconv.ParseInt(s[1], 10, 64)
	for i := 0; i < c; i++ {
		text, _ := reader.ReadString('\n')
		text = strings.TrimRight(text, "\r\n")
		s := strings.Split(text, " ")
		c1, _ := strconv.Atoi(s[0])
		c2, _ := strconv.Atoi(s[1])
		if c1 > c2 {
			ms += 1
		} else if c2 > c1 {
			cs += 1
		}
	}

	if ms > cs {
		fmt.Println("Mishka")
	} else if cs > ms {
		fmt.Println("Chris")
	} else {
		fmt.Println("Friendship is magic!^^")
	}
}

package main

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

// https://codeforces.com/problemset/problem/703/A
// Rules of the game are very simple: at first number of rounds n is defined. In every round each of the players throws a cubical dice with distinct numbers from 1 to 6 written on its faces. Player, whose value after throwing the dice is greater, wins the round. In case if player dice values are equal, no one of them is a winner.

// In average, player, who won most of the rounds, is the winner of the game. In case if two players won the same number of rounds, the result of the game is draw.

// Mishka is still very little and can't count wins and losses, so she asked you to watch their game and determine its result. Please help her!
// Input

// The first line of the input contains single integer n n (1 ≤ n ≤ 100) — the number of game rounds.

// The next n lines contains rounds description. i-th of them contains pair of integers mi and ci (1 ≤ mi,  ci ≤ 6) — values on dice upper face after Mishka's and Chris' throws in i-th round respectively.
// Output

// If Mishka is the winner of the game, print "Mishka" (without quotes) in the only line.

// If Chris is the winner of the game, print "Chris" (without quotes) in the only line.

// If the result of the game is draw, print "Friendship is magic!^^" (without quotes) in the only line.

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

	var n int
	_, _ = fmt.Fscan(bufStdin, &n)

	var mWins, cWins int
	for i := 0; i < n; i++ {
		var mi, ci int
		_, _ = fmt.Fscan(bufStdin, &mi, &ci)

		if mi > ci {
			mWins++
		} else if ci > mi {
			cWins++
		}
	}

	if mWins > cWins {
		_, _ = fmt.Print("Mishka")
	} else if cWins > mWins {
		_, _ = fmt.Print("Chris")
	} else {
		_, _ = fmt.Print("Friendship is magic!^^")
	}
}

package main

import "fmt"

func main() {
	var n, c1, c2, a, b int
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a, &b)
		if a > b {
			c1++
		} else if a < b {
			c2++
		} else {
			c1++
			c2++
		}
	}
	if c1 > c2 {
		fmt.Println("Mishka")
	} else if c1 < c2 {
		fmt.Println("Chris")
	} else {
		fmt.Println("Friendship is magic!^^")
	}
}

package main

import "fmt"

type roll struct {
	m int
	c int
}

// https://codeforces.com/problemset/problem/703/A
// комментарии к решению
// Малый объем входных данных (n <= 100) позволяет задействовать fmt.Scan .
func taskSolution(a []roll) string {
	res := 0
	for _, r := range a {
		if r.m > r.c {
			res += 1
		} else if r.m < r.c {
			res -= 1
		}
	}
	if res > 0 {
		return "Mishka"
	} else if res < 0 {
		return "Chris"
	}
	return "Friendship is magic!^^"
}

func main() {
	var n int
	if _, err := fmt.Scan(&n); err != nil {
		panic(err)
	}

	a := []roll{}
	for i := 0; i < n; i += 1 {
		var m, c int
		if _, err := fmt.Scan(&m, &c); err != nil {
			panic(err)
		}
		a = append(a, roll{m, c})
	}

	fmt.Println(taskSolution(a))
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var n, a, b uint8
	var m, c uint16
	fmt.Fscanf(in, "%d\n", &n)
	for i := 0; uint8(i) < n; i++ {
		fmt.Fscanf(in, "%d %d\n", &a, &b)
		m += uint16(a)
		c += uint16(b)
	}
	if c == m {
		fmt.Println("Friendship is magic!^^")
	} else if m > c {
		fmt.Println("Mishka")
	} else if m < c {
		fmt.Println("Chris")
	}

}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var n, a, b uint8
	var m, c uint16
	fmt.Fscanf(in, "%d\n", &n)
	for i := 0; uint8(i) < n; i++ {
		fmt.Fscanf(in, "%d %d\n", &a, &b)
		m += uint16(a)
		c += uint16(b)
	}
	if m > c {
		fmt.Println("Mishka")
	} else if m < c {
		fmt.Println("Chris")
	} else if c == m {
		fmt.Println("Friendship is magic!^^")
	}

}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var n, a, b uint8
	var m, c uint8
	fmt.Fscanf(in, "%d\n", &n)
	for i := 0; uint8(i) < n; i++ {
		fmt.Fscanf(in, "%d %d\n", &a, &b)
		if a > b {
			m++
		} else {
			c++
		}
	}
	if c == m {
		fmt.Println("Friendship is magic!^^")
	} else if m > c {
		fmt.Println("Mishka")
	} else if m < c {
		fmt.Println("Chris")
	}

}


package main

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

func swap(x, y *int) {
  var tmp int = *x
  *x = *y
  *y = tmp
}

func getNextX(x int) int {
  x = int((int64(x)*37 + 10007) % 1000000007)
  return x
}

// This is a boring problem, since a and b are generated randomly actually.
func initAB(x, d, n int, a, b []int) {
  for i := 0; i < n; i++ {
    a[i] = i + 1
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&a[i], &a[x%(i+1)])
  }
  for i := 0; i < n; i++ {
    if i < d {
      b[i] = 1
    } else {
      b[i] = 0
    }
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&b[i], &b[x%(i+1)])
  }
}

const N = 100001

func main() {
  reader := bufio.NewReader(os.Stdin)
  writer := bufio.NewWriter(os.Stdout)
  var n, d, x int
  fmt.Fscan(reader, &n, &d, &x)
  a := make([]int, N)
  b := make([]int, N)
  p := make([]int, N)
  b_pos := make([]int, d)
  initAB(x, d, n, a, b)
  for i := 0; i < n; i++ {
    p[a[i]] = i
  }
  var pos int = 0
  for i := 0; i < n; i++ {
    if b[i] == 1 {
      b_pos[pos] = i
      pos++
    }
  }
  const L = 40
  for i := 0; i < n; i++ {
    var res int = -1
    for j := n; j >= n-L && j > 0; j-- {
      if i >= p[j] && b[i-p[j]] == 1 {
        res = j
        break
      }
    }
    if res == -1 {
      res = 0
    }
    if res == 0 {
      for j := 0; j < d && b_pos[j] <= i; j++ {
        if res < a[i-b_pos[j]] {
          res = a[i-b_pos[j]]
        }
      }
    }
    fmt.Fprintf(writer, "%d\n", res)
  }
  writer.Flush()
}

package main

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

func swap(x, y *int) {
  var tmp int = *x
  *x = *y
  *y = tmp
}

func getNextX(x int) int {
  x = int((int64(x)*37 + 10007) % 1000000007)
  return x
}

// This is a boring problem, since a and b are generated randomly actually.
func initAB(x, d, n int, a, b []int) {
  for i := 0; i < n; i++ {
    a[i] = i + 1
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&a[i], &a[x%(i+1)])
  }
  for i := 0; i < n; i++ {
    if i < d {
      b[i] = 1
    } else {
      b[i] = 0
    }
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&b[i], &b[x%(i+1)])
  }
}

const N = 100001

func main() {
  reader := bufio.NewReader(os.Stdin)
  var n, d, x int
  fmt.Fscan(reader, &n, &d, &x)
  a := make([]int, N)
  b := make([]int, N)
  p := make([]int, N)
  b_pos := make([]int, d)
  initAB(x, d, n, a, b)
  for i := 0; i < n; i++ {
    p[a[i]] = i
  }
  var pos int = 0
  for i := 0; i < n; i++ {
    if b[i] == 1 {
      b_pos[pos] = i
      pos++
    }
  }
  const L = 40
  for i := 0; i < n; i++ {
    var res int = -1
    for j := n; j >= n-L && j > 0; j-- {
      if i >= p[j] && b[i-p[j]] == 1 {
        res = j
        break
      }
    }
    if res == -1 {
      res = 0
    }
    if res == 0 {
      for j := 0; j < d && b_pos[j] <= i; j++ {
        if res < a[i-b_pos[j]] {
          res = a[i-b_pos[j]]
        }
      }
    }
    fmt.Printf("%d\n", res)
  }
}

package main

import (
	"fmt"
	"sort"
	// "os"
)

const (
	tresh = 1000
)

var (
	x int64
	as []int
	bs []int
)

func getNextX() int {
    x = (x * 37 + 10007) % 1000000007
    return int(x)
}

type Indicies []int
func (a Indicies) Len() int           { return len(a) }
func (a Indicies) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a Indicies) Less(i, j int) bool { return as[a[i]] > as[a[j]] }

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

	as = make([]int, n)
	bs = make([]int, n)
	for i := 0; i < n; i++ {
		as[i] = i+1
		if i < d {
			bs[i] = 1
		}
	}
	for i := 0; i < n; i++ {
		j := getNextX() % (i + 1)
		as[i], as[j] = as[j], as[i]
	}
	for i := 0; i < n; i++ {
		j := getNextX() % (i + 1)
		bs[i], bs[j] = bs[j], bs[i]
	}

	if d < tresh {
	// if len(os.Args) == 2 {
		cs := make([]int, n)
		for i := 0; i < n; i++ {
			if bs[i] == 1 {
				for j := i; j < n; j++ {
					if cs[j] < as[j-i] {
						cs[j] = as[j-i]
					}
				}
			}
		}
		for _, c := range cs {
			fmt.Println(c)
		}
	} else {
		var ordered Indicies = make([]int, n)
		for i := 0; i < n; i++ {
			ordered[i] = i
		}
		sort.Sort(ordered)
		// fmt.Println(as)
		// fmt.Println(ordered)
		for j := 0; j < n; j++ {
			x := 0
			for _, i := range ordered {
				if j-i >= 0 && bs[j-i] == 1 {
					x = as[i]
					break
				}
			}
			fmt.Println(x)
		}
	}
}

package main

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

func swap(x, y *int) {
  var tmp int = *x
  *x = *y
  *y = tmp
}

func getNextX(x int) int {
  x = int((int64(x)*37 + 10007) % 1000000007)
  return x
}

// This is a boring problem, since a and b are generated randomly actually.
func initAB(x, d, n int, a, b []int) {
  for i := 0; i < n; i++ {
    a[i] = i + 1
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&a[i], &a[x%(i+1)])
  }
  for i := 0; i < n; i++ {
    if i < d {
      b[i] = 1
    } else {
      b[i] = 0
    }
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&b[i], &b[x%(i+1)])
  }
}

const N = 100001

func main() {
  reader := bufio.NewReader(os.Stdin)
  writer := bufio.NewWriterSize(os.Stdout, 20<<20)
  var n, d, x int
  fmt.Fscan(reader, &n, &d, &x)
  a := make([]int, N)
  b := make([]int, N)
  p := make([]int, N)
  b_pos := make([]int, d)
  initAB(x, d, n, a, b)
  for i := 0; i < n; i++ {
    p[a[i]] = i
  }
  var pos int = 0
  for i := 0; i < n; i++ {
    if b[i] == 1 {
      b_pos[pos] = i
      pos++
    }
  }
  const L = 40
  for i := 0; i < n; i++ {
    var res int = -1
    for j := n; j >= n-L && j > 0; j-- {
      if i >= p[j] && b[i-p[j]] == 1 {
        res = j
        break
      }
    }
    if res == -1 {
      res = 0
    }
    if res == 0 {
      for j := 0; j < d && b_pos[j] <= i; j++ {
        if res < a[i-b_pos[j]] {
          res = a[i-b_pos[j]]
        }
      }
    }
    fmt.Fprintf(writer, "%d\n", res)
  }
  writer.Flush()
}

package main

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

func swap(x, y *int) {
  var tmp int = *x
  *x = *y
  *y = tmp
}

func getNextX(x int) int {
  x = int((int64(x)*37 + 10007) % 1000000007)
  return x
}

// This is a boring problem, since a and b are generated randomly actually.
func initAB(x, d, n int, a, b []int) {
  for i := 0; i < n; i++ {
    a[i] = i + 1
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&a[i], &a[x%(i+1)])
  }
  for i := 0; i < n; i++ {
    if i < d {
      b[i] = 1
    } else {
      b[i] = 0
    }
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&b[i], &b[x%(i+1)])
  }
}

const N = 100001

func main() {
  reader := bufio.NewReader(os.Stdin)
  writer := bufio.NewWriterSize(os.Stdout, 20<<20)
  var n, d, x int
  fmt.Fscan(reader, &n, &d, &x)
  a := make([]int, N)
  b := make([]int, N)
  p := make([]int, N)
  b_pos := make([]int, d)
  initAB(x, d, n, a, b)
  for i := 0; i < n; i++ {
    p[a[i]] = i
  }
  var pos int = 0
  for i := 0; i < n; i++ {
    if b[i] == 1 {
      b_pos[pos] = i
      pos++
    }
  }
  const L = 40
  for i := 0; i < n; i++ {
    var res int = -1
    for j := n; j >= n-L && j > 0; j-- {
      if i >= p[j] && b[i-p[j]] == 1 {
        res = j
        break
      }
    }
    if res == -1 {
      for j := 0; j < d && b_pos[j] <= i; j++ {
        if res < a[i-b_pos[j]] {
          res = a[i-b_pos[j]]
        }
      }
    }
    fmt.Fprintf(writer, "%d\n", res)
  }
  writer.Flush()
}

package main

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

func swap(x, y *int) {
  var tmp int = *x
  *x = *y
  *y = tmp
}

func getNextX(x int) int {
  x = int((int64(x)*37 + 10007) % 1000000007)
  return x
}

// This is a boring problem, since a and b are generated randomly actually.
func initAB(x, d, n int, a, b []int) {
  for i := 0; i < n; i++ {
    a[i] = i + 1
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&a[i], &a[x%(i+1)])
  }
  for i := 0; i < n; i++ {
    if i < d {
      b[i] = 1
    } else {
      b[i] = 0
    }
  }
  for i := 0; i < n; i++ {
    x = getNextX(x)
    swap(&b[i], &b[x%(i+1)])
  }
}

const N = 100001

func main() {
  reader := bufio.NewReader(os.Stdin)
  writer := bufio.NewWriter(os.Stdout)
  var n, d, x int
  fmt.Fscan(reader, &n, &d, &x)
  a := make([]int, N)
  b := make([]int, N)
  p := make([]int, N)
  initAB(x, d, n, a, b)
  for i := 0; i < n; i++ {
    p[a[i]] = i
  }
  const L = 40
  for i := 0; i < n; i++ {
    var res int = -1
    for j := n; j >= n-L && j > 0; j-- {
      if i >= p[j] && b[i-p[j]] == 1 {
        res = j
        break
      }
    }
    if res == -1 {
      for j := 0; j <= i; j++ {
        if res < a[j]*b[i-j] {
          res = a[j] * b[i-j]
        }
      }
    }
    fmt.Fprintln(writer, res)
  }
}

package main

import (
	"fmt"
	"sort"
)

const (
	tresh = 1000
)

var (
	x int64
	as []int
	bs []int
)

func getNextX() int {
    x = (x * 37 + 10007) % 1000000007
    return int(x)
}

type Indicies []int
func (a Indicies) Len() int           { return len(a) }
func (a Indicies) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a Indicies) Less(i, j int) bool { return as[a[i]] > as[a[j]] }

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

	as = make([]int, n)
	bs = make([]int, n)
	for i := 0; i < n; i++ {
		as[i] = i+1
		if i < d {
			bs[i] = 1
		}
	}
	for i := 0; i < n; i++ {
		j := getNextX() % (i + 1)
		as[i], as[j] = as[j], as[i]
	}
	for i := 0; i < n; i++ {
		j := getNextX() % (i + 1)
		bs[i], bs[j] = bs[j], bs[i]
	}

	if d < tresh {
		cs := make([]int, n)
		for i := 0; i < n; i++ {
			if bs[i] == 1 {
				for j := i; j < n; j++ {
					if cs[j] < as[j-i] {
						cs[j] = as[j-i]
					}
				}
			}
		}
		for _, c := range cs {
			fmt.Println(c)
		}
	} else {
		var ordered Indicies = make([]int, n)
		for i := 0; i < n; i++ {
			ordered[i] = i
		}
		sort.Sort(ordered)
		for j := 0; j < n; j++ {
			for _, i := range ordered {
				if j-i >= 0 && bs[j-i] == 1 {
					fmt.Println(as[i])
					break
				}
			}
		}
	}
}


package main

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

type heap struct {
	array []int
}

func (h *heap) push(val int) {
	h.array = append(h.array, val)
	cur := len(h.array) - 1
	for cur > 0 {
		var parent int
		if (cur & 1) == 1 {
			parent = (cur - 1) / 2
		} else {
			parent = (cur - 2) / 2
		}
		if h.array[cur] < h.array[parent] {
			h.array[cur], h.array[parent] = h.array[parent], h.array[cur]
			cur = parent
		} else {
			break
		}
	}
}

func (h *heap) pop() int {
	res := h.array[0]
	h.array[0], h.array[len(h.array)-1] = h.array[len(h.array)-1], h.array[0]
	h.array = h.array[:len(h.array)-1]
	cur := 0
	for cur < len(h.array) {
		smallest := cur
		if cur*2+1 < len(h.array) && h.array[smallest] > h.array[cur*2+1] {
			smallest = cur*2 + 1
		}
		if cur*2+2 < len(h.array) && h.array[smallest] > h.array[cur*2+2] {
			smallest = cur*2 + 2
		}
		if smallest != cur {
			h.array[smallest], h.array[cur] = h.array[cur], h.array[smallest]
			cur = smallest
		} else {
			break
		}
	}
	return res
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var T int
	Fscan(in, &T)
	for T > 0 {
		T--
		var n int
		Fscan(in, &n)
		arr := make([]int, n)
		for i := 0; i < n; i++ {
			Fscan(in, &arr[i])
		}
		sort.Ints(arr)
		flag := true
		for i := 1; i < n; i++ {
			if (arr[i]-arr[i-1])%2 != 0 {
				flag = false
				break
			}
		}
		if flag {
			Fprintln(out, "YES")
		} else {
			Fprintln(out, "NO")
		}
	}
}

package main

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

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

	var T, n int
	fmt.Fscan(r, &T)
	for t := 0; t < T; t++ {
		fmt.Fscan(r, &n)
		a := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(r, &a[i])
		}
		if n == 1 {
			fmt.Fprint(w, "YES\n")
			continue
		}
		r1, r2 := 0, 0
		for _, e := range a {
			if e&1 == 0 {
				r1++
			} else {
				r2++
			}
		}
		if r1 != 0 && r2 != 0 {
			fmt.Fprint(w, "NO\n")
		} else {
			fmt.Fprint(w, "YES\n")
		}
	}
}

package main

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

func readInt(scanner *bufio.Scanner) int {
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	return t
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	t := readInt(scanner)
	for i := 0; i < t; i++ {
		n := readInt(scanner)
		e := [2]int{0, 0}

		for j := 0; j < n; j++ {
			e[readInt(scanner) % 2] += 1
		}

		if e[0] > 0 && e[1] > 0 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

package main

import "fmt"

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

func main(){

	var t int

	fmt.Scan(&t)

	for T := 0 ; T < t; T ++ {
		var n int

		fmt.Scan(&n)

		a := make([]int , n)

		for i := 0 ; i < n ; i ++ {
			fmt.Scan(&a[i])
		}
		q := 0
		for i := 0 ; i + 1 < n ; i ++ {
			if Abs(a[i] - a[i + 1]) % 2 != 0 {
				q = 1
				fmt.Printf("NO\n")
				break
			}
		}
		if q == 0 {
			fmt.Printf("YES\n")
		}
	}

}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var cases int
	fmt.Scanf("%d\n", &cases)
	for i := 0; i < cases; i++ {
		line := readLine(reader)
		n, _ := strconv.Atoi(string(line))
		line = readLine(reader)
		ans := strings.Split(string(line), " ")
		current, _ := strconv.Atoi(ans[0])
		flag := true
		for i := 0; i < n; i++ {
			x,_ := strconv.Atoi(ans[i])
			if x > current {
				current, x = x, current
			}
			if (current - x) % 2 != 0 {
				flag = false
				break
			}
		}
		if flag {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

func readLine(reader *bufio.Reader) []byte {
	result := make([]byte, 0)
	for {
		s, isPrefix, err := reader.ReadLine()
		if err != nil {
			fmt.Printf("error=%+v\n", err)
			break
		}
		result = append(result, s...)
		if !isPrefix {
			break
		}
	}
	return result
}

package main

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

var (
	t int
	n int
	a []int
)

func main() {
	readVariables()
	for i := 0; i < t; i++ {
		readQuery()
		if judge() {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

func judge() bool {
	if n == 1 {
		return true
	}
	for i := 1; i < n; i++ {
		if (a[i]-a[i-1])%2 != 0 {
			return false
		}
	}
	return true
}

func readVariables() {
	t = nextInt()
}
func readQuery() {
	n = nextInt()
	a = make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
}

/* Template */

var scanner *bufio.Scanner

func init() {
	Max := 1001001
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 0, Max), Max)
	scanner.Split(bufio.ScanWords)
}

//nextInt converts next token from stdin and returns integer value.
//nextInt panics when conversion into an integer fails.
func nextInt() int {
	if !scanner.Scan() {
		panic("No more token.")
	}
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic("nextInt(): cannot convert to int: " + scanner.Text())
	}
	return num
}

func nextStr() string {
	if !scanner.Scan() {
		panic("No more token.")
	}
	return scanner.Text()
}

// MinInt returns minimum argument
func MinInt(x, y int) int {
	if x < y {
		return x
	} else {
		return y
	}
}

//MaxInt returns maximum argument
func MaxInt(x, y int) int {
	if x < y {
		return y
	} else {
		return x
	}
}

//AbsInt returns |x| for x
func AbsInt(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//ModPow calculates integer power with modulo operation
//if modulo <= 1, it powers w/o module operation
//if base < 0, return value might be negative too.
func ModPow(base, exponent, modulo int) (result int) {
	result = 1
	for exponent > 0 {
		if exponent%2 == 1 {
			result *= base
			if modulo > 1 {
				result %= modulo
			}
		}
		base *= base
		if modulo > 1 {
			base %= modulo
		}
		exponent /= 2
	}
	return
}

//Gcd
func Gcd(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = gcd(result, vals[i])
	}
	return
}

func gcd(x, y int) int {
	x, y = AbsInt(x), AbsInt(y)
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

//Lcm
func Lcm(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = lcm(result, vals[i])
	}
	return
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

package main

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

func main() {
   for t := ScanInt(); t > 0; t-- {
      n := ScanInt()
      a := ScanIntSlice(n)
      if possible(a) {
         P("YES")
      } else {
         P("NO")
      }
   }

   close(O)
   oWg.Wait()
}

func possible(a []int) bool {

   _, mx := MnMx(a...)
   for i := 0; i < len(a); i++ {
      if !((mx-a[i])%2 == 0) {
         return false
      }
   }

   return true
}

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

var O chan string
var in *bufio.Scanner
var oWg *sync.WaitGroup
var P func(a ...interface{}) (n int, err error)

func init() {
   P = fmt.Println

   in = bufio.NewScanner(os.Stdin)
   in.Buffer(make([]byte, 1024), int(1e+9))
   in.Split(bufio.ScanWords)

   O = make(chan string, 16)
   oWg = &sync.WaitGroup{}
   oWg.Add(1)

   writer := bufio.NewWriter(os.Stdout)
   go func() {
      defer oWg.Done()
      defer writer.Flush()

      for line := range O {
         writer.WriteString(line + "\n")
      }
   }()
}

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

/*********************** Utils ***********************/

func S(v interface{}) string { return fmt.Sprintf("%v", v) }
func SArr(a []int) string {
   sb := strings.Builder{}
   sb.Grow(len(a) * 9)
   for i := range a {
      sb.WriteString(strconv.Itoa(a[i]) + " ")
   }
   return sb.String()
}
func SArr64(a []int64) string {
   sb := strings.Builder{}
   sb.Grow(len(a) * 9)
   for i := range a {
      sb.WriteString(strconv.FormatInt(a[i], 10) + " ")
   }
   return sb.String()
}
func MnMx(args ...int) (int, int) {
   minVal, maxVal := int(math.MaxInt32), int(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 int64) int64 { return a / GCD(a, b) * b }
func GCD(a, b int64) int64 {
   if a == 0 {
      return b
   }
   return GCD(b%a, a)
}
func sortInt64Slice(a []int64) { sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) }
func abs(x int64) int64 {
   if x < 0 {
      return -x
   }
   return x
}

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(r, &t)
	for tc := 0; tc < t; tc++ {
		var n int
		fmt.Fscan(r, &n)
		a := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(r, &a[i])
		}
		rls := solve(a)
		if rls {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

func solve(a []int) bool {
	odd, even := 0, 0
	for _, v := range a {
		if v%2 > 0 {
			odd++
		} else {
			even++
		}
	}
	return odd == 0 || even == 0
}

package main

import "fmt"

func Abs(x int) int {

	if x < 0 {
		return -x
	}

	return x
}

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

	fmt.Scan(&n)

	for i := 1; i <= n; i++ {
		q = 0

		fmt.Scan(&a)

		b := make([]int, a)

		for j := 0; j < a; j++ {
			fmt.Scan(&b[j])
		}

		for j := 0; j < a-1; j++ {
			if Abs(b[j]-b[j+1])%2 != 0 {
				fmt.Println("NO")
				q = 1
				break
			}
		}

		if q == 0 {
			fmt.Println("YES")
		}

	}

}

package main

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

var (
	reader Reader = NewReader()
	writer Writer = NewWriter()
)

type Reader interface {
	NextInt() int
	NextInt64() int64
	NextString() string
}

type Writer interface {
	Printf(format string, a ...interface{})
	Flush()
}

type readerImpl struct {
	*bufio.Scanner
}

func NewReader() Reader {
	s := bufio.NewScanner(os.Stdin)
	s.Split(bufio.ScanWords)
	return &readerImpl{Scanner: s}
}

func (i *readerImpl) NextInt() int {
	i.Scan()
	ret, _ := strconv.Atoi(i.Text())
	return ret
}

func (i *readerImpl) NextInt64() int64 {
	i.Scan()
	ret, _ := strconv.ParseInt(i.Text(), 10, 64)
	return ret
}

func (i *readerImpl) NextString() string {
	i.Scan()
	return i.Text()
}

type writerImpl struct {
	*bufio.Writer
}

func NewWriter() Writer {
	return &writerImpl{Writer: bufio.NewWriter(os.Stdout)}
}

func (i *writerImpl) Printf(f string, a ...interface{}) {
	fmt.Fprintf(i.Writer, f, a...)
}

func (i *writerImpl) Flush() {
	i.Writer.Flush()
}

func main() {
	defer writer.Flush()
	t := reader.NextInt()
	for ; t > 0; t-- {
		writer.Printf("%s\n", sol())
	}
}

func sol() string {
	n := reader.NextInt()
	hasOdd := false
	hasEven := false
    for i := 0; i < n; i++ {
		a := reader.NextInt()
		if a%2 == 0 {
			hasEven = true
		} else {
			hasOdd = true
		}
	}
    if n <= 1 {
        return "YES"
    }
    if hasOdd && hasEven {
        return "NO"
    }
    return "YES"
}

package main

import "fmt"

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

func main(){

	var t int

	fmt.Scanf("%d",&t)

	for T := 0 ; T < t; T ++ {
		var n int

		fmt.Scanf("%d",&n)

		a := make([]int , n)

		for i := 0 ; i < n ; i ++ {
			fmt.Scanf("%d",&a[i])
		}
		q := 0
		for i := 0 ; i + 1 < n ; i ++ {
			if Abs(a[i] - a[i + 1]) % 2 != 0 {
				q = 1
				fmt.Println("NO")
				break
			}
		}
		if q == 0 {
			fmt.Println("YES")
		}
	}

}

package main

import "fmt"

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

func main(){

	var t int

	fmt.Scanf("%d",&t)

	for T := 0 ; T < t; T ++ {
		var n int

		fmt.Scanf("%d",&n)

		a := make([]int , n)

		for i := 0 ; i < n ; i ++ {
			fmt.Scanf("%d",&a[i])
		}
		q := 0
		for i := 0 ; i + 1 < n ; i ++ {
			if Abs(a[i] - a[i + 1]) % 2 != 0 {
				q = 1
				fmt.Printf("NO\n")
				break
			}
		}
		if q == 0 {
			fmt.Printf("YES\n")
		}
	}

}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF1722F(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	dir8 := []struct{ x, y int }{{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}}

	var T, n, m int
o:
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n, &m)
		a := make([][]byte, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		var cnt, mix, miy, mxx, mxy int
		var f func(int, int)
		f = func(i, j int) {
			a[i][j] = '.'
			cnt++
			mix = min(mix, i)
			miy = min(miy, j)
			mxx = max(mxx, i)
			mxy = max(mxy, j)
			for _, d := range dir8 {
				if x, y := i+d.x, j+d.y; 0 <= x && x < n && 0 <= y && y < m && a[x][y] == '*' {
					f(x, y)
				}
			}
		}
		for i, row := range a {
			for j, b := range row {
				if b == '*' {
					cnt, mix, miy, mxx, mxy = 0, i, j, i, j
					f(i, j)
					if cnt != 3 || mix+1 != mxx || miy+1 != mxy {
						Fprintln(out, "NO")
						continue o
					}
				}
			}
		}
		Fprintln(out, "YES")
	}
}

func main() { CF1722F(os.Stdin, os.Stdout) }
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(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()

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

		aa := make([]string, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &aa[i])
		}

		bb := make([][]int, n)
		for i := range bb {
			bb[i] = make([]int, m)
		}

		f := true
		if n*m < 4 {
			f = false
		}
		c := 1
	Loop:
		for i := 0; i < n-1; i++ {
			for j := 0; j < m-1; j++ {
				a := aa[i][j : j+2]
				b := aa[i+1][j : j+2]
				if a == "*." && b == ".*" || a == ".*" && b == "*." || a == "**" && b == "**" {
					f = false
					break Loop
					// ** **
					// *. .*
				} else if (a == "**" && (b == ".*" || b == "*.")) || (b == "**" && (a == "*." || a == ".*")) {
					if bb[i][j] != 0 || bb[i+1][j] != 0 || bb[i][j+1] != 0 || bb[i+1][j+1] != 0 {
						f = false
						break Loop
					}
					if aa[i][j] == '*' {
						bb[i][j] = c
					}
					if aa[i][j+1] == '*' {
						bb[i][j+1] = c
					}
					if aa[i+1][j] == '*' {
						bb[i+1][j] = c
					}
					if aa[i+1][j+1] == '*' {
						bb[i+1][j+1] = c
					}
					c++
				}
			}
		}

		for i, row := range aa {
			for j, ch := range row {
				if ch == '.' {
					continue
				}
				if bb[i][j] == 0 {
					f = false
				}
			}
		}
		if f {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
	}
}

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 n, m int
		fmt.Fscan(in, &n, &m)

		aa := make([]string, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &aa[i])
		}

		bb := make([][]int, n)
		for i := range bb {
			bb[i] = make([]int, m)
		}

		f := true
		c := 1
	Loop:
		for i := 0; i < n-1; i++ {
			for j := 0; j < m-1; j++ {
				a := aa[i][j : j+2]
				b := aa[i+1][j : j+2]
				if a == "*." && b == ".*" || a == ".*" && b == "*." || a == "**" && b == "**" {
					f = false
					break Loop
					// ** **
					// *. .*
				} else if (a == "**" && (b == ".*" || b == "*.")) || (b == "**" && (a == "*." || a == ".*")) {
					if bb[i][j] != 0 || bb[i+1][j] != 0 || bb[i][j+1] != 0 || bb[i+1][j+1] != 0 {
						f = false
						break Loop
					}
					if aa[i][j] == '*' {
						bb[i][j] = c
					}
					if aa[i][j+1] == '*' {
						bb[i][j+1] = c
					}
					if aa[i+1][j] == '*' {
						bb[i+1][j] = c
					}
					if aa[i+1][j+1] == '*' {
						bb[i+1][j+1] = c
					}
					c++
				}
			}
		}

		for i, row := range aa {
			for j, ch := range row {
				if ch == '.' {
					continue
				}
				if bb[i][j] == 0 {
					f = false
				}
			}
		}
		if f {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
	}
}


// Author: sighduck
// URL: https://codeforces.com/problemset/problem/1186/D

package main

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

type Pair struct {
	Left  int
	Right int
}

func Solve(n int, a []float64) []int {
	pairs := make([]Pair, n)
	sum := 0
	for i, elem := range a {
		pairs[i].Left = int(math.Floor(elem))
		pairs[i].Right = int(math.Ceil(elem))
		sum += pairs[i].Left
	}
	b := make([]int, n)
	for i, pair := range pairs {
		if sum < 0 && pair.Left != pair.Right {
			b[i] = pair.Right
			sum += 1
		} else {
			b[i] = pair.Left
		}
	}
	return b
}

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

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(reader, "%f\n", &a[i])
	}

	b := Solve(n, a)
	for _, elem := range b {
		fmt.Fprintf(writer, "%d\n", elem)
	}
}

package main

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

func main() {
	var read = bufio.NewReader(os.Stdin)
	var write = bufio.NewWriter(os.Stdout)
	defer write.Flush()
	var n int
	fmt.Fscan(read, &n)
	var a = make([]float64, n)
	var d = make([]float64, n)
	var z = make([]int, n)
	var sumd float64
	for i := 0; i < n; i++ {
		fmt.Fscan(read, &a[i])
		z[i] = int(a[i])
		if a[i] < 0.0 && (a[i]-float64(z[i])) != 0 {
			z[i]--
		}
		d[i] = a[i] - float64(z[i])
		sumd = sumd + d[i]
	}
	var sumdint = int(math.Round(sumd))
	var k int
	var i int
	for k < sumdint {
		if d[i] == 0.0 {
			fmt.Fprintln(write, z[i])
			i++
			continue
		}
		fmt.Fprintln(write, z[i]+1)
		i++
		k++
	}
	for j := i; j < n; j++ {
		fmt.Fprintln(write, z[j])
	}

}

package main

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

func main() {
	var read = bufio.NewReader(os.Stdin)
	var write = bufio.NewWriter(os.Stdout)
	defer write.Flush()
	var n int
	fmt.Fscan(read, &n)
	var a = make([]float32, n)
	var d = make([]float32, n)
	var z = make([]int32, n)
	var sumd float32
	for i := 0; i < n; i++ {
		fmt.Fscan(read, &a[i])
		z[i] = int32(a[i])
		if a[i] < 0.0 {
			z[i]--
		}
		d[i] = a[i] - float32(z[i])
		sumd = sumd + d[i]
	}
	var sumdint = int(math.Round(float64(sumd)))
	var k int
	var i int
	for k < sumdint {
		if d[i] == 0.0 {
			fmt.Fprintln(write, z[i])
			i++
			continue
		}
		fmt.Fprintln(write, z[i]+1)
		i++
		k++
	}
	for j := i; j < n; j++ {
		fmt.Fprintln(write, z[j])
	}

}

package main

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

func main() {
	var read = bufio.NewReader(os.Stdin)
	var write = bufio.NewWriter(os.Stdout)
	defer write.Flush()
	var n int
	fmt.Fscan(read, &n)
	var a = make([]float64, n)
	var d = make([]float64, n)
	var z = make([]int, n)
	var sumd float64
	for i := 0; i < n; i++ {
		fmt.Fscan(read, &a[i])
		z[i] = int(a[i])
		if a[i] < 0.0 {
			z[i]--
		}
		d[i] = a[i] - float64(z[i])
		sumd = sumd + d[i]
	}
	var sumdint = int(math.Round(sumd))
	var k int
	var i int
	for k < sumdint {
		if d[i] == 0.0 {
			fmt.Fprintln(write, z[i])
			i++
			continue
		}
		fmt.Fprintln(write, z[i]+1)
		i++
		k++
	}
	for j := i; j < n; j++ {
		fmt.Fprintln(write, z[j])
	}

}

package main

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

func main() {
	var read = bufio.NewReader(os.Stdin)
	var write = bufio.NewWriter(os.Stdout)
	defer write.Flush()
	var n int
	fmt.Fscan(read, &n)
	var a = make([]float32, n)
	var d = make([]float32, n)
	var z = make([]int32, n)
	var sumd float32
	for i := 0; i < n; i++ {
		fmt.Fscan(read, &a[i])
		z[i] = int32(a[i])
		if z[i] < 0 {
			z[i]--
		}
		d[i] = a[i] - float32(z[i])
		sumd = sumd + d[i]
	}
	var sumdint = int(sumd)
	var k int
	var i int
	for k <= sumdint {
		if d[i] == 0.0 {
			i++
			continue
		}
		fmt.Fprintln(write, z[i]+1)
		i++
		k++
	}
	for j := i; j < n; j++ {
		fmt.Fprintln(write, z[j])
	}
}

package main

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

func main() {
	var read = bufio.NewReader(os.Stdin)
	var write = bufio.NewWriter(os.Stdout)
	defer write.Flush()
	var n int
	fmt.Fscan(read, &n)
	var a = make([]float32, n)
	var d = make([]float32, n)
	var z = make([]int32, n)
	var sumd float32
	for i := 0; i < n; i++ {
		fmt.Fscan(read, &a[i])
		z[i] = int32(a[i])
		if a[i] < 0.0 {
			z[i]--
		}
		d[i] = a[i] - float32(z[i])
		sumd = sumd + d[i]
	}
	var sumdint = int(math.Round(float64(sumd)))
	var k int
	var i int
	for k < sumdint {
		if d[i] == 0.0 {
			i++
			continue
		}
		fmt.Fprintln(write, z[i]+1)
		i++
		k++
	}
	for j := i; j < n; j++ {
		fmt.Fprintln(write, z[j])
	}

}


package main

import "bufio"
import "fmt"
import "os"
import "sort"
import "strconv"

var in = bufio.NewScanner(os.Stdin)

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func main() {
  cnt := 0
  n := readInt()
  ss := make([]int, n)

  for i := 0; i < n; i++ {
    ss[i] = readInt()
  }

  sort.Ints(ss)

  for i, j := 0, (n+1)/2; i < n/2 && j < n; j++ {
    if ss[i] * 2 <= ss[j] {
      cnt++
      i++
    }
  }

  fmt.Printf("%d\n", n - cnt)
}

package main

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

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

	ans := n
	for i, j := 0, (n+1)/2; i < n/2 && j < n; j++ {
		if a[i]*2 > a[j] {
			continue
		}
		i++
		ans--
	}
	fmt.Print(ans)
}

package main

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

func Qsort(a []int, low int, high int) {
	if low < high {
		pivot := Partition(a, low, high)
		Qsort(a, low, pivot-1)
		Qsort(a, pivot+1, high)
	}
}

func Partition(a []int, low int, high int) int {
	pivot := low + rand.Int()%(high-low+1)
	a[pivot], a[low] = a[low], a[pivot]
	i := low
	for j := low + 1; j <= high; j++ {
		if a[j] < a[low] {
			i++
			a[i], a[j] = a[j], a[i]
		}
	}
	a[i], a[low] = a[low], a[i]
	return i
}

func Kangaroos(a []int) {
	n := len(a)
	visable := n
	for low, high := n/2-1, n-1; low >= 0; low-- {
		if a[low]*2 <= a[high] {
			visable--
			high--
		}
	}
	fmt.Println(visable)
}

func main() {
	var n int
	r := bufio.NewReader(os.Stdin)
	fmt.Scanln(&n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscanln(r, &a[i])
	}
	Qsort(a, 0, n-1)
	Kangaroos(a)
}

package main

import (
	"bufio"
	"io"
	"os"
	"sort"
	"strconv"
)

type Scanner struct {
	r            io.Reader
	split        bufio.SplitFunc
	maxTokenSize int
	token, buf   []byte
	start, end   int
}

func NewScanner(r io.Reader) *Scanner {
	return &Scanner{
		r:            r,
		split:        bufio.ScanWords,
		maxTokenSize: 16777216,
		buf:          make([]byte, 4096),
	}
}

func (s *Scanner) advance(n int) bool {
	if n < 0 || n > s.end-s.start {
		return false
	}
	s.start += n
	return true
}

func (s *Scanner) Text() string {
	return string(s.token)
}

func (s *Scanner) Scan() bool {
	for {
		if s.end > s.start {
			advance, token, err := s.split(s.buf[s.start:s.end], false)
			if err != nil || !s.advance(advance) {
				return false
			}
			s.token = token
			if token != nil {
				return true
			}
		}
		if s.start > 0 && (s.end == len(s.buf) || s.start > len(s.buf)/2) {
			copy(s.buf, s.buf[s.start:s.end])
			s.end -= s.start
			s.start = 0
		}
		if s.end == len(s.buf) {
			if len(s.buf) >= s.maxTokenSize {
				return false
			}
			newSize := len(s.buf) * 2
			if newSize > s.maxTokenSize {
				newSize = s.maxTokenSize
			}
			newBuf := make([]byte, newSize)
			copy(newBuf, s.buf[s.start:s.end])
			s.buf = newBuf
			s.end -= s.start
			s.start = 0
			continue
		}
		for loop := 0; ; {
			n, _ := s.r.Read(s.buf[s.end:len(s.buf)])
			s.end += n
			if n > 0 {
				break
			}
			loop++
			if loop > 100 {
				break
			}
		}
	}
}

func (s *Scanner) Split(split bufio.SplitFunc) {
	s.split = split
}

var w *bufio.Writer = bufio.NewWriter(os.Stdout)
var sc *Scanner = NewScanner(os.Stdin)

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

func ni32() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

func ni64() int64 {
	sc.Scan()
	n, _ := strconv.ParseInt(sc.Text(), 10, 64)
	return n
}

func pri32(i ...int) {
	for _, ii := range i {
		w.WriteString(strconv.Itoa(ii))
		sp()
	}
}
func pri64(i ...int64) {
	for _, ii := range i {
		w.WriteString(strconv.FormatInt(ii, 10))
		sp()
	}
}
func sp()   { w.WriteByte(' ') }
func endl() { w.WriteByte('\n') }

func min(i, j int) int {
	if i < j {
		return i
	}
	return j
}

func max(i, j int) int {
	if i > j {
		return i
	}
	return j
}

type Int64Slice []int64

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

func main() {
	defer w.Flush()
	n := ni32()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = ni32()
	}
	sort.Ints(a)
	ans := sort.Search(n/2+1, func(j int) bool {
		if j == n/2+1 {
			return true
		}
		b := a[:j]
		c := a[n-j:]
		for i := 0; i < j; i++ {
			if c[i] < b[i]*2 {
				// fmt.Println(b, c, "true")
				return true
			}
		}
		// fmt.Println(b, c, "false")
		return false
	})
	pri32(n - ans + 1)
}

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(r, "%d\n", &n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(r, "%d\n", &a[i])
	}
	sort.Ints(a)

	ans := n
	for i, j := 0, (n+1)/2; i < n/2 && j < n; j++ {
		if a[i]*2 > a[j] {
			continue
		}
		i++
		ans--
	}
	fmt.Print(ans)
}

package main
import (
	"fmt"
	"sort"
	"bufio"
	"os"
	"strconv"
)
func main() {
	var n,i,j int
	fmt.Scan(&n)
	ans:=n
	a:=make([]int,n)
	input := bufio.NewScanner(os.Stdin)
	input.Split(bufio.ScanWords)
	for i=0;i<n;i++ {
		input.Scan()
		bb,_:=strconv.Atoi(input.Text())
		a[i]=bb
	}
	sort.Ints(a)
	j=(n+1)/2
	for i=0;i<n;i++ {
		if a[i]==0 {
			continue
		}
		for ;j<n && a[j]<2*a[i];j++ {}
		if j<n {
			a[i]=0
			a[j]=0
			ans--
		}
	}
	fmt.Println(ans)
}

package main

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

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    scanner.Split(bufio.ScanWords)

    ScanInts := func(a... *int) {
        for i := 0; i < len(a); i++ {
            scanner.Scan()
            *(a[i]), _ = strconv.Atoi(scanner.Text())
        }
    }

    var n int
    ScanInts(&n)
    s, f := make([]int,n), make([]bool,n)
    for i := 0; i < n; i++ { ScanInts(&s[i]) }
    sort.Ints(s)
    ans := n
    for i, j := 0, n/2; (i < n) && (j < n); {
        if !f[i] {
            if (2*s[i]) <= s[j] {
                ans--
                f[j] = true
                i++; j++;
            } else {
                j++
            }
        } else {
            i++
        }
    }
    fmt.Println(ans)
}

package main

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

var (
	in = bufio.NewReader(os.Stdin)
)

func getInt() int {
	x, sign := 0, 1
	ch, _ := in.ReadByte()
	for ch < '0' || ch > '9' {
		if ch == '-' {
			sign = -1
		}
		ch, _ = in.ReadByte()
	}
	for ch >= '0' && ch <= '9' {
		x *= 10
		x += int(ch - '0')
		ch, _ = in.ReadByte()
	}
	return x * sign
}

func main() {
	n := getInt()
	a := make([]int, n)
	for i := range a {
		a[i] = getInt()
	}
	sort.Ints(a)
	fmt.Printf("%d\n", n+1-sort.Search(n/2+1, func(x int) bool {
		for i, j := 0, n-x; i < x; i, j = i+1, j+1 {
			if a[i]*2 > a[j] {
				return true
			}
		}
		return false
	}))
}

package main

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

// github.com/EndlessCheng/codeforces-go
func Sol372A(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var n int
	Fscan(in, &n)
	arr := make([]int, n)
	for i := range arr {
		Fscan(in, &arr[i])
	}
	sort.Ints(arr)

	ans := n
	n2 := n / 2
	j := n2
	for i := 0; i < n2; i++ {
		for ; j < n; j++ {
			if 2*arr[i] <= arr[j] {
				ans--
				j++
				break
			}
		}
	}
	Fprint(out, ans)
}

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

package main

import "bufio"
import "fmt"
import "os"
import "sort"
import "strconv"

var in = bufio.NewScanner(os.Stdin)

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func main() {
  cnt := 0
  n := readInt()
  ss := make([]int, n)

  for i := 0; i < n; i++ {
    ss[i] = readInt()
  }

  sort.Ints(ss)

  for i, j := 0, (n+1)/2; i < n/2 && j < n; j++ {
    if ss[i] * 2 < ss[j] {
      cnt++
      i++
    }
  }

  fmt.Printf("%d\n", n - cnt)
}

package main

import "bufio"
import "fmt"
import "os"
import "sort"
import "strconv"

var in = bufio.NewScanner(os.Stdin)

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func main() {
  cnt := 0
  n := readInt()
  ss := make([]int, n)

  for i := 0; i < n; i++ {
    ss[i] = readInt()
  }

  sort.Ints(ss)

  for i, j := 0, (n+1)/2; i < n/2 && j < n; j++ {
    if ss[i] * 2 < ss[j] {
      continue
    }
    cnt++
    i++
  }

  fmt.Printf("%d\n", n - cnt)
}

package main

import "bufio"
import "fmt"
import "os"
import "sort"
import "strconv"

var in = bufio.NewScanner(os.Stdin)

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func main() {
  cnt := 0
  n := readInt()
  ss := make([]int, n)

  for i := 0; i < n; i++ {
    ss[i] = readInt()
  }

  sort.Ints(ss)

  for i, j := 0, (n+1)/2; i < n/2 && j < n; j++ {
    if ss[i] * 2 >= ss[j] {
      cnt++
      i++
    }
  }

  fmt.Printf("%d\n", n - cnt)
}

package main

import "bufio"
import "fmt"
import "os"
import "sort"
import "strconv"

var in = bufio.NewScanner(os.Stdin)

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func main() {
  cnt := 0
  n := readInt()
  ss := make([]int, n)

  for i := 0; i < n; i++ {
    ss[i] = readInt()
  }

  sort.Ints(ss)

  fmt.Printf("%v\n", ss)
  for i, j := 0, (n+1)/2; i < n/2 && j < n; j++ {
    if ss[i] * 2 < ss[j] {
      cnt++
      i++
    }
  }

  fmt.Printf("%d\n", n - cnt)
}

package main

import "bufio"
import "fmt"
import "os"
import "sort"
import "strconv"

var in = bufio.NewScanner(os.Stdin)

func init() {
  in.Split(bufio.ScanWords)
  buf := make([]byte, 2500000, 2500000)
  in.Buffer(buf, 0)
}

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func removeEleInArr(arr *[]int, i int) int {
  old := *arr
  ele := old[i]
  l := len(old)
  if(i > 0 && i < l-1) {
    front := old[0: i]
    back := old[i+1: l]
    *arr = append(front, back...)
  } else if i == 0{
    *arr = old[1 : l]
  } else {
    *arr = old[0: l-1]
  }

  return ele
}

func main() {
  n := readInt()

  ss := make([]int, n)
  for i := 0; i < n; i++ {
    ss[i] = readInt()
  }

  sort.Sort(sort.IntSlice(ss))

  cnt := 0
  for len(ss) > 0{
    cnt++;
    l := len(ss)
    maxInt := removeEleInArr(&ss, l-1)
    i := sort.Search(len(ss)-1, func(i int) bool { return ss[i+1] > maxInt/2 })

    if i != len(ss) && ss[i] <= maxInt/2{
      removeEleInArr(&ss, i)
    }
  }

  fmt.Printf("%d\n", cnt)
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	a := make([]int, n)
	for i := range a {
		fmt.Scanf("%d\n", &a[i])
	}
	sort.Ints(a)
	x := sort.Search(n, func(x int) bool {
		for i, j := 0, n-x; i < x; i, j = i+1, j+1 {
			if a[i]*2 > a[j] {
				return true
			}
		}
		return false
	})
	fmt.Printf("%d\n", n-x+1)
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	a := make([]int, n)
	for i := range a {
		fmt.Scanf("%d\n", &a[i])
	}
	sort.Ints(a)
	fmt.Printf("%d\n", n+1-sort.Search(n>>1, func(x int) bool {
		for i, j := 0, n-x; i < x; i, j = i+1, j+1 {
			if a[i]*2 > a[j] {
				return true
			}
		}
		return false
	}))
}

package main

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

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

	j := 0
	for i := 1; i < n; i++ {
		if a[j]*2 <= a[i] {
			a[j] = -1
			j++
			for a[j] == -1 {
				j++
			}
		}
	}

	ans := 0
	for _, x := range a {
		if x != -1 {
			ans++
		}
	}
	fmt.Print(ans)
}