Nastia has $$$2$$$ positive integers $$$A$$$ and $$$B$$$. She defines that:  The integer is good if it is divisible by $$$A \cdot B$$$;  Otherwise, the integer is nearly good, if it is divisible by $$$A$$$. For example, if $$$A = 6$$$ and $$$B = 4$$$, the integers $$$24$$$ and $$$72$$$ are good, the integers $$$6$$$, $$$660$$$ and $$$12$$$ are nearly good, the integers $$$16$$$, $$$7$$$ are neither good nor nearly good.Find $$$3$$$ different positive integers $$$x$$$, $$$y$$$, and $$$z$$$ such that exactly one of them is good and the other $$$2$$$ are nearly good, and $$$x + y = z$$$.

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10\,000$$$) — the number of test cases. The first line of each test case contains two integers $$$A$$$ and $$$B$$$ ($$$1 \le A \le 10^6$$$, $$$1 \le B \le 10^6$$$) — numbers that Nastia has.

For each test case print:    "YES" and $$$3$$$ different positive integers $$$x$$$, $$$y$$$, and $$$z$$$ ($$$1 \le x, y, z \le 10^{18}$$$) such that exactly one of them is good and the other $$$2$$$ are nearly good, and $$$x + y = z$$$.  "NO" if no answer exists.  YES NO If there are multiple answers, print any.

NoteIn the first test case: $$$60$$$ — good number; $$$10$$$ and $$$50$$$ — nearly good numbers.In the second test case: $$$208$$$ — good number; $$$169$$$ and $$$39$$$ — nearly good numbers.In the third test case: $$$154$$$ — good number; $$$28$$$ and $$$182$$$ — nearly good numbers.

package main

import (

	"fmt"
	"time"
	"math/rand"
	"bufio"
	"os"
)

func main() {

	r := bufio.NewReader(os.Stdin)

	rand.Seed(time.Now().UnixNano())

	var t int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var A, B int64

		fmt.Fscan(r, &A, &B)

		//fmt.Printf("A = %d B = %d", A, B)
		//fmt.Println()

		r, x, y, z := solve(A, B)

		if !r{
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", x, y, z)
			fmt.Println()
		}
	}
}

func solve(A, B int64) (bool, int64, int64, int64)  {
	if B == 1 {
		return false, -1, -1, -1
	}
	return true, int64((5 * B - 1) * A), int64(A), int64(5 * A * B)
}

package main

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

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

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

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()
	if len(os.Args[1:]) == 1 {
		file, _ := os.Open(os.Args[1])
		reader = bufio.NewReader(file)
	}

	var n int
	var a, b, j int64
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		scanf("%d %d\n", &a, &b)
		if b == 1 {
			printf("NO\n")
			continue
		}
		//c := gcd(a, b)
		if a%b == 0 {
			if b == 2 {
				b = 2 * b
			}
			printf("YES\n")
			printf("%d %d %d\n", a, a*(b-1), a*b)
			continue
		}
		//a = a / c
		//b = b / c
		if b == 2 {
			b = 2 * b
		}
		for j = 1; j < b; j++ {
			if j != b-j && j*a%b != 0 && (b-j)%b != 0 {
				printf("YES\n")
				printf("%d %d %d\n", j*a, (b-j)*a, a*b)
				break
			}
		}
	}

	//fmt.Println(gcd(10, 15))
}

// k1*a + k2*a = k3 *b * a
// k1 + k2 = k3 * b
// if k3 == 1, k1 + k2 == b
// k1 % b != 0, k2 % b != 0

package main

import (
	"fmt"
)

func main() {
	var testCases int
	_, err:=fmt.Scanf("%d\n", &testCases)
	if err!=nil{
		return
	}
	for i:=0; i < testCases; i++{
		var a, b uint64
		_, err = fmt.Scanf("%d %d\n", &a, &b);
		if err != nil{
			fmt.Println(err)
			return
		}
		if b == 1 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Println(a, (b)*a, (b+1)*a)
		}
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscanln(in, &t)

	for k := 0; k < t; k++ {
		var a, b int64
		fmt.Fscanln(in, &a, &b)
		x, y, z := a, a * (b - 1), a * b
		if b == 2 {
			x, y, z = a, a * 3, a * 4
		}
		if x % (a * b) == 0 || y % (a * b) == 0 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Println(x, y, z)
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int64
	fmt.Scanln(&t)

	for ; t > 0; t -= 1 {
		var A, B int64
		fmt.Scanln(&A, &B)

		if B == 1 {
			fmt.Println("NO")
			continue
		}

		fmt.Println("YES")
		fmt.Printf("%v %v %v", A, A*B, A*(B+1))
		fmt.Println()
	}
}

package main

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

func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}
func run(or io.Reader, ow io.Writer) {
	in := bufio.NewReader(or)
	out := bufio.NewWriter(ow)
	defer out.Flush()

	solve := func() {
		var A, B int64
		fmt.Fscan(in, &A, &B)
		if B == 1 {
			fmt.Fprintln(out, "NO")

		} else if B == 2 {
			fmt.Fprintln(out, "YES")
			fmt.Fprintln(out, A*1, A*(3), 2*A*B)
		}else {
			fmt.Fprintln(out, "YES")
			fmt.Fprintln(out, A*1, A*(B-1), A*B)
		}

	}

	T := 1
	fmt.Fscan(in, &T)
	for o := 0; o < T; o++ {
		solve()
	}

}

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

package main

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

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

func main() {
	defer out.Flush()
	var t int
	var a, b int64
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &a, &b)
		if b == 1 {
			Fprintln(out, "NO")
		} else {
			Fprintln(out, "YES")
			Fprintln(out, a, a*b, a*(b+1))
		}
	}
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
	t      int
	a, b   int64
)

func solve(a, b int64) string {
	if b == 1 {
		return "NO"
	}
	return fmt.Sprintf("YES\n%d %d %d", a, 2*a*b-a, a*b*2)
}

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

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
	t      int
	a, b   int64
)

func solve(a, b int64) string {
	if b == 1 {
		return "NO"
	}
	x := a
	y := a * (b - 1)
	if b == 2 {
		y = a * (2*b - 1)
	}
	return fmt.Sprintf("YES\n%d %d %d", x, y, x+y)
}

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

package main

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

type BufferIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

var bufferIO BufferIO = BufferIO{
	bufio.NewReader(os.Stdin),
	bufio.NewWriter(os.Stdout),
}

func scanf(format string, params ...interface{}) {
	fmt.Fscanf(bufferIO.reader, format, params...)
}

func printf(format string, params ...interface{}) {
	fmt.Fprintf(bufferIO.writer, format, params...)
}

func flush() {
	bufferIO.writer.Flush()
}

func solve() {
	var a, b int64

	scanf("%d %d\n", &a, &b)

	if b == 1 {
		printf("NO\n")
	} else if b == 2 {
		printf("YES\n%d %d %d\n", a*3, a*5, a*8)
	} else {
		printf("YES\n%d %d %d\n", a*1, a*(b-1), a*b)
	}
}

func main() {
	t := 1
	scanf("%d\n", &t)
	for t > 0 {
		solve()
		t--
	}
	flush()
}

package main

import "fmt"

func main() {
	var q int
	var a,b int64
	_, err := fmt.Scan(&q)
	if err != nil {
		return
	}
	for i := 0; i<q; i++ {
		_, err := fmt.Scan(&a,&b)
		if err != nil {
			return
		}
		if b==1 {
			fmt.Println("NO")
		} else {
			var x = a
			var y = a * b
			var z = a * (b+1)

			fmt.Println("YES")
			fmt.Println(x, y, z)
		}
	}
}

package main

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

func main() {
    reader := bufio.NewReader(os.Stdin)
    input, _ := reader.ReadString('\n')

	// Get t
	t, _ := GetInt(input)

	for j:=0; j<t; j++ {
		input, _ = reader.ReadString('\n')
		var a,b int64
		a, input = GetInt64(input)
		b, _ = GetInt64(input)
		if b == 1 {
			fmt.Printf("NO")

		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", a, (2*b-1)*a, 2*a*b)
		}
		fmt.Println()
	}
}

// func abs(val float64) float64 {
//     if val >= 0.0 {
//         return val
//     }
//     return -val
// }

func GetInt(s string) (result int, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.Atoi(s[:iter])
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}

func GetInt64(s string) (result int64, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.ParseInt(s[:iter], 10, 64)
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"strings"
)

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

	solve := func(Case int) {
		var a, b int64
		Fscan(in, &a, &b)
		if b == 1 {
			Fprintln(out, "NO")
			return
		}
		Fprintln(out, "YES")
		b = a * b
		//Fprintln(out, a, (b-1)*a, a*b)
		Fprintln(out, a , b , a+b )
	}

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

	_leftData, _ := ioutil.ReadAll(in)
	if _s := strings.TrimSpace(string(_leftData)); _s != "" {
		panic("There is unread data：\n" + _s)
	}
}

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

package main

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

func main() {

	r := bufio.NewReader(os.Stdin)

	//rand.Seed(time.Now().UnixNano())

	var t int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var A, B int64

		fmt.Fscan(r, &A, &B)

		//fmt.Printf("A = %d B = %d", A, B)
		//fmt.Println()

		r, x, y, z := solve(A, B)

		if !r {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", x, y, z)
			fmt.Println()
		}
	}
}

func solve(A, B int64) (bool, int64, int64, int64) {
	if B == 1 {
		return false, -1, -1, -1
	}
	return true, int64(A), int64(A*B), int64(A+(A*B))
}

package main
import (
    "os"
    "fmt"
    "bufio"
)
var rd = bufio.NewReader(os.Stdin)
func main() {
    q := 0
    fmt.Fscan(rd, &q);
    for t := 0; t < q; t++ {
        var a, b int64
        fmt.Fscan(rd, &a, &b)
        if b == 1 {
            fmt.Println("NO")
        } else {
            fmt.Println("YES")
            fmt.Println(a, a * b, a * (b + 1))
        }
    }
}

package main

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

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

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

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

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

func MKO(x, y int64) int64 {
	if x < y {
		return 0
	} else {
		return x - y + 1
	}
}

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

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

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

		}
		return initial
	}
}

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

	}
	return m

}

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

}

var t int

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

		fmt.Fscan(input, &B)
		if B == 1 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Println(A)
			var qq int64
			qq = int64(A) * int64(B)
			fmt.Println(qq)
			fmt.Println(qq + int64(A))
		}

	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"strings"
)

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

	solve := func(Case int) {
		var a, b int64
		Fscan(in, &a, &b)
		if b == 1 {
			Fprintln(out, "NO")
			return
		}
		Fprintln(out, "YES")
		b *= 2
		Fprintln(out, a, (b-1)*a, a*b)
	}

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

	_leftData, _ := ioutil.ReadAll(in)
	if _s := strings.TrimSpace(string(_leftData)); _s != "" {
		panic("有未读入的数据：\n" + _s)
	}
}

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

package main

import (

	"fmt"
	"time"
	"math/rand"
	"bufio"
	"os"
)

func main() {

	r := bufio.NewReader(os.Stdin)

	rand.Seed(time.Now().UnixNano())

	var t int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var A, B int

		fmt.Fscan(r, &A, &B)

		//fmt.Printf("A = %d B = %d", A, B)
		//fmt.Println()

		r, x, y, z := solve(A, B)

		if !r{
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", x, y, z)
			fmt.Println()
		}
	}
}

func solve(A, B int) (bool, int64, int64, int64)  {
	if B == 1 {
		return false, -1, -1, -1
	}
	return true, int64((5 * B - 1) * A), int64(A), int64(5 * A * B)
}

package main

import (

	"fmt"
	"time"
	"math/rand"
	"bufio"
	"os"
)

func main() {

	r := bufio.NewReader(os.Stdin)

	rand.Seed(time.Now().UnixNano())

	var t int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var A, B int

		fmt.Fscan(r, &A, &B)

		fmt.Printf("A = %d B = %d", A, B)
		fmt.Println()

		r, x, y, z := solve(A, B)

		if !r{
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", x, y, z)
			fmt.Println()
		}
	}
}

func solve(A, B int) (bool, int64, int64, int64)  {
	if B == 1 {
		return false, -1, -1, -1
	}
	return true, int64((5 * B - 1) * A), int64(A), int64(5 * A * B)
}

package main

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

func main() {

	r := bufio.NewReader(os.Stdin)

	var t int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var A, B int

		fmt.Fscan(r, &A, &B)

		r, x, y, z := solve(A, B)

		if !r{

			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", x, y, z)
			fmt.Println()
		}
	}
}

func solve(A, B int) (bool, int, int, int)  {
	if B == 1 {
		return false, -1, -1, -1
	}
	return true, (5 * B - 1) * A, A, 5 * A * B
}

package main

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

func main() {

	r := bufio.NewReader(os.Stdin)

	var t int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var A, B int

		fmt.Fscan(r, &A, &B)

		r, x, y, z := solve(A, B)

		if !r{
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", x, y, z)
			fmt.Println()
		}
	}
}

func solve(A, B int) (bool, int, int, int)  {
	return true, (5 * B - 1) * A, A, 5 * A * B
}

package main

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

func main() {

	r := bufio.NewReader(os.Stdin)

	var t int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var A, B int

		fmt.Fscan(r, &A, &B)

		r, x, y, z := solve(A, B)

		if !r{
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", x, y, z)
			fmt.Println()
		}
	}
}

func solve(A, B int) (bool, int, int, int)  {
	return true, 5 * A * B,  (5 * B - 1) * A, A
}

package main

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

func main() {

	r := bufio.NewReader(os.Stdin)

	var t int

	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var A, B int

		fmt.Fscan(r, &A, &B)

		r, x, y, z := solve(A, B)

		if !r{
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", x, y, z)
			fmt.Println()
		}
	}
}

func solve(A, B int) (bool, int, int, int)  {
	return true, 5 * A * B,  (5 * B - 1) * A, B * A
}

package main

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

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

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

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()
	if len(os.Args[1:]) == 1 {
		file, _ := os.Open(os.Args[1])
		reader = bufio.NewReader(file)
	}

	var n int
	var a, b, j int64
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		scanf("%d %d\n", &a, &b)
		//c := gcd(a, b)
		if a%b == 0 {
			if b == 2 {
				b = 2 * b
			}
			printf("YES\n")
			printf("%d %d %d\n", a, a*(b-1), a*b)
			continue
		}
		//a = a / c
		//b = b / c
		if b == 2 {
			b = 2 * b
		}
		for j = 1; j < b; j++ {
			if j != b-j && j*a%b != 0 && (b-j)%b != 0 {
				printf("YES\n")
				printf("%d %d %d\n", j*a, (b-j)*a, a*b)
				break
			}
		}
	}

	//fmt.Println(gcd(10, 15))
}

// k1*a + k2*a = k3 *b * a
// k1 + k2 = k3 * b
// if k3 == 1, k1 + k2 == b
// k1 % b != 0, k2 % b != 0

package main

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

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

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

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()
	if len(os.Args[1:]) == 1 {
		file, _ := os.Open(os.Args[1])
		reader = bufio.NewReader(file)
	}

	var n int
	var a, b, j int64
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		scanf("%d %d\n", &a, &b)
		//c := gcd(a, b)
		if a%b == 0 {
			printf("YES\n")
			printf("%d %d %d\n", a, a*(b-1), a*b)
			continue
		}
		//a = a / c
		//b = b / c
		if b == 2 {
			b = 2 * b
		}
		for j = 1; j < b; j++ {
			if j != b-j && j*a%b != 0 && (b-j)%b != 0 {
				printf("YES\n")
				printf("%d %d %d\n", j*a, (b-j)*a, a*b)
				break
			}
		}
	}

	//fmt.Println(gcd(10, 15))
}

// k1*a + k2*a = k3 *b * a
// k1 + k2 = k3 * b
// if k3 == 1, k1 + k2 == b
// k1 % b != 0, k2 % b != 0

package main

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

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

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

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()
	if len(os.Args[1:]) == 1 {
		file, _ := os.Open(os.Args[1])
		reader = bufio.NewReader(file)
	}

	var n int
	var a, b, j int64
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		scanf("%d %d\n", &a, &b)
		//c := gcd(a, b)
		if a%b == 0 {
			printf("YES\n")
			printf("%d %d %d\n", a, b, a+b)
			continue
		}
		//a = a / c
		//b = b / c
		if b == 2 {
			b = 2 * b
		}
		for j = 1; j < b; j++ {
			if j != b-j && j*a%b != 0 && (b-j)%b != 0 {
				printf("YES\n")
				printf("%d %d %d\n", j*a, (b-j)*a, a*b)
				break
			}
		}
	}

	//fmt.Println(gcd(10, 15))
}

// k1*a + k2*a = k3 *b * a
// k1 + k2 = k3 * b
// if k3 == 1, k1 + k2 == b
// k1 % b != 0, k2 % b != 0

package main

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

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

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

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()
	if len(os.Args[1:]) == 1 {
		file, _ := os.Open(os.Args[1])
		reader = bufio.NewReader(file)
	}

	var n int
	var a, b, j int64
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		scanf("%d %d\n", &a, &b)
		//c := gcd(a, b)
		if a%b == 0 {
			c := a / b
			printf("YES\n")
			printf("%d %d %d\n", b, (c-1)*b, a)
			continue
		}
		//a = a / c
		//b = b / c
		if b == 2 {
			b = 2 * b
		}
		for j = 1; j < b; j++ {
			if j != b-j && j*a%b != 0 && (b-j)%b != 0 {
				printf("YES\n")
				printf("%d %d %d\n", j*a, (b-j)*a, a*b)
				break
			}
		}
	}

	//fmt.Println(gcd(10, 15))
}

// k1*a + k2*a = k3 *b * a
// k1 + k2 = k3 * b
// if k3 == 1, k1 + k2 == b
// k1 % b != 0, k2 % b != 0

package main

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

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

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

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()
	if len(os.Args[1:]) == 1 {
		file, _ := os.Open(os.Args[1])
		reader = bufio.NewReader(file)
	}

	var n int
	var a, b, j int64
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		scanf("%d %d\n", &a, &b)
		//c := gcd(a, b)
		if a%b == 0 {
			printf("NO\n")
			continue
		}
		//a = a / c
		//b = b / c
		if b == 2 {
			b = 2 * b
		}
		for j = 1; j < b; j++ {
			if j != b-j && j*a%b != 0 && (b-j)%b != 0 {
				printf("YES\n")
				printf("%d %d %d\n", j*a, (b-j)*a, a*b)
				break
			}
		}
	}

	//fmt.Println(gcd(10, 15))
}

// k1*a + k2*a = k3 *b * a
// k1 + k2 = k3 * b
// if k3 == 1, k1 + k2 == b
// k1 % b != 0, k2 % b != 0

package main

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

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

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

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()
	if len(os.Args[1:]) == 1 {
		file, _ := os.Open(os.Args[1])
		reader = bufio.NewReader(file)
	}

	var n int
	var a, b, j int64
	scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		scanf("%d %d\n", &a, &b)
		//c := gcd(a, b)
		if a%b == 0 {
			printf("NO\n")
			continue
		}
		//a = a / c
		//b = b / c
		for j = 1; j < b; j++ {
			if j*a%b != 0 && (b-j)%b != 0 {
				printf("YES\n")
				printf("%d %d %d\n", j*a, (b-j)*a, a*b)
				break
			}
		}
	}

	//fmt.Println(gcd(10, 15))
}

// k1*a + k2*a = k3 *b * a
// k1 + k2 = k3 * b
// if k3 == 1, k1 + k2 == b
// k1 % b != 0, k2 % b != 0

package main

import (
	"fmt"
)

func main() {
	var testCases int
	_, err:=fmt.Scanf("%d\n", &testCases)
	if err!=nil{
		return
	}
	for i:=0; i < testCases; i++{
		var a, b int
		_, err = fmt.Scanf("%d %d\n", &a, &b);
		if err != nil{
			fmt.Println(err)
			return
		}
		if b == 1 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Println(a, (b)*a, (b+1)*a)
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var testCases int
	_, err:=fmt.Scanf("%d\n", &testCases)
	if err!=nil{
		return
	}
	for i:=0; i < testCases; i++{
		var a, b int
		_, err = fmt.Scanf("%d %d\n", &a, &b);
		if err != nil{
			fmt.Println(err)
			return
		}
		// calculate if its a no
		if a%b == 0 || b == 1 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Println(a, (b)*a, (b+1)*a)
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var testCases int
	_, err:=fmt.Scanf("%d\n", &testCases)
	if err!=nil{
		return
	}
	for i:=0; i < testCases; i++{
		var a, b int
		_, err = fmt.Scanf("%d %d\n", &a, &b);
		if err != nil{
			fmt.Println(err)
			return
		}
		// calculate if its a no
		if a%b == 0 || b == 1 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Println(a, (b-1)*a, b*a)
		}
	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var testCases int
	_, err:=fmt.Scanf("%d\n", &testCases)
	if err!=nil{
		return
	}
	for i:=0; i < testCases; i++{
		var a, b int
		_, err = fmt.Scanf("%d %d\n", &a, &b);
		if err != nil{
			fmt.Println(err)
			return
		}
		// calculate if its a no
		if a%b == 0 || b == 1 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			if b >= 3{
				fmt.Println(a, (b-1)*a, b*a)
			} else if b == 2{
				var firstTerm = a
				var secondTerm = (math.Pow(float64(b),2)-1) * float64(a)
				var thirdTerm = math.Pow(float64(b), 2)*float64(a)

				fmt.Println(firstTerm, secondTerm, thirdTerm)
			}
		}

	}
}

package main

import (
	"fmt"
	"math"
)

func main() {
	var testCases int
	_, err:=fmt.Scanf("%d\n", &testCases)
	if err!=nil{
		return
	}
	for i:=0; i < testCases; i++{
		var a, b int
		_, err = fmt.Scanf("%d %d\n", &a, &b);
		if err != nil{
			fmt.Println(err)
			return
		}
		// calculate if its a no
		if a%b == 0 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			if b >= 3{
				fmt.Println(a, (b-1)*a, b*a)
			} else if b == 2{
				var firstTerm = a
				var secondTerm = (math.Pow(float64(b),2)-1) * float64(a)
				var thirdTerm = math.Pow(float64(b), 2)*float64(a)

				fmt.Println(firstTerm, secondTerm, thirdTerm)
			}
		}

	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscanln(in, &t)

	for k := 0; k < t; k++ {
		var a, b int64
		fmt.Fscanln(in, &a, &b)
		x, y, z := a, a * (b - 1), a * b
		if b == 2 {
			x, y, z = a, a * 3, a * 4
		}
		if x % b == 0 || y % b == 0 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
			fmt.Println(x, y, z)
		}
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscanln(in, &t)

	for k := 0; k < t; k++ {
		var a, b int64
		fmt.Fscanln(in, &a, &b)
		if a % b == 0 {
			fmt.Println("NO")
		} else {
			x, y, z := a * b, a, a * (b + 1)
			fmt.Println("YES")
			fmt.Println(x, y, z)
		}
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscanln(in, &t)

	for k := 0; k < t; k++ {
		var a, b int64
		fmt.Fscanln(in, &a, &b)
		if a % b == 0 {
			fmt.Println("NO")
		} else {
			x, y, z := a, a * (b - 1), a * b
			if b == 2 {
				x, y, z = a, a * 3, a * 4
			}
			if x % b == 0 || y % b == 0 {
				fmt.Println("NO")
			} else {
				fmt.Println("YES")
				fmt.Println(x, y, z)
			}
		}
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscanln(in, &t)

	for k := 0; k < t; k++ {
		var a, b int64
		fmt.Fscanln(in, &a, &b)
		if a % b == 0 {
			fmt.Println("NO")
		} else {
			x, z := a, a * b
			y := z - x
			if x % b == 0 || y % b == 0 {
				fmt.Println("NO")
			} else {
				fmt.Println("YES")
				fmt.Println(x, y, z)
			}
		}
	}
}

package main

import (
	"fmt"
)

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

	for ; t > 0; t -= 1 {
		var A, B int
		fmt.Scanln(&A, &B)

		if B == 1 {
			fmt.Println("NO")
			continue
		}

		fmt.Println("YES")
		fmt.Printf("%d %d %d", A, A*B, A*(B+1))
		fmt.Println()
	}
}

package main

import (
	"fmt"
)

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

	for ; t > 0; t -= 1 {
		var A, B int
		fmt.Scanln(&A, &B)

		if B == 1 {
			fmt.Println("NO")
			return
		}

        fmt.Println("YES")
		fmt.Printf("%d %d %d", A, A*B, A*(B+1))
		fmt.Println()
	}
}

package main

import (
	"fmt"
)

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

	for ; t > 0; t -= 1 {
		var A, B int
		fmt.Scanln(&A, &B)

		if B == 1 {
			fmt.Println("NO")
			return
		}

		fmt.Printf("%d %d %d", A, A*B, A*(B+1))
		fmt.Println()
	}
}

package main

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

func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}
func run(or io.Reader, ow io.Writer) {
	in := bufio.NewReader(or)
	out := bufio.NewWriter(ow)
	defer out.Flush()

	solve := func() {
		var n int
		fmt.Fscan(in, &n)
		a := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &a[i])
		}
		o := 1000000007
		fmt.Fprintln(out, (n)/2)
		for i := 0; i+1 < n; i += 2 {
			fmt.Fprintln(out, i+1, i+2, a[i], o)
		}
		fmt.Fprintln(out)
	}

	T := 1
	fmt.Fscan(in, &T)
	for o := 0; o < T; o++ {
		solve()
	}

}

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

package main

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

func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}
func run(or io.Reader, ow io.Writer) {
	in := bufio.NewReader(or)
	out := bufio.NewWriter(ow)
	defer out.Flush()

	solve := func() {
		var A, B int64
		fmt.Fscan(in, &A, &B)
		if B <= 2 {
			fmt.Fprintln(out, "NO")

		} else {
			fmt.Fprintln(out, "YES")
			fmt.Fprintln(out, A*1, A*(B-1), A*B)
		}

	}

	T := 1
	fmt.Fscan(in, &T)
	for o := 0; o < T; o++ {
		solve()
	}

}

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

package main

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

func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}
func run(or io.Reader, ow io.Writer) {
	in := bufio.NewReader(or)
	out := bufio.NewWriter(ow)
	defer out.Flush()

	solve := func() {
		var A, B int64
		fmt.Fscan(in, &A, &B)
		if B == 1 {
			fmt.Fprintln(out, "NO")

		} else {
			fmt.Fprintln(out, "YES")
			fmt.Fprintln(out, A*1, A*(B-1), A*B)
		}

	}

	T := 1
	fmt.Fscan(in, &T)
	for o := 0; o < T; o++ {
		solve()
	}

}

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

package main

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

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

func main() {
	defer out.Flush()
	var t int
	var a, b int64
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &a, &b)
		if b == 1 {
			Fprintln(out, "NO")
		} else {
			Fprintln(out, a, "", a*b, "", a*(b+1))
		}
	}
}

package main

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

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

func main() {
	defer out.Flush()
	var t int
	var a, b int64
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &a, &b)
		if b == 1 {
			Fprintln(out, "NO")
		} else {
			Fprintln(out, a, " ", a*b, " ", a*(b+1))
		}
	}
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
	t      int
	a, b   int64
)

func solve(a, b int64) string {
	if b == 1 {
		return "NO"
	}
	return fmt.Sprintf("YES\n%d %d %d", a, a*(b-1), a*b)
}

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

package main

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

type BufferIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

var bufferIO BufferIO = BufferIO{
	bufio.NewReader(os.Stdin),
	bufio.NewWriter(os.Stdout),
}

func scanf(format string, params ...interface{}) {
	fmt.Fscanf(bufferIO.reader, format, params...)
}

func printf(format string, params ...interface{}) {
	fmt.Fprintf(bufferIO.writer, format, params...)
}

func flush() {
	bufferIO.writer.Flush()
}

func solve() {
	var a, b int64

	scanf("%d %d\n", &a, &b)

	if b == 1 {
		printf("NO\n")
	} else {
		printf("YES\n%d %d %d\n", a, a*(b-1), a*b)
	}
}

func main() {
	t := 1
	scanf("%d\n", &t)
	for t > 0 {
		solve()
		t--
	}
	flush()
}

package main

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

type BufferIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

var bufferIO BufferIO = BufferIO{
	bufio.NewReader(os.Stdin),
	bufio.NewWriter(os.Stdout),
}

func scanf(format string, params ...interface{}) {
	fmt.Fscanf(bufferIO.reader, format, params...)
}

func printf(format string, params ...interface{}) {
	fmt.Fprintf(bufferIO.writer, format, params...)
}

func flush() {
	bufferIO.writer.Flush()
}

func solve() {
	var a, b int

	scanf("%d %d\n", &a, &b)

	if b == 1 {
		printf("NO\n")
	} else {
		printf("YES\n%d %d\n", a*(b-1), a)
	}
}

func main() {
	t := 1
	scanf("%d\n", &t)
	for t > 0 {
		solve()
		t--
	}
	flush()
}

package main

import "fmt"

func main() {
	var q int
	var a,b int
	_, err := fmt.Scan(&q)
	if err != nil {
		return
	}
	for i := 0; i<q; i++ {
		_, err := fmt.Scan(&a,&b)
		if err != nil {
			return
		}
		if b==1 {
			fmt.Println("NO")
		} else {
			var x = a
			var y = a * b
			var z = a * (b+1)

			fmt.Println("YES")
			fmt.Println(x, y, z)
		}
	}
}

package main

import "fmt"

func main() {
	var q int
	var a,b int
	_, err := fmt.Scan(&q)
	if err != nil {
		return
	}
	for i := 0; i<q; i++ {
		_, err := fmt.Scan(&a,&b)
		if err != nil {
			return
		}
		if b==1 {
			println("NO")
		} else {
			var x = a
			var y = a * b
			var z = a * (b+1)

			println("YES")
			println(x, y, z)
		}
	}
}

package main

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

func main() {
    reader := bufio.NewReader(os.Stdin)
    input, _ := reader.ReadString('\n')

	// Get t
	t, _ := GetInt(input)

	for j:=0; j<t; j++ {
		input, _ = reader.ReadString('\n')
		var a,b int64
		a, input = GetInt64(input)
		b, _ = GetInt64(input)
		if a % b == 0 {
			fmt.Printf("NO")

		} else {
			fmt.Println("YES")
			fmt.Printf("%d %d %d", a, (2*b-1)*a, 2*a*b)
		}
		fmt.Println()
	}
}

// func abs(val float64) float64 {
//     if val >= 0.0 {
//         return val
//     }
//     return -val
// }

func GetInt(s string) (result int, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.Atoi(s[:iter])
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}

func GetInt64(s string) (result int64, output string) {
	iter, n := 0, len(s)
	for iter < n && s[iter] >= '0' && s[iter] <= '9' {
		iter++
	}
	result, _ = strconv.ParseInt(s[:iter], 10, 64)
	// Skip the redundant characters
	for iter < n && (s[iter] < '0' || s[iter] > '9') {
		iter++
	}
	if iter == n {
		output = ""

	} else {
		output = s[iter:]
	}
	return
}


You are given an array of integers $$$a$$$ of length $$$n$$$. The elements of the array can be either different or the same. Each element of the array is colored either blue or red. There are no unpainted elements in the array. One of the two operations described below can be applied to an array in a single step:  either you can select any blue element and decrease its value by $$$1$$$;  or you can select any red element and increase its value by $$$1$$$. Situations in which there are no elements of some color at all are also possible. For example, if the whole array is colored blue or red, one of the operations becomes unavailable.Determine whether it is possible to make $$$0$$$ or more steps such that the resulting array is a permutation of numbers from $$$1$$$ to $$$n$$$?In other words, check whether there exists a sequence of steps (possibly empty) such that after applying it, the array $$$a$$$ contains in some order all numbers from $$$1$$$ to $$$n$$$ (inclusive), each exactly once.

The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of input data sets in the test. The description of each set of input data consists of three lines. The first line contains an integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$) — the length of the original array $$$a$$$. The second line contains $$$n$$$ integers $$$a_1$$$, $$$a_2$$$, ..., $$$a_n$$$ ($$$-10^9 \leq a_i \leq 10^9$$$) — the array elements themselves. The third line has length $$$n$$$ and consists exclusively of the letters 'B' and/or 'R': $$$i$$$th character is 'B' if $$$a_i$$$ is colored blue, and is 'R' if colored red. It is guaranteed that the sum of $$$n$$$ over all input sets does not exceed $$$2 \cdot 10^5$$$.

Print $$$t$$$ lines, each of which contains the answer to the corresponding test case of the input. Print YES as an answer if the corresponding array can be transformed into a permutation, and NO otherwise. You can print the answer in any case (for example, the strings yEs, yes, Yes, and YES will be recognized as a positive answer).

NoteIn the first test case of the example, the following sequence of moves can be performed:  choose $$$i=3$$$, element $$$a_3=5$$$ is blue, so we decrease it, we get $$$a=[1,2,4,2]$$$;  choose $$$i=2$$$, element $$$a_2=2$$$ is red, so we increase it, we get $$$a=[1,3,4,2]$$$;  choose $$$i=3$$$, element $$$a_3=4$$$ is blue, so we decrease it, we get $$$a=[1,3,3,2]$$$;  choose $$$i=2$$$, element $$$a_2=2$$$ is red, so we increase it, we get $$$a=[1,4,3,2]$$$. We got that $$$a$$$ is a permutation. Hence the answer is YES.

package main

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

const (
	T_MIN      = 1
	T_MAX      = int(1e4)
	N_MIN      = 1
	N_MAX      = int(2 * 1e5)
	A_MIN      = int(-1e9)
	A_MAX      = int(1e9)
	DIFF_MAX   = A_MAX - A_MIN + 1
	ANSWER_NO  = "NO"
	ANSWER_YES = "YES"
	COLOR_BLUE = 'B'
	COLOR_RED  = 'R'
)

func diff(a int, b int) (result int) {
	result = a - b
	if result < 0 {
		result = -result
	}
	return
}

func test(n int, array []int, colors string) bool {
	arrayLength := len(array)
	blues := make([]int, 0, arrayLength)
	reds := make([]int, 0, arrayLength)

	for index, color := range colors {
		switch color {
		case COLOR_BLUE:
			blues = append(blues, array[index])
		case COLOR_RED:
			reds = append(reds, array[index])
		}
	}

	sort.Ints(blues)
	sort.Ints(reds)
	for i := 1; i <= n; i++ {
		diffToBlue := DIFF_MAX
		if len(blues) > 0 {
			diffToBlue = blues[0] - i
		}

		diffToRed := DIFF_MAX
		if len(reds) > 0 {
			diffToRed = i - reds[0]
		}

		if diffToBlue >= 0 && diffToBlue != DIFF_MAX {
			blues = blues[1:]
		} else if diffToRed >= 0 && diffToRed != DIFF_MAX {
			reds = reds[1:]
		} else {
			return false
		}
	}

	return true
}

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

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

		var array = make([]int, n)
		var colors string
		for j := 0; j < n; j++ {
			fmt.Fscan(reader, &array[j])
		}
		fmt.Fscan(reader, &colors)

		result := test(n, array, colors)
		if result {
			fmt.Println(ANSWER_YES)
		} else {
			fmt.Println(ANSWER_NO)
		}
	}
}

package main

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

const (
	T_MIN      = 1
	T_MAX      = int(1e4)
	N_MIN      = 1
	N_MAX      = int(2 * 1e5)
	A_MIN      = int(-1e9)
	A_MAX      = int(1e9)
	DIFF_MAX   = A_MAX - A_MIN + 1
	ANSWER_NO  = "NO"
	ANSWER_YES = "YES"
	COLOR_BLUE = 'B'
	COLOR_RED  = 'R'
)

func diff(a int, b int) (result int) {
	result = a - b
	if result < 0 {
		result = -result
	}
	return
}

func test(n int, array []int, colors string) bool {
	//fmt.Println("test", n, array, colors)

	arrayLength := len(array)
	blues := make([]int, 0, arrayLength)
	reds := make([]int, 0, arrayLength)

	for index, color := range colors {
		switch color {
		case COLOR_BLUE:
			blues = append(blues, array[index])
		case COLOR_RED:
			reds = append(reds, array[index])
		}
	}

	sort.Ints(blues)
	/*
		for _, element := range blues {
			fmt.Println("blues", element)
		}
	*/
	/*
		for i := 0; i < len(blues)/2; i++ {
			blues[i], blues[len(blues)-i-1] = blues[len(blues)-i-1], blues[i]
		}
	*/
	sort.Ints(reds)
	/*
		for _, element := range reds {
			fmt.Println("reds", element)
		}
	*/
	/*
		for i := 0; i < len(reds)/2; i++ {
			reds[i], reds[len(reds)-i-1] = reds[len(reds)-i-1], reds[i]
		}
	*/
	//	used := make([]bool, n)
	for i := 1; i <= n; i++ {
		diffToBlue := DIFF_MAX
		if len(blues) > 0 {
			diffToBlue = blues[0] - i
		}

		diffToRed := DIFF_MAX
		if len(reds) > 0 {
			diffToRed = i - reds[0]
		}

		//fmt.Println("diffs", diffToBlue, diffToRed)
		if diffToBlue >= 0 && diffToBlue != DIFF_MAX {
			blues = blues[1:]
		} else if diffToRed >= 0 && diffToRed != DIFF_MAX {
			reds = reds[1:]
		} else {
			return false
		}
	}

	return true
}

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

	var t int
	fmt.Fscan(reader, &t)
	//fmt.Println(t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(reader, &n)
		//fmt.Println(n)
		var array = make([]int, n)
		var colors string
		for j := 0; j < n; j++ {
			fmt.Fscan(reader, &array[j])
			//fmt.Print(array[j], " ")
		}
		fmt.Fscan(reader, &colors)
		//fmt.Println()
		//fmt.Println(colors)

		result := test(n, array, colors)
		if result {
			fmt.Println(ANSWER_YES)
		} else {
			fmt.Println(ANSWER_NO)
		}
	}
}

package main

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

const maxn = 200007

var a [maxn]int
var r [maxn]int
var b [maxn]int

func solve(in *bufio.Reader) string {
	var n int
	var s string
	fmt.Fscan(in, &n)
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a[i])
	}
	fmt.Fscan(in, &s)
	var rlen, blen int
	for i := 0; i < n; i++ {
		switch s[i] {
		case 'R':
			r[rlen] = a[i]
			rlen++
		case 'B':
			b[blen] = a[i]
			blen++
		}
	}
	if rlen > 0 {
		sort.Ints(r[:rlen])
	}
	if blen > 0 {
		sort.Ints(b[:blen])
	}
	var ri, bi int
	for i := 1; i <= n; i++ {
		if bi < blen {
			if b[bi] < i {
				return "NO"
			}
			bi++
		} else { // ri < rlen
			if r[ri] > i {
				return "NO"
			}
			ri++
		}
	}
	return "YES"
}

func main() {
	var T int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &T)
	for i := 0; i < T; i++ {
		fmt.Println(solve(in))
	}
}

package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"os"
	"runtime"
)

func die(v ...interface{}) {
	_, _, line, _ := runtime.Caller(1)
	fmt.Printf("die line %d: %v\n", line, v)
	os.Exit(-1)
}

func check(b bool) {
	if !b {
		_, _, line, _ := runtime.Caller(1)
		fmt.Printf("check failed line %d\n", line)
		os.Exit(-1)
	}
}

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

type IntHeap []int

func (h IntHeap) Len() int            { return len(h) }
func (h IntHeap) Less(i, j int) bool  { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)       { h[i], h[j] = h[j], h[i] }
func (h *IntHeap) Push(x interface{}) { *h = append(*h, x.(int)) }
func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

const (
	INIT = -1
)

var (
	n int
	a []int
	s string
)

func can() bool {
	up := &IntHeap{}
	down := &IntHeap{}
	heap.Init(up)
	heap.Init(down)
	for i := 0; i < n; i++ {
		if s[i] == 'B' {
			heap.Push(down, a[i])
		} else {
			heap.Push(up, a[i])
		}
	}

	for i := 1; i <= n; i++ {
		for down.Len() > 0 && (*down)[0] < i { // golang for Empty(), Top()
			heap.Pop(down)
		}
		if down.Len() > 0 && (*down)[0] >= i {
			heap.Pop(down)
			continue
		}
		if up.Len() > 0 && (*up)[0] <= i {
			heap.Pop(up)
			continue
		}
		return false
	}

	return true
}

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

	var tc int
	fmt.Fscan(r, &tc)

	for ; tc > 0; tc-- {
		fmt.Fscan(r, &n)
		a = make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(r, &a[i])
		}
		fmt.Fscan(r, &s)

		if can() {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}


Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows:   $$$f(0) = a$$$;  $$$f(1) = b$$$;  $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n > 1$$$, where $$$\oplus$$$ denotes the bitwise XOR operation. You are given three integers $$$a$$$, $$$b$$$, and $$$n$$$, calculate $$$f(n)$$$.You have to answer for $$$T$$$ independent test cases.

The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively.

NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$.

package main

import "fmt"

func main() {
	var T, n0, n1, n int

	fmt.Scanf("%d\r", &T)
	for i := 0; i < T; i++ {
		fmt.Scanf("%d %d %d\r", &n0, &n1, &n)
		fmt.Println(XORinacci(n0, n1, n))
	}
}

// XORinacci ...
func XORinacci(f0, f1, n int) int {
	if n%3 == 0 {
		return f0
	} else if n%3 == 1 {
		return f1
	} else {
		return f0 ^ f1
	}
}

package main

import (
  "fmt"
)

func main() {
    var t int
    _, _ = fmt.Scan(&t)
    for i := 0; i < t; i++ {
        var (a int; b int; n int)
        _, _ = fmt.Scan(&a, &b, &n)
        fmt.Println([]int{a,b,a^b}[n%3])
    }
}

package main

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

func main() {

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

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

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

	for i := 0; i < t; i++ {
		var a, b, n int
		fmt.Fscanf(reader, "%d %d %d\n", &a, &b, &n)
		if n%3 == 0 {
			fmt.Fprintf(writer, "%d", a)
		} else if n%3 == 1 {
			fmt.Fprintf(writer, "%d", b)
		} else {
			fmt.Fprintf(writer, "%d", a^b)
		}
		fmt.Fprintf(writer, "\n")
	}

	writer.Flush()
}

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

package main

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

func Solve(a, b, n int) int {
	if n%3 == 0 {
		return a
	} else if n%3 == 1 {
		return b
	}
	return a ^ b
}

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

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

package main

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

/* solution */

func solve() {

	t := readInt()
	for i := 0; i < t; i++ {
		solveOne(readInt64(), readInt64(), readInt64())
	}

}

func solveOne(a, b, n int64) {
	c := a ^ b
	n = n % 3
	switch n {
	case 0:
		printInt64(a)
	case 1:
		printInt64(b)
	case 2:
		printInt64(c)
	}
}

/* stubs */

func main() {

	var f *os.File
	if runtime.GOROOT() == "C:\\Soft\\Go" {
		f, _ = os.Open("input.txt")
		defer f.Close()
	} else {
		f = os.Stdin
	}

	writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	reader = bufio.NewScanner(f)

	const maxCapacity = 1024 * 1024
	buf := make([]byte, maxCapacity)
	reader.Buffer(buf, maxCapacity)

	reader.Split(bufio.ScanWords)

	solve()

}

var reader *bufio.Scanner
var writer *bufio.Writer

func read() string {
	reader.Scan()
	return reader.Text()
}

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

func print(s string) {
	writer.WriteString(s)
	writer.WriteString("\n")
}

func printInt(i int) {
	print(strconv.Itoa(i))
}

func printInt64(i int64) {
	print(strconv.FormatInt(i, 10))
}

func readInt64() int64 {
	reader.Scan()
	ret, _ := strconv.ParseInt(reader.Text(), 10, 64)
	return ret
}

package main
import (
	"fmt"
)
func main(){
	var t, a, b, n int
	fmt.Scanf("%d\n", &t);
	for tc := 0; tc < t; tc++ {
		fmt.Scanf("%d %d %d\n", &a, &b, &n);
		switch (n+1)%3 {
		case 0:
			fmt.Println(a^b)
		case 1:
			fmt.Println(a)
		case 2:
			fmt.Println(b)
		}
	}
}

package main

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

func main() {
	inputreader := bufio.NewReader(os.Stdin)
	var str string
	str,_= inputreader.ReadString('\n')
	str=strings.TrimSpace(str)
	temp:=strings.Split(str," ")
	T,_:= strconv.Atoi(temp[0])
	for T>0{
		str,_= inputreader.ReadString('\n')
		str=strings.TrimSpace(str)
		temp:=strings.Split(str," ")
		a,_:= strconv.Atoi(temp[0])
		b,_:= strconv.Atoi(temp[1])
		N,_:= strconv.Atoi(temp[2])
		if (N+1)%3==0{
			fmt.Println(a^b)
		}else if (N+2)%3==0{
			fmt.Println(b)
		}else{
			fmt.Println(a)
		}

		T--
	}

}

package main

import (
	"fmt"
)

type input struct {
	a, b, n int
}

func xorinacci0(a, b, n int) int {
	var x [3]int
	x[0] = a
	x[1] = b
	x[2] = a ^ b
	return x[n%3]

}

func main() {
	var n int
	fmt.Scan(&n)
	inputs := make([]input, n)
	for i := range inputs {
		fmt.Scan(&inputs[i].a)
		fmt.Scan(&inputs[i].b)
		fmt.Scan(&inputs[i].n)
	}
	for i := range inputs {
		fmt.Println(xorinacci0(inputs[i].a, inputs[i].b, inputs[i].n))
	}
}

//HOWDY! IT'S ME! A HARD BLACKISH DICK MOVE!
package main

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

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

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

//str := PrintlnInts(X...)

/*******************************************************************/
//(1,0)(0,1),(1,1),(1,0),(0,1)
func main() {
	aa := []int{1, 0, 1}
	bb := []int{0, 1, 1}
	for t := ReadInt(); t > 0; t-- {
		a, b, n := ReadInt3()
		m := n % 3
		ans := (a * aa[m]) ^ (b * bb[m])
		fmt.Println(ans)
	}

}

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

func min(args ...int) int {
	if len(args) == 0 {
		panic("empty!")
	}
	min := args[0]
	for i := 1; i < len(args); i++ {
		if args[i] < min {
			min = args[i]
		}
	}
	return min
}

func max(args ...int) int {
	if len(args) == 0 {
		panic("empty!")
	}
	max := args[0]
	for i := 1; i < len(args); i++ {
		if args[i] > max {
			max = args[i]
		}
	}
	return max
}

func _gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return _gcd(b, a%b)
}

func gcd(args ...int) int {
	if len(args) == 0 {
		panic("empty!")
	}
	gcd := args[0]
	for i := 1; i < len(args); i++ {
		gcd = _gcd(gcd, args[i])
	}
	return gcd
}

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

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

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9))
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

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

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

func readInt64() int64 {
	return readIntNbits(64)
}

func readInt() int {
	return int(readIntNbits(32))
}

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

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

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

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

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

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

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

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

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

	return string(res)
}

package main

import (
"fmt"
)

func main() {
	var test int
	fmt.Scan(&test)
	for test > 0 {
		var a, b, n int
		fmt.Scan(&a, &b, &n)
		n %= 3;
		if n == 0 {
			fmt.Println(a)
		}else if n == 1 {
			fmt.Println(b)
		}else if n == 2 {
			fmt.Println(a ^ b)
		}
		test--
	}
}

package main

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

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\r':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Read next line as []byte
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Simple math functions

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

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

func minll(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

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

func maxll(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

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

func absll(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// egcd(a, b) returns d, x, y:
//   d is gcd(a,b)
//   x, y are  integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcd(b, a%b)
	return d, y, x - a/b*y
}

func egcdll(a, b int64) (int64, int64, int64) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcdll(b, a%b)
	return d, y, x - a/b*y
}

func gcd(a, b int) int {
	d, _, _ := egcd(a, b)
	return d
}

func gcdll(a, b int64) int64 {
	d, _, _ := egcdll(a, b)
	return d
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}

func main() {
	defer Flush()

	t := readi()
	for i := 0; i < t; i++ {
		a := readi()
		b := readi()
		n := readi()
		println(solve(a, b, n))
	}
}

func solve(a, b, n int) int {
	res := []int{a, b, a ^ b}
	return res[n%3]
}

package main

import (
	"fmt"
)

func main() {
	t := 0
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		a := 0
		b := 0
		n := 0
		fmt.Scanln(&a, &b, &n)
		switch n % 3 {
		case 0:
			fmt.Println(a)
		case 1:
			fmt.Println(b)
		case 2:
			fmt.Println(a ^ b)
		}
	}
}

package main

import (
	"fmt"
)

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

		// a, b, a^b
		answer := 0
		if n % 3 == 0 {
			answer = a
		} else if n % 3 == 1 {
			answer = b
		} else {
			answer = a ^ b
		}

		fmt.Println(answer)
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	firstRow, err := reader.ReadString('\n')
	if err != nil {
		log.Fatal(err)
	}

	var firstRowfields = strings.Fields(firstRow)
	n, err := strconv.Atoi(firstRowfields[0])
	if err != nil {
		log.Fatal(err)
	}

	for i := 0; i < n; i++ {
			line, err := reader.ReadString('\n')
			ints, err := parseInts(line)
		if err != nil {
			log.Fatal(err)
		}

		xorResult := xorNumbers(ints[0], ints[1], ints[2])

		fmt.Println(xorResult)
	}
}

func parseInts(s string) ([]int, error) {
	var (
		fields = strings.Fields(s)
		ints   = make([]int, len(fields))
		err    error
	)
	for i, f := range fields {
		ints[i], err = strconv.Atoi(f)
		if err != nil {
			return nil, err
		}
	}
	return ints, nil
}

func xorNumbers(a int, b int, n int) int {
	if n % 3 == 0 {
		return a
	}

	if n % 3 == 1 {
		return b
	}

	return a ^ b
}

package main

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

func main() {
	read := bufio.NewReader(os.Stdin)
	n, a, b, c := 0, 0, 0, 0
	fmt.Fscanf(read, "%d\n", &n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(read, "%d %d %d\n", &a, &b, &c)
		switch c % 3 {
		case 0:
			fmt.Println(a)
		case 1:
			fmt.Println(b)
		default:
			fmt.Println(a ^ b)
		}
	}
}

package main

import "fmt"

func main() {
	var T, n0, n1, n int

	fmt.Scanf("%d", &T)
	for i := 0; i < T; i++ {
		fmt.Scanf("%d %d %d", &n0, &n1, &n)
		fmt.Println(XORinacci(n0, n1, n))
	}
}

// XORinacci ...
func XORinacci(f0, f1, n int) int {
	valMap := make(map[string]int)
	if n < 2 {
		return f0
	}
	valMap["first"] = f0
	valMap["second"] = f1

	for i := 2; i < n; i++ {
		newVal := valMap["first"] ^ valMap["second"]
		valMap["first"] = valMap["second"]
		valMap["second"] = newVal
	}

	return valMap["first"] ^ valMap["second"]
}

package main

import "fmt"

func main() {
	var T, n0, n1, n int

	fmt.Scanf("%d", &T)
	for i := 0; i < T; i++ {
		fmt.Scanf("%d %d %d", &n0, &n1, &n)
		fmt.Println(XORinacci(n0, n1, n))
	}
}

// XORinacci ...
func XORinacci(f0, f1, n int) int {
	if n < 2 {
		return f0
	}

	if n%3 == 0 {
		return f1
	} else if n%3 == 1 {
		return f1
	} else {
		return f0 ^ f1
	}
}

package main

import "fmt"

func main() {
	var T, n0, n1, n int

	fmt.Scanf("%d\r", &T)
	for i := 0; i < T; i++ {
		fmt.Scanf("%d %d %d\r", &n0, &n1, &n)
		fmt.Println(XORinacci(n0, n1, n))
	}
}

// XORinacci ...
func XORinacci(f0, f1, n int) int {
	if n < 2 {
		return f0
	}

	if n%3 == 0 {
		return f0
	} else if n%3 == 1 {
		return f1
	} else {
		return f0 ^ f1
	}
}

package main

import "fmt"

func main() {
	var T, n0, n1, n int

	fmt.Scanf("%d\r", &T)
	for i := 0; i < T; i++ {
		fmt.Scanf("%d %d %d\r", &n0, &n1, &n)
		fmt.Println("> ", n0, n1, n)
		fmt.Println(XORinacci(n0, n1, n))
	}
}

// XORinacci ...
func XORinacci(f0, f1, n int) int {
	valMap := make(map[string]int)
	if n < 2 {
		return f0
	}
	valMap["first"] = f0
	valMap["second"] = f1

	for i := 2; i < n; i++ {
		newVal := valMap["first"] ^ valMap["second"]
		valMap["first"] = valMap["second"]
		valMap["second"] = newVal
	}

	return valMap["first"] ^ valMap["second"]
}

package main

import "fmt"

func main() {
	var T, n0, n1, n int

	fmt.Scanf("%d\r", &T)
	for i := 0; i < T; i++ {
		fmt.Scanf("%d %d %d\r", &n0, &n1, &n)
		fmt.Println(XORinacci(n0, n1, n))
	}
}

// XORinacci ...
func XORinacci(f0, f1, n int) int {
	if n < 2 {
		return f0
	}

	if n%3 == 0 {
		return f1
	} else if n%3 == 1 {
		return f1
	} else {
		return f0 ^ f1
	}
}

package main

import (
  "fmt"
)

func main() {
    var (a int; b int; n int)
    _, _ = fmt.Scan(&a, &b, &n)

    fmt.Println([]int{a,b,a^b}[n%3])
}

package main
import (
	"fmt"
)
func main(){
	var t, a, b, n int
	fmt.Scanf("%d", &t);
	for tc := 0; tc < t; tc++ {
		fmt.Scanf("%d %d %d", &a, &b, &n);
		switch (n+1)%3 {
		case 0:
			fmt.Println(a^b)
		case 1:
			fmt.Println(a)
		case 2:
			fmt.Println(b)
		}
	}
}

package main

import (
"fmt"
)

func main() {
	fmt.Println("hey")
	var test int
	fmt.Scan(&test)
	for test > 0 {
		var a, b, n int
		fmt.Scan(&a, &b, &n)
		n %= 3;
		if n == 0 {
			fmt.Println(a)
		}else if n == 1 {
			fmt.Println(b)
		}else if n == 2 {
			fmt.Println(a ^ b)
		}
		test--
	}
}

package main

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

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\r':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Read next line as []byte
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Simple math functions

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

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

func minll(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

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

func maxll(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

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

func absll(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// egcd(a, b) returns d, x, y:
//   d is gcd(a,b)
//   x, y are  integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcd(b, a%b)
	return d, y, x - a/b*y
}

func egcdll(a, b int64) (int64, int64, int64) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcdll(b, a%b)
	return d, y, x - a/b*y
}

func gcd(a, b int) int {
	d, _, _ := egcd(a, b)
	return d
}

func gcdll(a, b int64) int64 {
	d, _, _ := egcdll(a, b)
	return d
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}

func main() {
	defer Flush()

	t := readi()
	for i := 0; i < t; i++ {
		a := readi()
		b := readi()
		n := readi()
		println(solve(a, b, n))
	}
}

func solve(a, b, n int) int {
	res := []int{a ^ b, (a ^ b) ^ b}
	if n == 0 {
		return a
	}
	if n == 1 {
		return a
	}
	return res[n%2]
}

package main

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

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\r':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Read next line as []byte
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Simple math functions

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

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

func minll(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

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

func maxll(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

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

func absll(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// egcd(a, b) returns d, x, y:
//   d is gcd(a,b)
//   x, y are  integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcd(b, a%b)
	return d, y, x - a/b*y
}

func egcdll(a, b int64) (int64, int64, int64) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcdll(b, a%b)
	return d, y, x - a/b*y
}

func gcd(a, b int) int {
	d, _, _ := egcd(a, b)
	return d
}

func gcdll(a, b int64) int64 {
	d, _, _ := egcdll(a, b)
	return d
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}

func main() {
	defer Flush()

	t := readi()
	for i := 0; i < t; i++ {
		a := readi()
		b := readi()
		n := readi()
		println(solve(a, b, n))
	}
}

func solve(a, b, n int) int {
	res := []int{a ^ b, (a ^ b) ^ b}
	if n == 0 {
		return a
	}
	if n == 1 {
		return b
	}
	return res[n%2]
}

package main

import (
	"fmt"
)

func main() {
	t := 0
	fmt.Scanf("%d", &t)
	for i := 0; i < t; i++ {
		a := 0
		b := 0
		n := 0
		fmt.Scanln(&a, &b, &n)
		switch n % 3 {
		case 0:
			fmt.Println(a)
		case 1:
			fmt.Println(b)
		case 2:
			fmt.Println(a ^ b)
		}
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	firstRow, err := reader.ReadString('\n')
	if err != nil {
		log.Fatal(err)
	}

	var firstRowfields = strings.Fields(firstRow)
	n, err := strconv.Atoi(firstRowfields[0])
	if err != nil {
		log.Fatal(err)
	}

	for i := 0; i < n; i++ {
			line, err := reader.ReadString('\n')
			ints, err := parseInts(line)
		if err != nil {
			log.Fatal(err)
		}

		xorResult := xorNumbers(ints[0], ints[1], ints[2])

		fmt.Println("xorResult:", xorResult)
	}
}

func xorNumbers(a int, b int, n int) int {
	if n == 0 {
		return a
	}

	if n == 1 {
		return b
	}

	if n == 2 {
		return a ^ b
	}

	var xorResult int
	am1 := b
	am2 := a
	for i := 0; i < n-1; i++ {
		xorResult = am1^am2
		am2 = am1
		am1 = xorResult
	}

	return xorResult
}

func parseInts(s string) ([]int, error) {
	var (
		fields = strings.Fields(s)
		ints   = make([]int, len(fields))
		err    error
	)
	for i, f := range fields {
		ints[i], err = strconv.Atoi(f)
		if err != nil {
			return nil, err
		}
	}
	return ints, nil
}


You are the head of a large enterprise. $$$n$$$ people work at you, and $$$n$$$ is odd (i. e. $$$n$$$ is not divisible by $$$2$$$).You have to distribute salaries to your employees. Initially, you have $$$s$$$ dollars for it, and the $$$i$$$-th employee should get a salary from $$$l_i$$$ to $$$r_i$$$ dollars. You have to distribute salaries in such a way that the median salary is maximum possible.To find the median of a sequence of odd length, you have to sort it and take the element in the middle position after sorting. For example:  the median of the sequence $$$[5, 1, 10, 17, 6]$$$ is $$$6$$$,  the median of the sequence $$$[1, 2, 1]$$$ is $$$1$$$. It is guaranteed that you have enough money to pay the minimum salary, i.e $$$l_1 + l_2 + \dots + l_n \le s$$$.Note that you don't have to spend all your $$$s$$$ dollars on salaries.You have to answer $$$t$$$ test cases.

The first line contains one integer $$$t$$$ ($$$1 \le t \le 2 \cdot 10^5$$$) — the number of test cases. The first line of each query contains two integers $$$n$$$ and $$$s$$$ ($$$1 \le n < 2 \cdot 10^5$$$, $$$1 \le s \le 2 \cdot 10^{14}$$$) — the number of employees and the amount of money you have. The value $$$n$$$ is not divisible by $$$2$$$. The following $$$n$$$ lines of each query contain the information about employees. The $$$i$$$-th line contains two integers $$$l_i$$$ and $$$r_i$$$ ($$$1 \le l_i \le r_i \le 10^9$$$). It is guaranteed that the sum of all $$$n$$$ over all queries does not exceed $$$2 \cdot 10^5$$$. It is also guaranteed that you have enough money to pay the minimum salary to each employee, i. e. $$$\sum\limits_{i=1}^{n} l_i \le s$$$.

For each test case print one integer — the maximum median salary that you can obtain.

NoteIn the first test case, you can distribute salaries as follows: $$$sal_1 = 12, sal_2 = 2, sal_3 = 11$$$ ($$$sal_i$$$ is the salary of the $$$i$$$-th employee). Then the median salary is $$$11$$$.In the second test case, you have to pay $$$1337$$$ dollars to the only employee.In the third test case, you can distribute salaries as follows: $$$sal_1 = 4, sal_2 = 3, sal_3 = 6, sal_4 = 6, sal_5 = 7$$$. Then the median salary is $$$6$$$.

package main

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

// github.com/EndlessCheng/codeforces-go
func Sol1251D(reader io.Reader, writer io.Writer) {
	search := func(n int64, f func(int64) bool) int64 {
		i, j := int64(0), n
		for i < j {
			h := (i + j) >> 1
			if f(h) {
				j = h
			} else {
				i = h + 1
			}
		}
		return i
	}
	type pair struct{ l, r int64 }
	in := bufio.NewScanner(reader)
	in.Split(bufio.ScanWords)
	out := bufio.NewWriter(writer)
	defer out.Flush()
	readInt := func() (x int64) {
		in.Scan()
		for _, b := range in.Bytes() {
			x = x*10 + int64(b-'0')
		}
		return
	}

	for q := int(readInt()); q > 0; q-- {
		n := int(readInt())
		money := readInt()
		baseCost := int64(0)
		ps := make([]pair, n)
		for i := range ps {
			ps[i].l, ps[i].r = readInt(), readInt()
			baseCost += ps[i].l
		}
		sort.Slice(ps, func(i, j int) bool { return ps[i].l > ps[j].l })
		ans := search(money+1e9+1, func(x int64) bool {
			cnt := 0
			cost := baseCost
			for _, p := range ps {
				if p.r >= x {
					cnt++
					if p.l < x {
						cost += x - p.l
					}
					if 2*cnt-1 == n {
						if p.l > x {
							return !true
						}
						return !(cost <= money)
					}
				}
			}
			return !false
		})
		Fprintln(out, ans-1)
	}
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func Sol1251D(reader io.Reader, writer io.Writer) {
	search := func(n int64, f func(int64) bool) int64 {
		i, j := int64(0), n
		for i < j {
			h := (i + j) >> 1
			if f(h) {
				j = h
			} else {
				i = h + 1
			}
		}
		return i
	}
	type pair struct{ l, r int64 }
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var q, n int
	for Fscan(in, &q); q > 0; q-- {
		var money, baseCost int64
		Fscan(in, &n, &money)
		ps := make([]pair, n)
		for i := range ps {
			Fscan(in, &ps[i].l, &ps[i].r)
			baseCost += ps[i].l
		}
		sort.Slice(ps, func(i, j int) bool { return ps[i].l > ps[j].l })
		ans := search(money+1e9+1, func(x int64) bool {
			cnt := 0
			cost := baseCost
			for _, p := range ps {
				if p.r >= x {
					cnt++
					if p.l < x {
						cost += x - p.l
					}
					if 2*cnt-1 == n {
						if p.l > x {
							return !true
						}
						return !(cost <= money)
					}
				}
			}
			return !false
		})
		Fprintln(out, ans-1)
	}
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func Sol1251D(reader io.Reader, writer io.Writer) {
	search := func(n int64, f func(int64) bool) int64 {
		i, j := int64(0), n
		for i < j {
			h := (i + j) >> 1
			if f(h) {
				j = h
			} else {
				i = h + 1
			}
		}
		return i
	}
	type pair struct{ l, r int64 }
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	var q, n int
	for Fscan(in, &q); q > 0; q-- {
		var money, baseCost int64
		Fscan(in, &n, &money)
		ps := make([]pair, n)
		for i := range ps {
			Fscan(in, &ps[i].l, &ps[i].r)
			baseCost += ps[i].l
		}
		sort.Slice(ps, func(i, j int) bool { return ps[i].l > ps[j].l })
		ans := search(money+1e9+1, func(x int64) bool {
			cnt := 0
			cost := baseCost
			for _, p := range ps {
				if p.r >= x {
					cnt++
					if p.l < x {
						cost += x - p.l
					}
					if 2*cnt-1 == n {
						return !(cost <= money)
					}
				}
			}
			return !false
		})
		Fprintln(out, ans-1)
	}
}

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

package main

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

type point struct {
	x, y int
}

var ans int64

const (
	mod = int(1e9 + 7)
)

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	tt := 1
	fmt.Fscanf(in, "%d\n", &tt)
	for ii := 0; ii < tt; ii++ {
		n, s := 0, int64(0)
		fmt.Fscanf(in, "%d %d\n", &n, &s)
		a := make([][]int, n)
		for i := 0; i < n; i++ {
			a[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &a[i][0], &a[i][1])
		}
		l := 0
		r := 1000000000
		//fmt.Println("debug1", a)
		for l < r {
			mid := (l + r + 1) / 2
			//fmt.Println("debug2", l, r, mid)
			if !ok(mid, a, s) {
				r = mid - 1
			} else {
				l = mid
			}
		}
		fmt.Fprintf(out, "%d\n", l)
	}
	return
}

// if median can be larger or equal to mid
func ok(mid int, a [][]int, s int64) bool {
	n := len(a)
	b := make([]int, n) // salary
	cost := int64(0)
	c := make([]int, 0) // which can be larger then mid
	for i := 0; i < n; i++ {
		if a[i][1] >= mid {
			if a[i][0] <= mid {
				b[i] = mid
			} else {
				b[i] = a[i][0]
			}
			c = append(c, i)
		} else {
			b[i] = a[i][0]
		}
		cost += int64(b[i])
	}
	//fmt.Println("debug3", c)
	if len(c) < (n+1)/2 {
		return false
	}
	save := make([]int, 0)
	for i := 0; i < len(c); i++ {
		id := c[i]
		if a[id][0] <= mid {
			save = append(save, b[id]-a[id][0])
		}
	}

	sort.Ints(save)
	needSave := n/2 - (n - len(c))
	if needSave > len(save) {
		needSave = len(save)
	}
	for i := 0; i < needSave; i++ {
		cost -= int64(save[len(save)-1-i])
	}
	if cost <= s {
		return true
	}
	return false
}

package main

import (
	"bufio"
	"bytes"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"sort"
)

type EM struct {
	l int64
	r int64
}

type LS []EM

func (ls LS) Swap(i, j int) {
	ls[i], ls[j] = ls[j], ls[i]
}
func (ls LS) Less(i, j int) bool {
	return ls[i].l < ls[j].l
}

func (ls LS) Len() int {
	return int(n)
}

type RS []EM

func (rs RS) Swap(i, j int) {
	rs[i], rs[j] = rs[j], rs[i]
}
func (rs RS) Less(i, j int) bool {
	return rs[i].r < rs[j].r
}

func (rs RS) Len() int {
	return int(n)
}

var n int64

func GetReaderWriter() (io.Reader, *bufio.Writer) {
	local := os.Getenv("LOCAL")
	if local == "" {
		return bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	}
	bs, _ := ioutil.ReadFile("in.txt")
	treader := bytes.NewBuffer(bs)
	reader := bufio.NewReader(treader)

	return reader, bufio.NewWriter(os.Stdout)
}

func main() {

	reader, writer := GetReaderWriter()
	defer writer.Flush()

	var t, s int64
	ems := make([]EM, 200001)

	_, _ = Fscanf(reader, "%d\n", &t)
	for t > 0 {
		t--
		var l, r, mid, i int64
		_, _ = Fscanf(reader, "%d %d\n", &n, &s)
		for i = 0; i < n; i++ {
			_, _ = Fscanf(reader, "%d %d\n", &ems[i].l, &ems[i].r)
		}
		sort.Sort(sort.Reverse(RS(ems)))
		r = ems[n/2].r
		sort.Sort(sort.Reverse(LS(ems)))
		l = ems[n/2].l

		for l < r {
			mid = (l + r) / 2
			if l == mid {
				mid++
			}
			sum := int64(0)
			cnt := int64(0)

			for i = 0; i < n; i++ {
				if mid < ems[i].l {
					sum += ems[i].l
					cnt++
				} else if ems[i].l <= mid && mid <= ems[i].r {
					if cnt >= (n+1)/2 {
						sum += ems[i].l
					} else {
						sum += mid
						cnt++
					}
				} else {
					sum += ems[i].l
				}
			}
			if cnt >= (n+1)/2 && sum <= s {
				l = mid
			} else {
				r = mid - 1
			}
		}

		_, _ = Fprintf(writer, "%d\n", l)
	}
}

package main

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

type point struct {
	x, y int
}

var ans int64

const (
	mod = int(1e9 + 7)
)

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	tt := 1
	fmt.Fscanf(in, "%d\n", &tt)
	for ii := 0; ii < tt; ii++ {
		n, s := 0, int64(0)
		fmt.Fscanf(in, "%d %d\n", &n, &s)
		a := make([][]int, n)
		for i := 0; i < n; i++ {
			a[i] = make([]int, 2)
			fmt.Fscanf(in, "%d %d\n", &a[i][0], &a[i][1])
		}
		l := 0
		r := 1000000000
		//fmt.Println("debug1", a)
		for l < r {
			mid := (l + r + 1) / 2
			//fmt.Println("debug2", l, r, mid)
			if !ok(mid, a, s) {
				r = mid - 1
			} else {
				l = mid
			}
		}
		fmt.Fprintf(out, "%d\n", l)
	}
	return
}

// if median can be larger or equal to mid
func ok(mid int, a [][]int, s int64) bool {
	n := len(a)
	b := make([]int, n) // salary
	cost := int64(0)
	c := make([]int, 0) // which can be larger then mid
	for i := 0; i < n; i++ {
		if a[i][1] >= mid {
			if a[i][0] <= mid {
				b[i] = mid
			} else {
				b[i] = a[i][0]
			}
			c = append(c, i)
		} else {
			b[i] = a[i][0]
		}
		cost += int64(b[i])
	}
	//fmt.Println("debug3", c)
	if len(c) < (n+1)/2 {
		return false
	}
	save := make([]int, 0)
	for i := 0; i < len(c); i++ {
		id := c[i]
		if a[id][0] <= mid {
			save = append(save, b[id]-a[id][0])
		}
	}

	sort.Ints(save)
	needSave := n/2 - (n - len(c))
	if needSave > len(save) {
		return false
	}
	for i := 0; i < needSave; i++ {
		cost -= int64(save[len(save)-1-i])
	}
	if cost <= s {
		return true
	}
	return false
}

package main

import (
	"bufio"
	"bytes"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"sort"
)

type EM struct {
	l int64
	r int64
}

type LS []EM

func (ls LS) Swap(i, j int) {
	ls[i], ls[j] = ls[j], ls[i]
}
func (ls LS) Less(i, j int) bool {
	return ls[i].l < ls[j].l
}

func (ls LS) Len() int {
	return int(n)
}

type RS []EM

func (rs RS) Swap(i, j int) {
	rs[i], rs[j] = rs[j], rs[i]
}
func (rs RS) Less(i, j int) bool {
	return rs[i].r < rs[j].r
}

func (rs RS) Len() int {
	return int(n)
}

var n int64

func GetReaderWriter() (io.Reader, *bufio.Writer) {
	local := os.Getenv("LOCAL")
	if local == "" {
		return bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	}
	bs, _ := ioutil.ReadFile("in.txt")
	treader := bytes.NewBuffer(bs)
	reader := bufio.NewReader(treader)

	return reader, bufio.NewWriter(os.Stdout)
}

func main() {

	reader, writer := GetReaderWriter()
	defer writer.Flush()

	var t, s int64
	ems := make([]EM, 200001)

	_, _ = Fscanf(reader, "%d\n", &t)
	for t > 0 {
		t--
		var l, r, mid, i int64
		_, _ = Fscanf(reader, "%d %d\n", &n, &s)
		for i = 0; i < n; i++ {
			_, _ = Fscanf(reader, "%d %d\n", &ems[i].l, &ems[i].r)
		}
		sort.Sort(sort.Reverse(RS(ems)))
		r = ems[n/2].r
		sort.Sort(sort.Reverse(LS(ems)))
		l = ems[n/2].l

		for l < r {
			mid = (l + r) / 2
			sum := int64(0)
			cnt := int64(0)

			for i = 0; i < n; i++ {
				if mid < ems[i].l {
					sum += ems[i].l
					cnt++
				} else if ems[i].l <= mid && mid < ems[i].r {
					if cnt >= (n+1)/2 {
						sum += ems[i].l
					} else {
						sum += mid
						cnt++
					}
				} else {
					sum += ems[i].l
				}
			}
			if cnt >= (n+1)/2 && sum <= s {
				l = mid
				if r == l+1 {
					l = r
				}
			} else {
				r = mid - 1
			}
		}

		_, _ = Fprintf(writer, "%d\n", l)
	}
}


You have array a that contains all integers from 1 to n twice. You can arbitrary permute any numbers in a.Let number i be in positions xi, yi (xi < yi) in the permuted array a. Let's define the value di = yi - xi — the distance between the positions of the number i. Permute the numbers in array a to minimize the value of the sum .

The only line contains integer n (1 ≤ n ≤ 5·105).

Print 2n integers — the permuted array a that minimizes the value of the sum s.

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

//Wrong
func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	n := nextInt()
	a := 1

	for ; a <= n; a += 2 {
		print(a, " ")
	}

	if n%2 == 1 {
		a -= 2
	}

	for a -= 2; a > 0; a -= 2 {
		print(a, " ")
	}

	for a = 2; a <= n; a += 2 {
		print(a, " ")
	}

	if n%2 == 0 {
		a -= 2
	}

	for a -= 2; a > 0; a -= 2 {
		print(a, " ")
	}

	println(n)
}

func next() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

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

func nextFloat() float64 {
	n, _ := strconv.ParseFloat(next(), 64)
	return n
}

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

//Wrong
func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	n := nextInt()
	a := 1

	for ; a <= n; a += 2 {
		printf("%d ", a)
	}

	if n%2 == 1 {
		a -= 2
	}

	for a -= 2; a > 0; a -= 2 {
		printf("%d ", a)
	}

	for a = 2; a <= n; a += 2 {
		printf("%d ", a)
	}

	if n%2 == 0 {
		a -= 2
	}

	for a -= 2; a > 0; a -= 2 {
		printf("%d ", a)
	}

	println(n)
}

func next() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

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

func nextFloat() float64 {
	n, _ := strconv.ParseFloat(next(), 64)
	return n
}

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

//Wrong
func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	n := nextInt()

	// for i, a, end := 0, 1, n+n%2; i < end; i++ {
	// 	if i < end/2 {
	// 		printf("%d ", a)
	// 		a += 2
	// 	} else {
	// 		a -= 2
	// 		printf("%d ", a)
	// 	}
	// }

	a := 1

	for ; a <= n; a += 2 {
		printf("%d ", a)
	}

	if n%2 == 1 {
		a -= 2
	}

	for a -= 2; a > 0; a -= 2 {
		printf("%d ", a)
	}

	if n%2 == 1 {
		printf("%d ", n)
	}

	for i, a, end := 0, 2, n-n%2; i < end; i++ {
		if i < end/2 {
			printf("%d ", a)
			a += 2
		} else {
			a -= 2
			printf("%d ", a)
		}
	}

	println()
}

func next() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

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

func nextFloat() float64 {
	n, _ := strconv.ParseFloat(next(), 64)
	return n
}

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }

package main

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

var (
	writer  = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
)

//Wrong
func main() {
	defer writer.Flush()
	scanner.Split(bufio.ScanWords)

	n := nextInt()

	for i, a, end := 0, 1, n+n%2; i < end; i++ {

		if i < end/2 {
			printf("%d ", a)
			a += 2
		} else {
			a -= 2
			printf("%d ", a)
		}

	}

	for i, a, end := 0, 2, n-n%2; i < end; i++ {

		if i < end/2 {
			printf("%d ", a)
			a += 2
		} else {
			a -= 2
			printf("%d ", a)
		}

	}

	println()
}

func next() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

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

func nextFloat() float64 {
	n, _ := strconv.ParseFloat(next(), 64)
	return n
}

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }


You are given two strings s and t consisting of small Latin letters, string s can also contain '?' characters. Suitability of string s is calculated by following metric:Any two letters can be swapped positions, these operations can be performed arbitrary number of times over any pair of positions. Among all resulting strings s, you choose the one with the largest number of non-intersecting occurrences of string t. Suitability is this number of occurrences.You should replace all '?' characters with small Latin letters in such a way that the suitability of string s is maximal.

The first line contains string s (1 ≤ |s| ≤ 106). The second line contains string t (1 ≤ |t| ≤ 106).

Print string s with '?' replaced with small Latin letters in such a way that suitability of that string is maximal. If there are multiple strings with maximal suitability then print any of them.

NoteIn the first example string "baab" can be transformed to "abab" with swaps, this one has suitability of 2. That means that string "baab" also has suitability of 2.In the second example maximal suitability you can achieve is 1 and there are several dozens of such strings, "azbz" is just one of them.In the third example there are no '?' characters and the suitability of the string is 0.

package main

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

func Init() {
}

func Solve(io *FastIO) {
	S := io.NextLine()
	T := io.NextLine()

	freqS, blanks := GetFreqs(S)
	freqT, _ := GetFreqs(T)

	L := 0
	R := len(S) / len(T)
	needFreq := make([]int, 26)
	for L <= R {
		M := (L + R) >> 1
		need, total := BlanksRequired(freqS, freqT, M)
		if total <= blanks {
			needFreq = need
			L = M + 1
		} else {
			R = M - 1
		}
	}

	var buf bytes.Buffer
	idx := 0
	for _, c := range S {
		if c == '?' {
			for idx < 26 && needFreq[idx] == 0 {
				idx++
			}
			if idx < 26 {
				buf.WriteRune(rune(idx + 'a'))
				needFreq[idx]--
			} else {
				buf.WriteRune('z')
			}
		} else {
			buf.WriteRune(c)
		}
	}
	io.Println(buf.String())
}

func BlanksRequired(freqS, freqT []int, suitability int) ([]int, int) {
	need := make([]int, 26)
	total := 0
	for i := 0; i < 26; i++ {
		need[i] = Max(0, suitability * freqT[i] - freqS[i])
		total += need[i]
	}
	return need, total
}

func GetFreqs(s string) ([]int, int) {
	freq := make([]int, 26)
	blanks := 0
	for _, c := range s {
		if c == '?' {
			blanks++
		} else {
			freq[c - 'a']++
		}
	}
	return freq, blanks
}

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

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c - '0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size + offset)
	for i := 0; i < size; i++ {
		arr[i + offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for (IsSpaceChar(c)) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
		case 0, '\n', '\r':
			return true
		default:
			return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}