You are given an integer $$$n$$$.Let's define $$$s(n)$$$ as the string "BAN" concatenated $$$n$$$ times. For example, $$$s(1)$$$ = "BAN", $$$s(3)$$$ = "BANBANBAN". Note that the length of the string $$$s(n)$$$ is equal to $$$3n$$$.Consider $$$s(n)$$$. You can perform the following operation on $$$s(n)$$$ any number of times (possibly zero): Select any two distinct indices $$$i$$$ and $$$j$$$ $$$(1 \leq i, j \leq 3n, i \ne j)$$$. Then, swap $$$s(n)_i$$$ and $$$s(n)_j$$$. You want the string "BAN" to not appear in $$$s(n)$$$ as a subsequence. What's the smallest number of operations you have to do to achieve this? Also, find one such shortest sequence of operations.A string $$$a$$$ is a subsequence of a string $$$b$$$ if $$$a$$$ can be obtained from $$$b$$$ by deletion of several (possibly, zero or all) characters.

The input consists of multiple test cases. The first line contains a single integer $$$t$$$ $$$(1 \leq t \leq 100)$$$  — the number of test cases. The description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ $$$(1 \leq n \leq 100)$$$.

For each test case, in the first line output $$$m$$$ ($$$0 \le m \le 10^5$$$) — the minimum number of operations required. It's guaranteed that the objective is always achievable in at most $$$10^5$$$ operations under the constraints of the problem.  Then, output $$$m$$$ lines. The $$$k$$$-th of these lines should contain two integers $$$i_k$$$, $$$j_k$$$ $$$(1\leq i_k, j_k \leq 3n, i_k \ne j_k)$$$ denoting that you want to swap characters at indices $$$i_k$$$ and $$$j_k$$$ at the $$$k$$$-th operation.  After all $$$m$$$ operations, "BAN" must not appear in $$$s(n)$$$ as a subsequence.  If there are multiple possible answers, output any.

NoteIn the first testcase, $$$s(1) = $$$ "BAN", we can swap $$$s(1)_1$$$ and $$$s(1)_2$$$, converting $$$s(1)$$$ to "ABN", which does not contain "BAN" as a subsequence.In the second testcase, $$$s(2) = $$$ "BANBAN", we can swap $$$s(2)_2$$$ and $$$s(2)_6$$$, converting $$$s(2)$$$ to "BNNBAA", which does not contain "BAN" as a subsequence.

package main

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

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

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

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

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

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

/**
Run solve the problem CF1747B
Date: 11/16/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1747/B
Problem: CF1747B
**/
func (in *CF1747B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 1 {
			fmt.Println("1\n1 2")
		} else {
			var sol strings.Builder
			count := 0
			for i := 0; i < n/2; i++ {
				count++
				x := (3 * i) + 1
				y := 3 * (n - i)

				sol.WriteString(fmt.Sprintf("%d %d\n", x, y))
			}

			if n%2 != 0 {
				count++
				x := ((3 * n) - 1) / 2
				y := x + 2
				sol.WriteString(fmt.Sprintf("%d %d\n", x, y))
			}

			fmt.Println(count)
			fmt.Print(sol.String())
		}
	}
}

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

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

package main

import "fmt"

func good(a []rune, n int) bool {
	var valid int
	valid = n / 2
	if n%2 != 0 {
		valid++
	}
	for i := 0; i < valid; i++ {
		pos := i * 3
		if a[pos] != 'A' {
			return false
		}
	}
	return true
}

func swap(a []rune) (int, int) {
	l := len(a)
	var la, fb int
	// find latest A
	for i := l - 1; i >= 0; i-- {
		if a[i] == 'A' {
			la = i
			break
		}
	}
	// find first B
	for i := 0; i < l; i++ {
		if a[i] == 'B' {
			fb = i
			break
		}
	}
	return fb, la
}

func solve(a []rune, n int) {
	//fmt.Println(string(a), n)
	var s int
	var index []int
	for !good(a, n) {
		s++
		fb, la := swap(a)
		index = append(index, fb)
		index = append(index, la)
		a[fb], a[la] = a[la], a[fb]
		//fmt.Println(s, string(a))
	}
	//fmt.Println(string(a))
	fmt.Println(s)
	//fmt.Println(index)
	//fmt.Print(index[0] + 1)
	for i := 0; i < len(index); i += 2 {
		fmt.Printf("%d %d\n", index[i]+1, index[i+1]+1)
	}
	//fmt.Println("")

}

func main() {
	var t, n int
	fmt.Scan(&t)
	for tt := 0; tt < t; tt++ {
		fmt.Scan(&n)
		var a []rune
		for nn := 0; nn < n; nn++ {
			a = append(a, []rune{'B', 'A', 'N'}...)
		}
		//fmt.Println(string(a))
		solve(a, n)
	}

}

package main

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

func solve(reader *bufio.Reader, writer *bufio.Writer) {
	n := readInt(reader)

	fmt.Fprintln(writer, (n+1)/2)
	l, r := 1, 3*n
	for l < r {
		fmt.Fprint(writer, l, r, " ")
		l += 3
		r -= 3
	}

	fmt.Fprintln(writer)

}

func main() {
	reader := bReader(os.Stdin)
	writer := bWriter(os.Stdout)

	t := readInt(reader)

	for t > 0 {
		solve(reader, writer)
		t--
	}

	writer.Flush()
}

func max(a int, b int) int {
	return int(maxInt64(int64(a), int64(b)))
}

func maxInt64(a int64, b int64) int64 {
	if a > b {
		return a
	}

	return b
}

func bReader(stdin *os.File) *bufio.Reader {
	return bufio.NewReaderSize(stdin, 16*1024*1024)
}

func bWriter(stdout *os.File) *bufio.Writer {
	return bufio.NewWriterSize(stdout, 16*1024*1024)
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

func checkError(err error) {
	if err != nil {
		panic(err)
	}
}

func readInt(reader *bufio.Reader) int {
	return int(readInt64(reader))
}

func readInt64(reader *bufio.Reader) int64 {
	value, err := strconv.ParseInt(readLine(reader), 10, 64)
	checkError(err)

	return value
}

func readString(reader *bufio.Reader) string {
	return readLine(reader)
}

func readArrayString(reader *bufio.Reader) []string {
	return strings.Split(strings.TrimSpace(readLine(reader)), " ")
}

func readArrayInt(reader *bufio.Reader) []int {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := int(arItemTemp)
		ar = append(ar, arItem)
	}

	return ar
}

func readArrayInt64(reader *bufio.Reader) []int64 {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int64

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := arItemTemp
		ar = append(ar, arItem)
	}

	return ar
}

func readTwoInt(reader *bufio.Reader) (int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1]
}

func readTwoInt64(reader *bufio.Reader) (int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1]
}

func readThreeInt(reader *bufio.Reader) (int, int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1], ar[2]
}

func readThreeInt64(reader *bufio.Reader) (int64, int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1], ar[2]
}

package main

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

const cf = true

func solve() {
	var n int
	fmt.Fscan(in, &n)
	i1, i2 := 1, n*3
	fmt.Fprintln(out, n/2+n%2)
	for i1 < i2 {
		fmt.Fprintln(out, i1, i2)
		i1 += 3
		i2 -= 3
	}
}

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

func LCM(a, b int) int {
	return a * b / GCD(a, b)
}

func GCD(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}

	return a
}

type SqrtInt interface {
	SignedSqrt | UnsignedSqrt
}

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

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

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

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

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

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

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

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

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

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

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

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

var exists = struct{}{}

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

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

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

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

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

type Ordered interface {
	Integer | Float | ~string
}

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

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

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

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

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

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

package main

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

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

func solve() {
	n := _readInt()
	res := int(math.Ceil(float64(n) / 2))
	moves := make([][]int, res)
	_print(res)
	for i := range moves {
		_print(strconv.Itoa(i*3+2), n*3-i*3)
	}
}

func main() {
	defer out.Flush()
	var t int
	for fmt.Fscanln(in, &t); t > 0; t-- {
		solve()
	}
}

// ====
func _readInt() int {
	var x int
	fmt.Fscan(in, &x)
	return x
}
func _readStr() string {
	var x string
	fmt.Fscan(in, &x)
	return x
}
func _readArr(x ...int) (int, []int) {
	var n int
	if len(x) == 0 {
		fmt.Fscan(in, &n)
	} else {
		n = x[0]
	}
	var v = make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &v[i])
	}
	return n, v
}
func _print(x ...any) {
	fmt.Fprintln(out, x...)
}
func _max(x ...int) int {
	mi := 0
	for i := 1; i < len(x); i++ {
		if x[i] > x[mi] {
			mi = i
		}
	}
	return x[mi]
}
func _min(x ...int) int {
	mi := 0
	for i := 1; i < len(x); i++ {
		if x[i] < x[mi] {
			mi = i
		}
	}
	return x[mi]
}
func _sum(x ...int) int {
	res := 0
	for _, i := range x {
		res += i
	}
	return res
}
func _abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}
func _sortStr(x string) string {
	r := []rune(x)
	sort.Slice(r, func(i, j int) bool {
		return r[i] < r[j]
	})
	return string(r)
}
func _reverseInts(x []int) {
	n := len(x)
	for i := 0; i < n/2; i++ {
		x[i], x[n-1-i] = x[n-1-i], x[i]
	}
}
func _reverseStr(s string) string {
	x := []rune(s)
	n := len(x)
	for i := 0; i < n/2; i++ {
		x[i], x[n-1-i] = x[n-1-i], x[i]
	}
	return string(x)
}
func _makeMatrix(n, m int) [][]int {
	x := make([][]int, n)
	for i := range x {
		x[i] = make([]int, m)
	}
	return x
}

package main

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

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

const (
	DEBUG = false
)

func debug(a ...interface{}) {
	if !DEBUG {
		return
	}
	for _, e := range a {
		printf("%v ", e)
	}
	printf("\n")
	writer.Flush()
}

func debugCondn(condn bool, a ...interface{}) {
	if !DEBUG || !condn {
		return
	}
	for _, e := range a {
		printf("%v ", e)
	}
	printf("\n")
	writer.Flush()
}

func assert(condn bool) {
	if !condn {
		panic("assertion error")
	}
}

func solve(tt int) {
	var n int
	scanf("%d\n", &n)
	var str strings.Builder
	for i:=0; i<n; i++ {
		str.Write([]byte("BAN"))
	}

	type PairInt struct {
		first, second int
	}
	var res []PairInt
	i := 0
	j := str.Len()-1

	for i < j {
		if str.String()[i] != 'A' {
			i++
			continue
		}
		if str.String()[j] != 'N' {
			j--
			continue
		}
		res = append(res, PairInt{
			first: i+1,
			second: j+1,
		})
		i++
		j--
	}
	printf("%d\n", len(res))
	for _, item := range res {
		printf("%d %d\n", item.first, item.second)
	}
}

func main() {
	defer writer.Flush()

	var T int
	scanf("%d\n", &T)
	for tt:=1; tt<=T; tt++ {
		solve(tt)
	}
}

package main

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

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

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

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

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

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

/**
Run solve the problem CF1747B
Date: 11/16/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1747/B
Problem: CF1747B
**/
func (in *CF1747B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 1 {
			fmt.Println("1\n1 2")
		} else {
			var sol strings.Builder
			count := 0
			for i := 0; i < n-1; i += 2 {
				count++
				sol.WriteString(fmt.Sprintf("%d %d\n", (3*i)+1, (3*(i+1))+2))
			}

			if n%2 != 0 {
				count++
				sol.WriteString(fmt.Sprintf("%d %d\n", (3*(n-2))+1, (3*(n-1))+2))
			}
			fmt.Println(count)
			fmt.Print(sol.String())
		}
	}
}

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

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

package main

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

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

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

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

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

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

/**
Run solve the problem CF1747B
Date: 11/16/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1747/B
Problem: CF1747B
**/
func (in *CF1747B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 1 {
			fmt.Println("1\n1 2")
		} else {
			var sol strings.Builder
			count := 0
			for i := 0; i < n-1; i += 2 {
				count++
				sol.WriteString(fmt.Sprintf("%d %d\n", (3*i)+1, (3*(i+1))+2))
			}

			if n%2 != 0 {
				count++
				sol.WriteString(fmt.Sprintf("%d %d\n", (3*(n-1))+1, (3*(n))+2))
			}
			fmt.Println(count)
			fmt.Print(sol.String())
		}
	}
}

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

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

package main

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

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

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

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

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

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

/**
Run solve the problem CF1747B
Date: 11/16/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1747/B
Problem: CF1747B
**/
func (in *CF1747B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 1 {
			fmt.Println("1\n1 2")
		} else {
			var sol strings.Builder
			count := 0
			for i := 0; i < n; i += 2 {
				count++
				sol.WriteString(fmt.Sprintf("%d %d\n", (3*i)+1, (3*(i+1))+2))
			}
			fmt.Println(count)
			fmt.Print(sol.String())
		}
	}
}

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

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

package main

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

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

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

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

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

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

/**
Run solve the problem CF1747B
Date: 11/16/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1747/B
Problem: CF1747B
**/
func (in *CF1747B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 1 {
			fmt.Println("1\n1 2")
		} else {
			var sol strings.Builder
			count := 0
			for i := 0; i < n-1; i += 2 {
				count++
				sol.WriteString(fmt.Sprintf("%d %d\n", (3*i)+1, (3*(i+1))+2))
			}
			fmt.Println(count)
			fmt.Print(sol.String())
		}
	}
}

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

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

package main

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

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

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

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

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

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

/**
Run solve the problem CF1747B
Date: 11/16/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1747/B
Problem: CF1747B
**/
func (in *CF1747B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 1 {
			fmt.Println("1\n1 2")
		} else {
			var sol strings.Builder
			count := 0
			for i := 0; i < n; i += 2 {
				count++
				sol.WriteString(fmt.Sprintf("%d %d\n", (3*i)+1, (3*(i+1))+2))
			}
			fmt.Println(n - 1)
			fmt.Print(sol.String())
		}
	}
}

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

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

package main

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

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

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

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

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

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

/**
Run solve the problem CF1747B
Date: 11/16/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1747/B
Problem: CF1747B
**/
func (in *CF1747B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		if n == 1 {
			fmt.Println("1\n1 2")
		} else {
			var sol strings.Builder
			for i := 0; i < n-1; i++ {
				sol.WriteString(fmt.Sprintf("%d %d\n", (3*i)+1, (3*(i+1))+2))
			}
			fmt.Println(n - 1)
			fmt.Print(sol.String())
		}
	}
}

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

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

package main

import "fmt"

func good(a []rune, n int) bool {
	for i := 0; i < n; i++ {
		if a[i] != 'A' {
			return false
		}
	}
	return true
}

func swap(a []rune) (int, int) {
	l := len(a)
	var la, fna int
	// find latest A
	for i := l - 1; i >= 0; i-- {
		if a[i] == 'A' {
			la = i
			break
		}
	}
	// find firs not A
	for i := 0; i < l; i++ {
		if a[i] != 'A' {
			fna = i
			break
		}
	}
	return fna, la
}

func solve(a []rune, n int) {
	//fmt.Println(a, n)
	var s int
	var index []int
	for !good(a, n) {
		s++
		fna, la := swap(a)
		index = append(index, fna)
		index = append(index, la)
		a[fna], a[la] = a[la], a[fna]
	}
	fmt.Println(s)
	//fmt.Println(index)
	//fmt.Print(index[0] + 1)
	for i := 0; i < len(index); i += 2 {
		fmt.Printf("%d %d\n", index[i]+1, index[i+1]+1)
	}
	//fmt.Println("")

}

func main() {
	var t, n int
	fmt.Scan(&t)
	for tt := 0; tt < t; tt++ {
		fmt.Scan(&n)
		var a []rune
		for nn := 0; nn < n; nn++ {
			a = append(a, []rune{'B', 'A', 'N'}...)
		}
		//fmt.Println(string(a))
		solve(a, n)
	}

}

package main

import "fmt"

func good(a []rune, n int) bool {
	for i := 0; i < n; i++ {
		if a[i] != 'A' {
			return false
		}
	}
	return true
}

func swap(a []rune) (int, int) {
	l := len(a)
	var la, fna int
	// find latest A
	for i := l - 1; i >= 0; i-- {
		if a[i] == 'A' {
			la = i
			break
		}
	}
	// find firs not A
	for i := 0; i < l; i++ {
		if a[i] != 'A' {
			fna = i
			break
		}
	}
	return fna, la
}

func solve(a []rune, n int) {
	//fmt.Println(a, n)
	var s int
	var index []int
	for !good(a, n) {
		s++
		fna, la := swap(a)
		index = append(index, fna)
		index = append(index, la)
		a[fna], a[la] = a[la], a[fna]
	}
	fmt.Println(s)
	//fmt.Println(index)
	fmt.Print(index[0] + 1)
	for i := 1; i < len(index); i++ {
		fmt.Printf(" %d", index[i]+1)
	}
	fmt.Println("")

}

func main() {
	var t, n int
	fmt.Scan(&t)
	for tt := 0; tt < t; tt++ {
		fmt.Scan(&n)
		var a []rune
		for nn := 0; nn < n; nn++ {
			a = append(a, []rune{'B', 'A', 'N'}...)
		}
		//fmt.Println(string(a))
		solve(a, n)
	}

}

package main

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

func solve(reader *bufio.Reader, writer *bufio.Writer) {
	n := readInt(reader)
	if n == 1 {
		fmt.Fprintln(writer, 1)
		fmt.Fprintln(writer, 1, 3)
	} else {
		fmt.Fprintln(writer, n-1)
		for i := 1; i <= n-1; i++ {
			fmt.Fprint(writer, 3*i-2, 3*i+3, " ")
		}
	}
	fmt.Fprintln(writer)

}

func main() {
	reader := bReader(os.Stdin)
	writer := bWriter(os.Stdout)

	t := readInt(reader)

	for t > 0 {
		solve(reader, writer)
		t--
	}

	writer.Flush()
}

func max(a int, b int) int {
	return int(maxInt64(int64(a), int64(b)))
}

func maxInt64(a int64, b int64) int64 {
	if a > b {
		return a
	}

	return b
}

func bReader(stdin *os.File) *bufio.Reader {
	return bufio.NewReaderSize(stdin, 16*1024*1024)
}

func bWriter(stdout *os.File) *bufio.Writer {
	return bufio.NewWriterSize(stdout, 16*1024*1024)
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

func checkError(err error) {
	if err != nil {
		panic(err)
	}
}

func readInt(reader *bufio.Reader) int {
	return int(readInt64(reader))
}

func readInt64(reader *bufio.Reader) int64 {
	value, err := strconv.ParseInt(readLine(reader), 10, 64)
	checkError(err)

	return value
}

func readString(reader *bufio.Reader) string {
	return readLine(reader)
}

func readArrayString(reader *bufio.Reader) []string {
	return strings.Split(strings.TrimSpace(readLine(reader)), " ")
}

func readArrayInt(reader *bufio.Reader) []int {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := int(arItemTemp)
		ar = append(ar, arItem)
	}

	return ar
}

func readArrayInt64(reader *bufio.Reader) []int64 {
	arTemp := strings.Split(strings.TrimSpace(readLine(reader)), " ")
	n := len(arTemp)

	var ar []int64

	for i := 0; i < n; i++ {
		arItemTemp, err := strconv.ParseInt(arTemp[i], 10, 64)
		checkError(err)
		arItem := arItemTemp
		ar = append(ar, arItem)
	}

	return ar
}

func readTwoInt(reader *bufio.Reader) (int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1]
}

func readTwoInt64(reader *bufio.Reader) (int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1]
}

func readThreeInt(reader *bufio.Reader) (int, int, int) {
	ar := readArrayInt(reader)
	return ar[0], ar[1], ar[2]
}

func readThreeInt64(reader *bufio.Reader) (int64, int64, int64) {
	ar := readArrayInt64(reader)
	return ar[0], ar[1], ar[2]
}


Mikhail walks on a Cartesian plane. He starts at the point $$$(0, 0)$$$, and in one move he can go to any of eight adjacent points. For example, if Mikhail is currently at the point $$$(0, 0)$$$, he can go to any of the following points in one move:   $$$(1, 0)$$$;  $$$(1, 1)$$$;  $$$(0, 1)$$$;  $$$(-1, 1)$$$;  $$$(-1, 0)$$$;  $$$(-1, -1)$$$;  $$$(0, -1)$$$;  $$$(1, -1)$$$. If Mikhail goes from the point $$$(x1, y1)$$$ to the point $$$(x2, y2)$$$ in one move, and $$$x1 \ne x2$$$ and $$$y1 \ne y2$$$, then such a move is called a diagonal move.Mikhail has $$$q$$$ queries. For the $$$i$$$-th query Mikhail's target is to go to the point $$$(n_i, m_i)$$$ from the point $$$(0, 0)$$$ in exactly $$$k_i$$$ moves. Among all possible movements he want to choose one with the maximum number of diagonal moves. Your task is to find the maximum number of diagonal moves or find that it is impossible to go from the point $$$(0, 0)$$$ to the point $$$(n_i, m_i)$$$ in $$$k_i$$$ moves.Note that Mikhail can visit any point any number of times (even the destination point!).

The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of queries. Then $$$q$$$ lines follow. The $$$i$$$-th of these $$$q$$$ lines contains three integers $$$n_i$$$, $$$m_i$$$ and $$$k_i$$$ ($$$1 \le n_i, m_i, k_i \le 10^{18}$$$) — $$$x$$$-coordinate of the destination point of the query, $$$y$$$-coordinate of the destination point of the query and the number of moves in the query, correspondingly.

Print $$$q$$$ integers. The $$$i$$$-th integer should be equal to -1 if Mikhail cannot go from the point $$$(0, 0)$$$ to the point $$$(n_i, m_i)$$$ in exactly $$$k_i$$$ moves described above. Otherwise the $$$i$$$-th integer should be equal to the the maximum number of diagonal moves among all possible movements.

NoteOne of the possible answers to the first test case: $$$(0, 0) \to (1, 0) \to (1, 1) \to (2, 2)$$$.One of the possible answers to the second test case: $$$(0, 0) \to (0, 1) \to (1, 2) \to (0, 3) \to (1, 4) \to (2, 3) \to (3, 2) \to (4, 3)$$$.In the third test case Mikhail cannot reach the point $$$(10, 1)$$$ in 9 moves.

package main

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

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

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

func main() {
	in := bufio.NewReader(os.Stdin)
	line, _ := in.ReadString('\n')
	num, _ := strconv.Atoi(strings.TrimSpace(line[:len(line)-1]))
	nums := make([][3]int64, num)
	for i := 0; i < num; i++ {
		line, _ := in.ReadString('\n')
		strs := strings.Split(strings.TrimSpace(line[:len(line)-1]), " ")
		sub_nums := [3]int64{}
		for i, str := range strs {
			sub_nums[i], _ = strconv.ParseInt(str, 10, 64)
		}
		nums[i] = sub_nums
	}
	for i := 0; i < num; i++ {
		if nums[i][0] > nums[i][2] || nums[i][1] > nums[i][2] {
			fmt.Println(-1)
		} else {
			if (abs(nums[i][0] - nums[i][1]) % 2) == 1 {
				fmt.Println(nums[i][2] - 1)
			} else if (abs(nums[i][2] - min(nums[i][0], nums[i][1])) % 2) == 1 {
				fmt.Println(nums[i][2] - 2)
			} else {
				fmt.Println(nums[i][2])
			}
		}
	}
}

package main

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

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

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

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

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

func main() {

	defer writer.Flush()
	var x, y, k int64
	var q int
	//fmt.Scanln(&q)
	scanf("%d\n", &q)
	for i := 0; i < q; i = i + 1 {
		//fmt.Scanln(&x, &y, &k)
		scanf("%d %d %d\n", &x, &y, &k)
		if x < 0 {
			x = x * -1
		}
		if y < 0 {
			y = y * -1
		}
		tot := min(x, y) + max(x, y) - min(x, y)
		if k < tot {
			printf("%d\n", -1)
			continue
		}

		var ans int64

		online := max(x, y) - min(x, y)

		if online%2 == 1 {
			ans = k - 1
		} else {
			if (k-min(x, y))%2 == 0 {
				ans = k
			} else {
				ans = k - 2
			}
		}
		printf("%d\n", ans)
		//fmt.Println(ans)

	}
}

package main

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

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

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

func main() {
	in := bufio.NewReader(os.Stdin)
	line, _ := in.ReadString('\n')
	num, _ := strconv.Atoi(strings.TrimSpace(line[:len(line)-1]))
	nums := make([][3]int, num)
	for i := 0; i < num; i++ {
		line, _ := in.ReadString('\n')
		strs := strings.Split(strings.TrimSpace(line[:len(line)-1]), " ")
		sub_nums := [3]int{}
		for i, str := range strs {
			sub_nums[i], _ = strconv.Atoi(str)
		}
		nums[i] = sub_nums
	}
	for i := 0; i < num; i++ {
		if nums[i][0] > nums[i][2] || nums[i][1] > nums[i][2] {
			fmt.Println(-1)
		} else {
			if (abs(nums[i][0] - nums[i][1]) % 2) == 1 {
				fmt.Println(nums[i][2] - 1)
			} else if (abs(nums[i][2] - min(nums[i][0], nums[i][1])) % 2) == 1 {
				fmt.Println(nums[i][2] - 2)
			} else {
				fmt.Println(nums[i][2])
			}
		}
	}
}

package main

import (
	"fmt"
)

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

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

func main() {
	var x, y, k int64
	var q int
	fmt.Scanln(&q)
	for i := 0; i < q; i = i + 1 {
		fmt.Scanln(&x, &y, &k)
		if x < 0 {
			x = x * -1
		}
		if y < 0 {
			y = y * -1
		}
		tot := min(x, y) + max(x, y) - min(x, y)
		if k < tot {
			fmt.Println(-1)
			continue
		}

		ans := min(x, y)

		online := max(x, y) - min(x, y)

		if online%2 == 1 {
			ans = k - 1
		} else {
			ans = k - 2
		}

		fmt.Println(ans)

	}
}


You are given one integer number $$$n$$$. Find three distinct integers $$$a, b, c$$$ such that $$$2 \le a, b, c$$$ and $$$a \cdot b \cdot c = n$$$ or say that it is impossible to do it.If there are several answers, you can print any.You have to answer $$$t$$$ independent test cases.

The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The next $$$n$$$ lines describe test cases. The $$$i$$$-th test case is given on a new line as one integer $$$n$$$ ($$$2 \le n \le 10^9$$$).

For each test case, print the answer on it. Print "NO" if it is impossible to represent $$$n$$$ as $$$a \cdot b \cdot c$$$ for some distinct integers $$$a, b, c$$$ such that $$$2 \le a, b, c$$$. Otherwise, print "YES" and any possible such representation.

package main

import (
	"fmt"
	"math"
)

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

func p(a int) {
	res := []int{}
	div := 2
	sq := int(math.Sqrt(float64(a)))

	for {
		if a == 1 || len(res) == 2 || div > a || div > sq {
			break
		}

		if a%div == 0 {
			a /= div
			res = append(res, div)
		}

		div++
	}

	if a == 1 || len(res) < 2 {
		fmt.Println("NO")
		return
	}

	if len(res) == 2 {
		if a > res[1] {
			fmt.Println("YES")
			fmt.Println(res[0], res[1], a)
			return
		}

		fmt.Println("NO")
		return
	}

	fmt.Println("NO")
	return
}

package main

import (
	"fmt"
)

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var n int
		var a, b, c int
		flag := 0
		fmt.Scanf("%d\n", &n)
		if n < 24 {
			fmt.Println("NO")
			continue
		} else {
			for i := 2; i <= n/(i*(i+1)); i++ {
				for j := i + 1; j < n/(i*j); j++ {
					a, b, c = 0, 0, 0
					if n%(i*j) == 0 {
						a = n / (i * j)
						b = j
						c = i
						if b != a && c != a && b != c {
							flag = 1
							fmt.Println("YES")
							fmt.Printf("%d %d %d\n", c, b, a)
							break
						}
					}
				}
				if flag == 1 {
					break
				}
			}
			if a == 0 || b == 0 || c == 0 {
				fmt.Println("NO")
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)
func fun(n int64,out *bufio.Writer){
	//fmt.Fscanf(in,"%d",&n)
	sq:=math.Sqrt(float64(n))
	num:=make([]int64,0)
	cnt:=0
	for i:=int64(2);i<=int64(sq);i++{
		if n%i==0{
			num=append(num, i)
			n/=i
			cnt++
		}
		if cnt==2{
			break
		}
	}
	if cnt<2{
		fmt.Fprintf(out,"NO\n")
		return
	}
	if (n!=num[0])&&(n!=num[1])&&(n>=2){
		fmt.Fprintf(out,"YES\n")
		fmt.Fprintf(out,"%d %d %d\n",num[0],num[1],n)
	}else{
		fmt.Fprintf(out,"NO\n")
	}
	return
}
func main(){
	in:=bufio.NewReader(os.Stdin)
	out:=bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscanf(in,"%d\n",&t)
	for ;t>0;t--{
		var n int64
		fmt.Fscanf(in,"%d\n" ,&n)
		fun(n,out)
	}
}

package main

import (
	"fmt"
)

type pair struct{
	a,b int64
}

func poww(A int64 , B int64) int64 {
	res := int64(1)
	for B > 0 {
		if B & 1 == 1 {
			res *= A
		}
		A *= A
		B = B >> 1
	}
	return res
}

func solve(n int64) (bool, int64, int64, int64) {
	var pr []pair

	if n % 2 == 0 {
		cnt := int64(0)
		for n % 2 == 0 {
			cnt ++
			n /= 2
		}
		var tmp pair
		tmp.a = 2
		tmp.b = cnt
		pr = append(pr,tmp)
	}

	for i := int64(3) ; i*i <= n ; i ++ {
		if n % i == 0 {
			cnt := int64(0)
			for n % i == 0 {
				cnt ++
				n /= i
			}
			var tmp pair
			tmp.a = i
			tmp.b = cnt
			pr = append(pr,tmp)
		}
	}

	if n > 1 {
		var tmp pair
		tmp.a = n
		tmp.b = 1
		pr = append(pr,tmp)
	}

	var A, B, C int64

	if len(pr) == 1 {
		if pr[0].b >= 6{
			A = pr[0].a
			B = poww(pr[0].a,2)
			C = poww(pr[0].a,pr[0].b - 3)
			return true,A,B,C
		}else {
			return false,0,0,0
		}
	} else if len(pr) == 2 {

		if pr[0].b + pr[1].b >= 4 {
			A = pr[0].a
			B = poww(pr[0].a, pr[0].b - 1)*poww(pr[1].a, pr[1].b - 1)
			C = pr[1].a
			return true,A,B,C
		} else{
			return false,0,0,0
		}

	} else {
		A = pr[0].a
		B = pr[1].a
		pr[0].b -= 1
		pr[1].b -= 1
		C = 1
		for i := 0 ; i < len(pr) ; i ++ {
			C *= poww( pr[i].a, pr[i].b )
		}
		return true,A,B,C
	}

}

func main(){
	var t, n int64

	fmt.Scan(&t)

	for T := int64(0) ; T < t ; T ++ {
		fmt.Scan(&n)
		ok,A,B,C := solve(n)
		if ok == false {
			fmt.Println("NO")
		}else{
			fmt.Println("YES")
			fmt.Println(A,B,C)
		}
	}
}

package main

import "fmt"

func Main() (bool,int,int,int){
	var n int
	fmt.Scanf("%d\n",&n)
	on:=n
	var a=make([]struct{v,k int},30)
	t:=0
	for i:=2;i*i<=n;i++{
		if n%i==0{
			a[t].v=i
			a[t].k=0
			for n%i==0{
				n/=i
				a[t].k++
			}
			t++
		}
	}
	if n>1{
		a[t]=struct{v,k int}{n,1}
		t++
	}
	n=on
	if t==1{
		if a[0].k<=5{
			return false,0,0,0
		}
		return true,a[0].v,a[0].v*a[0].v,n/(a[0].v*a[0].v*a[0].v)
	}
	if t==2{
		if a[0].k+a[1].k<=3{
			return false,0,0,0
		}
		return true,a[0].v,a[1].v,n/(a[0].v*a[1].v)
	}
	return true,a[0].v,a[1].v,n/(a[0].v*a[1].v)
}

func main(){
	var t int
	fmt.Scanf("%d\n",&t)
	for ;t>0;t--{
		ok,a,b,c:=Main()
		if ok{
			fmt.Println("YES")
			fmt.Printf("%d %d %d\n",a,b,c)
		} else{
			fmt.Println("NO")
		}
	}
}

package main

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

func pf(n int) map[int]int {
	r := make(map[int]int, 0)
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			n /= i
			r[i]++
		}
	}
	if n > 1 {
		r[n]++
	}
	return r
}

func divs(n int) (r []int) {
	r = make([]int, 0)
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			r = append(r, i)
			if i*i != n {
				r = append(r, n/i)
			}
		}
	}
	sort.Ints(r)
	return r
}

type ans struct {
	ok   bool
	nums []int
}

func main() {
	var t, v int
	fmt.Scan(&t)
	a := make([]ans, t)
	for i := 0; i < t; i++ {
		fmt.Scan(&v)
		// fmt.Println("v", v, "divs", divs(v))
		d := divs(v)
		for j := 0; j < len(d); j++ {
			if d[j] == 1 {
				continue
			}
			if v%d[j] == 0 {
				a[i].nums = append(a[i].nums, d[j])
				v /= d[j]
			}
			if v < 2 {
				break
			} else if len(a[i].nums) == 2 {
				a[i].nums = append(a[i].nums, v)
				break
			}
		}
		if len(a[i].nums) == 3 {
			if a[i].nums[0] != a[i].nums[1] &&
				a[i].nums[1] != a[i].nums[2] &&
				a[i].nums[2] != a[i].nums[0] {
				a[i].ok = true
			}
		}
	}
	wtr := bufio.NewWriter(os.Stdout)
	for i := 0; i < len(a); i++ {
		if a[i].ok {
			fmt.Fprintln(wtr, "YES")
			fmt.Fprintln(wtr, a[i].nums[0], a[i].nums[1], a[i].nums[2])
		} else {
			fmt.Fprintln(wtr, "NO")
		}
	}
	wtr.Flush()
}

/*
URL:
https://codeforces.com/problemset/problem/1294/C
*/

package main

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

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

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

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

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

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

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

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

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

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

var (
	t int

	n int
)

func main() {
	t = ReadInt()

	for i := 0; i < t; i++ {
		n = ReadInt()

		solve()
	}
}

func solve() {
	memo := TrialDivision(n)

	if len(memo) == 1 {
		for k, v := range memo {
			if v >= 6 {
				a := k
				b := k * k
				c := (n / a) / b
				fmt.Println("YES")
				fmt.Println(a, b, c)
				return
			} else {
				fmt.Println("NO")
				return
			}
		}
	} else if len(memo) == 2 {
		A := []int{}
		for k := range memo {
			A = append(A, k)
		}

		if memo[A[0]] >= 3 || memo[A[1]] >= 3 || (memo[A[0]] >= 2 && memo[A[1]] >= 2) {
			a := A[0]
			b := A[1]
			c := (n / a) / b
			fmt.Println("YES")
			fmt.Println(a, b, c)
			return
		} else {
			fmt.Println("NO")
			return
		}
	} else {
		A := []int{}
		for k := range memo {
			A = append(A, k)
		}

		a := A[0]
		b := A[1]
		c := (n / a) / b
		fmt.Println("YES")
		fmt.Println(a, b, c)
		return
	}
}

// TrialDivision returns the result of prime factorization of integer N.
func TrialDivision(n int) map[int]int {
	if n <= 1 {
		panic(errors.New("[argument error]: TrialDivision only accepts a NATURAL number"))
	}

	p := map[int]int{}
	for i := 2; i*i <= n; i++ {
		exp := 0
		for n%i == 0 {
			exp++
			n /= i
		}

		if exp == 0 {
			continue
		}
		p[i] = exp
	}
	if n > 1 {
		p[n] = 1
	}

	return p
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	return res
}

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

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

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

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

	return string(res)
}

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

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

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

	return string(res)
}

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

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

package main

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

func find(n int64) (int64, int64, int64) {
	j := int64(2)
	for ; j <= int64(math.Sqrt(float64(n))); j++ {
		if n%j != 0 {
			continue
		}
		k := int64(2)
		other := n / j
		for ; k <= int64(math.Sqrt(float64(j))); k++ {
			if j%k != 0 {
				continue
			}
			div := j / k
			if other == k || other == div || k == div {
				continue
			}
			return other, k, div
		}
		k = int64(2)
		for ; k <= int64(math.Sqrt(float64(other))); k++ {
			if other%k != 0 {
				continue
			}
			div := other / k
			if j == k || j == div || k == div {
				continue
			}
			return j, k, div
		}
	}
	return -1, -1, -1
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var t int
	var n int64
	fmt.Fscanln(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscanln(reader, &n)
		a, b, c := find(n)
		if a == -1 {
			fmt.Fprintln(writer, "NO")
			continue
		}
		fmt.Fprintln(writer, "YES")
		fmt.Fprintln(writer, a, b, c)
	}
}

package main

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

var _ = sort.Slice
var _ = math.Sqrt
var _ = strconv.Itoa

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in, &t)
	var ans []string
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(in, &n)
		cnt := 0
		var lst []int
		for i := 2; i*i <= n; i++ {
			for n%i == 0 {
				n = n / i
				lst = append(lst, i)
				cnt++
			}
		}
		if n != 1 {
			lst = append(lst, n)
			cnt++
		}
		sta :=[]int{lst[0]}
		ansstr := []string{strconv.Itoa(lst[0])}
		now := 1
		top := 0
		set := make(map[int]bool)
		set[lst[0]] = true
		for i := 1; i < len(lst); i++{
			now = now * lst[i]
			if set[now] == false && (top != 1 || i == len(lst)-1) {
				ansstr = append(ansstr, strconv.Itoa(now))
				sta = append(sta, now)
				set[now] = true
				top++
				now = 1
			}
		}

		if top == 2{
			ans = append(ans, "YES");
			ans = append(ans, strings.Join(ansstr[:3], " "))
		}else{
			ans = append(ans, "NO")
		}
	}
	fmt.Fprintln(out, strings.Join(ans, "\n"));
}

package main

import (
	"fmt"
	"math"
)

func find(n, st int) int {
	m := int(math.Sqrt(float64(n)))
	for d := st; d <= m; d++ {
		if n%d == 0 {
			return d
		}
	}

	return 1
}

func main() {
	var T, n, a, b, c int
	for fmt.Scanln(&T); T > 0; T-- {
		fmt.Scanln(&n)
		a = find(n, 2)

		ok := false
		if a != 1 {
			b = find(n/a, a+1)
			if b != 1 {
				c = n / a / b
				if c!=a && c!=b {
					fmt.Println("YES")
					fmt.Println(a, b, c)
					ok=true
				}
			}
		}

		if !ok {
			fmt.Println("NO")
		}
	}
}

package main

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

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

	var t int
	fmt.Fscan(r, &t)
	ans := make([]string, t)
	for i := 0; i < t; i++ {
		var x int
		fmt.Fscan(r, &x)
		if a, b, c, ok := f(x); ok {
			ans[i] = fmt.Sprint("YES\n", a, b, c)
		} else {
			ans[i] = "NO"
		}
	}
	fmt.Fprintln(w, strings.Join(ans, "\n"))
}
func f(n int) (int, int, int, bool) {
	a := make([]int, 2)
	j := 0
	for i := 2; i*i <= n && j < 2; i++ {
		if n%i == 0 {
			a[j] = i
			n /= i
			j++
		}
	}
	if j < 2 || a[0] == n || a[1] == n {
		return 0, 0, 0, false
	}

	return a[0], a[1], n, true
}

package main

import (
	"fmt"
)

func main() {
	var n int64
	fmt.Scanf("%d\n", &n)
	for i := int64(0); i < n; i++ {
		var a int64
		fmt.Scanf("%d\n", &a)
		p(a)
	}
}

func p(a int64) {
	base := int64(a)
	div := int64(2)

	res := []int64{}
	for {
		if a == 1 || div > 1000 {
			break
		}

		if a%div == 0 {
			a /= div
			res = append(res, div)
		}
		div++
	}

	if len(res) < 3 {
		fmt.Println("NO")
		return
	}

	temp := int64(1)
	for i := 0; i < len(res); i++ {
		temp *= res[i]
	}
	if temp != base {
		fmt.Println("NO")
		return
	}

	fmt.Println("YES")
	fmt.Println(res[0], res[1], (temp/res[0])/res[1])
}

package main

import "fmt"

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

func p(a int) {
	base := a
	div := 2

	res := []int{}
	for {
		if a == 1 || div > 1000 {
			break
		}

		if a%div == 0 {
			a /= div
			res = append(res, div)
		}
		div++
	}

	if len(res) < 3 {
		fmt.Println("NO")
		return
	}

	temp := 1
	for i := 0; i < len(res); i++ {
		temp *= res[i]
	}
	if temp != base {
		fmt.Println("NO")
		return
	}

	fmt.Println("YES")
	fmt.Println(res[0], res[1], (temp/res[0])/res[1])
}

package main

import (
	"fmt"
)

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var n int
		var a, b, c int
		flag := 0
		fmt.Scanf("%d\n", &n)
		if n < 24 {
			fmt.Println("NO")
			continue
		} else {
			for i := 6; i < n / 6 + 1; i++ {
				a, b, c = 0, 0, 0
				if n%i == 0 {
					a = n / i
					for j := 2; j < i / 2 + 1; j++ {
						if i%j == 0 {
							b = i / j
							c = j
							if b != a && c != a && b != c {
								flag = 1
								fmt.Println("YES")
								fmt.Printf("%d %d %d\n", c, b, a)
								break
							}
						}
					}
				}
				if flag == 1 {
					break
				}
			}
			if a == 0 || b == 0 || c == 0 {
				fmt.Println("NO")
			}
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var n int
		var a, b, c int
		flag := 0
		fmt.Scanf("%d\n", &n)
		if n < 24 {
			fmt.Println("NO")
			continue
		} else {
			for i := 6; i < n / 6; i++ {
				a, b, c = 0, 0, 0
				if n%i == 0 {
					a = n / i
					for j := 2; j < i / 2; j++ {
						if i%j == 0 {
							b = i / j
							c = j
							if b != a && c != a && b != c {
								flag = 1
								fmt.Println("YES")
								fmt.Printf("%d %d %d\n", c, b, a)
								break
							}
						}
					}
				}
				if flag == 1 {
					break
				}
			}
			if a == 0 || b == 0 || c == 0 {
				fmt.Println("NO")
			}
		}
	}
}

package main

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

func pf(n int) map[int]int {
	r := make(map[int]int, 0)
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			n /= i
			r[i]++
		}
	}
	if n > 1 {
		r[n]++
	}
	return r
}

func divs(n int) (r []int) {
	r = make([]int, 0)
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			r = append(r, i)
			if i*i != n {
				r = append(r, n/i)
			}
		}
	}
	sort.Ints(r)
	return r
}

type ans struct {
	ok   bool
	nums []int
}

func main() {
	var t, v int
	fmt.Scan(&t)
	a := make([]ans, t)
	for i := 0; i < t; i++ {
		fmt.Scan(&v)
		// fmt.Println("v", v, "divs", divs(v))
		d := divs(v)
		for j := 0; j < len(d); j++ {
			if d[j] == 1 {
				continue
			}
			if v%d[j] == 0 {
				a[i].nums = append(a[i].nums, d[j])
				v /= d[j]
			}
			if v < 2 {
				break
			} else if len(a[i].nums) == 2 {
				a[i].nums = append(a[i].nums, v)
				break
			}
		}
		if len(a[i].nums) == 3 {
			if a[i].nums[0] != a[i].nums[1] &&
				a[i].nums[1] != a[i].nums[2] {
				a[i].ok = true
			}
		}
	}
	wtr := bufio.NewWriter(os.Stdout)
	for i := 0; i < len(a); i++ {
		if a[i].ok {
			fmt.Fprintln(wtr, "YES")
			fmt.Fprintln(wtr, a[i].nums[0], a[i].nums[1], a[i].nums[2])
		} else {
			fmt.Fprintln(wtr, "NO")
		}
	}
	wtr.Flush()
}

/*
URL:
https://codeforces.com/problemset/problem/1294/C
*/

package main

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

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

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

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

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

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

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

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

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

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

var (
	t int

	n int
)

func main() {
	t = ReadInt()

	for i := 0; i < t; i++ {
		n = ReadInt()

		solve()
	}
}

func solve() {
	memo := TrialDivision(n)

	if len(memo) == 1 {
		for k, v := range memo {
			if v >= 6 {
				a := k
				b := k * k
				c := n / a / b
				fmt.Println("YES")
				fmt.Println(a, b, c)
				return
			} else {
				fmt.Println("NO")
				return
			}
		}
	} else if len(memo) == 2 {
		A := []int{}
		for k := range memo {
			A = append(A, k)
		}

		if memo[A[0]] >= 3 || memo[A[1]] >= 3 {
			a := A[0]
			b := A[1]
			c := n / a / b
			fmt.Println("YES")
			fmt.Println(a, b, c)
			return
		} else {
			fmt.Println("NO")
			return
		}
	} else {
		A := []int{}
		for k := range memo {
			A = append(A, k)
		}

		a := A[0]
		b := A[1]
		c := n / a / b
		fmt.Println("YES")
		fmt.Println(a, b, c)
		return
	}
}

// TrialDivision returns the result of prime factorization of integer N.
func TrialDivision(n int) map[int]int {
	if n <= 1 {
		panic(errors.New("[argument error]: TrialDivision only accepts a NATURAL number"))
	}

	p := map[int]int{}
	for i := 2; i*i <= n; i++ {
		exp := 0
		for n%i == 0 {
			exp++
			n /= i
		}

		if exp == 0 {
			continue
		}
		p[i] = exp
	}
	if n > 1 {
		p[n] = 1
	}

	return p
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	return res
}

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

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

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

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

	return string(res)
}

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

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

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

	return string(res)
}

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

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

/*
URL:
https://codeforces.com/problemset/problem/1294/C
*/

package main

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

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

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

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

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

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

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

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

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

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

var (
	t int

	n int
)

func main() {
	t = ReadInt()

	for i := 0; i < t; i++ {
		n = ReadInt()

		solve()
	}
}

func solve() {
	memo := TrialDivision(n)

	if len(memo) == 1 {
		for k, v := range memo {
			if v >= 6 {
				a := k
				b := k * k
				c := (n / a) / b
				fmt.Println("YES")
				fmt.Println(a, b, c)
				return
			} else {
				fmt.Println("NO")
				return
			}
		}
	} else if len(memo) == 2 {
		A := []int{}
		for k := range memo {
			A = append(A, k)
		}

		if memo[A[0]] >= 3 || memo[A[1]] >= 3 {
			a := A[0]
			b := A[1]
			c := (n / a) / b
			fmt.Println("YES")
			fmt.Println(a, b, c)
			return
		} else {
			fmt.Println("NO")
			return
		}
	} else {
		A := []int{}
		for k := range memo {
			A = append(A, k)
		}

		a := A[0]
		b := A[1]
		c := (n / a) / b
		fmt.Println("YES")
		fmt.Println(a, b, c)
		return
	}
}

// TrialDivision returns the result of prime factorization of integer N.
func TrialDivision(n int) map[int]int {
	if n <= 1 {
		panic(errors.New("[argument error]: TrialDivision only accepts a NATURAL number"))
	}

	p := map[int]int{}
	for i := 2; i*i <= n; i++ {
		exp := 0
		for n%i == 0 {
			exp++
			n /= i
		}

		if exp == 0 {
			continue
		}
		p[i] = exp
	}
	if n > 1 {
		p[n] = 1
	}

	return p
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	return res
}

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

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

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

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

	return string(res)
}

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

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

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

	return string(res)
}

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

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

package main

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

var _ = sort.Slice
var _ = math.Sqrt
var _ = strconv.Itoa

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in, &t)
	var ans []string
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(in, &n)
		cnt := 0
		var lst []int
		for i := 2; i*i <= n; i++ {
			for n%i == 0 {
				n = n / i
				lst = append(lst, i)
				cnt++
			}
		}
		if n != 1 {
			lst = append(lst, n)
			cnt++
		}
		sta :=[]int{lst[0]}
		ansstr := []string{strconv.Itoa(lst[0])}
		now := 1
		top := 0
		set := make(map[int]bool)
		set[lst[0]] = true
		for i := 1; i < len(lst); i++{
			now = now * lst[i]
			if set[now] == false {
				ansstr = append(ansstr, strconv.Itoa(now))
				sta = append(sta, now)
				set[now] = true
				top++
				now = 1
			}
		}

		if top >= 2{
			ans = append(ans, "YES");
			ans = append(ans, strings.Join(ansstr[:3], " "))
		}else{
			ans = append(ans, "NO")
		}
	}
	fmt.Fprintln(out, strings.Join(ans, "\n"));
}

package main

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

var _ = sort.Slice
var _ = math.Sqrt
var _ = strconv.Itoa

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in, &t)
	var ans []string
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(in, &n)
		cnt := 0
		var lst []int
		for i := 2; i < int(math.Sqrt(float64(n))); i++ {
			for n%i == 0 {
				n = n / i
				lst = append(lst, i)
				cnt++
			}
		}
		if n != 1 {
			lst = append(lst, n)
			cnt++
		}
		sta :=[]int{lst[0]}
		ansstr := []string{strconv.Itoa(lst[0])}
		now := 1
		top := 0
		set := make(map[int]bool)
		set[lst[0]] = true
		for i := 1; i < len(lst); i++{
			now = now * lst[i]
			if set[now] == false {
				ansstr = append(ansstr, strconv.Itoa(now))
				sta = append(sta, now)
				set[now] = true
				top++
				now = 1
			}
		}

		if top >= 2{
			ans = append(ans, "YES");
			ans = append(ans, strings.Join(ansstr[:3], " "))
		}else{
			ans = append(ans, "NO")
		}
	}
	fmt.Fprintln(out, strings.Join(ans, "\n"));
}

package main

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

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

	var t int
	fmt.Fscan(r, &t)
	ans := make([]string, t)
	for i := 0; i < t; i++ {
		var x int
		fmt.Fscan(r, &x)
		if a, b, c, ok := f(x); ok {
			ans[i] = fmt.Sprint("YES\n", a, b, c)
		} else {
			ans[i] = "NO"
		}
	}
	fmt.Fprintln(w, strings.Join(ans, "\n"))
}
func f(n int) (int, int, int, bool) {
	for a := 2; a <= n/8; a++ {
		for b := a + 1; b <= n/8; b++ {
			for c := b + 1; c <= n/8; c++ {
				if a*b*c == n {
					return a, b, c, true
				}
			}
		}
	}
	return 0, 0, 0, false
}


100 years have passed since the last victory of the man versus computer in Go. Technologies made a huge step forward and robots conquered the Earth! It's time for the final fight between human and robot that will decide the faith of the planet.The following game was chosen for the fights: initially there is a polynomial P(x) = anxn + an - 1xn - 1 + ... + a1x + a0,  with yet undefined coefficients and the integer k. Players alternate their turns. At each turn, a player pick some index j, such that coefficient aj that stay near xj is not determined yet and sets it to any value (integer or real, positive or negative, 0 is also allowed). Computer moves first. The human will be declared the winner if and only if the resulting polynomial will be divisible by Q(x) = x - k.Polynomial P(x) is said to be divisible by polynomial Q(x) if there exists a representation P(x) = B(x)Q(x), where B(x) is also some polynomial.Some moves have been made already and now you wonder, is it true that human can guarantee the victory if he plays optimally?

The first line of the input contains two integers n and k (1 ≤ n ≤ 100 000, |k| ≤ 10 000) — the size of the polynomial and the integer k. The i-th of the following n + 1 lines contain character '?' if the coefficient near xi - 1 is yet undefined or the integer value ai, if the coefficient is already known ( - 10 000 ≤ ai ≤ 10 000). Each of integers ai (and even an) may be equal to 0. Please note, that it's not guaranteed that you are given the position of the game where it's computer's turn to move.

Print "Yes" (without quotes) if the human has winning strategy, or "No" (without quotes) otherwise.

NoteIn the first sample, computer set a0 to  - 1 on the first move, so if human can set coefficient a1 to 0.5 and win.In the second sample, all coefficients are already set and the resulting polynomial is divisible by x - 100, so the human has won.

package main

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

var rw = NewFastIO(os.Stdin, os.Stdout)

func main() {
	defer rw.Flush()
	n, k := rw.NextInt(), rw.NextInt64()
	a := make([]int64, n+1)
	par := 0
	all := true
	a0 := true
	for i := 0; i <= n; i++ {
		tokn := rw.Next()
		if tokn == "?" {
			all = false
			a0 = a0 && i != 0
		} else {
			par ^= 1
			a[i], _ = strconv.ParseInt(tokn, 10, 64)
		}
	}
	var win bool
	if k == 0 {
		if a0 {
			win = a[0] == 0
		} else {
			win = par == 1
		}
	} else {
		if all {
			mods := [...]int64{1e9 + 7,
				1e9 + 9,
				1e9 + 47,
				1e6 + 97,
				1e9 + 99,
				1e8 + 87}
			var vals [len(mods)]int64
			for i := n; i >= 0; i-- {
				for j := 0; j < len(mods); j++ {
					vals[j] *= k
					vals[j] += a[i]
					vals[j] %= mods[j]
				}
			}
			win = true
			for _, e := range vals {
				if e != 0 {
					win = false
				}
			}
		} else {
			win = n%2 == 1
		}
	}
	if win {
		rw.Println("Yes")
	} else {
		rw.Println("No")
	}
}

// @meooow template uwu
type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) Next() string {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	var s []byte
	for ; c > ' '; c = f.readC() {
		s = append(s, c)
	}
	return string(s)
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}
func (f *FastIO) NextInt64() int64 {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := int64(0)
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int64(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}
func (f *FastIO) NextInt64s(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt64()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}

func (f *FastIO) Print(a ...interface{}) {
	fmt.Fprint(f, a...)
}
func (f *FastIO) PrintInts(a ...int) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInts(a ...int) {
	f.PrintInts(a...)
	f.Println()
}
func (f *FastIO) PrintInt64s(a ...int64) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInt64s(a ...int64) {
	f.PrintInt64s(a...)
	f.Println()
}

package main

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

var rw = NewFastIO(os.Stdin, os.Stdout)

func main() {
	defer rw.Flush()
	n, k := rw.NextInt(), rw.NextInt64()
	a := make([]int64, n+1)
	par := 0
	all := true
	a0 := true
	for i := 0; i <= n; i++ {
		tokn := rw.Next()
		if tokn == "?" {
			all = false
			a0 = a0 && i != 0
		} else {
			par ^= 1
			a[i], _ = strconv.ParseInt(tokn, 10, 64)
		}
	}
	var win bool
	if k == 0 {
		if a0 {
			win = a[0] == 0
		} else {
			win = par == 1
		}
	} else {
		if all {
			mods := [...]int64{1e9 + 7, 1e9 + 9}
			vals := [...]int64{0, 0}
			for i := n; i >= 0; i-- {
				for j := 0; j < 2; j++ {
					vals[j] *= k
					vals[j] += a[i]
					vals[j] %= mods[j]
				}
			}
			win = vals[0] == 0 && vals[1] == 0
		} else {
			win = n%2 == 1
		}
	}
	if win {
		rw.Println("Yes")
	} else {
		rw.Println("No")
	}
}

// @meooow template uwu
type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) Next() string {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	var s []byte
	for ; c > ' '; c = f.readC() {
		s = append(s, c)
	}
	return string(s)
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}
func (f *FastIO) NextInt64() int64 {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := int64(0)
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int64(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}
func (f *FastIO) NextInt64s(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt64()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}

func (f *FastIO) Print(a ...interface{}) {
	fmt.Fprint(f, a...)
}
func (f *FastIO) PrintInts(a ...int) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInts(a ...int) {
	f.PrintInts(a...)
	f.Println()
}
func (f *FastIO) PrintInt64s(a ...int64) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInt64s(a ...int64) {
	f.PrintInt64s(a...)
	f.Println()
}

package main

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

var rw = NewFastIO(os.Stdin, os.Stdout)

func main() {
	defer rw.Flush()
	n, k := rw.NextInt(), rw.NextInt64()
	a := make([]int64, n+1)
	par := 0
	all := true
	a0 := true
	for i := 0; i <= n; i++ {
		tokn := rw.Next()
		if tokn == "?" {
			all = false
			par ^= 1
			a0 = a0 && i != 0
		} else {
			a[i], _ = strconv.ParseInt(tokn, 10, 64)
		}
	}
	var win bool
	if k == 0 {
		if a0 {
			win = a[0] == 0
		} else {
			win = par == 1
		}
	} else {
		if all {
			mods := [...]int64{1e9 + 7, 1e9 + 9}
			vals := [...]int64{0, 0}
			for i := n; i >= 0; i-- {
				for j := 0; j < 2; j++ {
					vals[j] *= k
					vals[j] += a[i]
					vals[j] %= mods[j]
				}
			}
			win = vals[0] == 0 && vals[1] == 0
		} else {
			win = n%2 == 1
		}
	}
	if win {
		rw.Println("Yes")
	} else {
		rw.Println("No")
	}
}

// @meooow template uwu
type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) Next() string {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	var s []byte
	for ; c > ' '; c = f.readC() {
		s = append(s, c)
	}
	return string(s)
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}
func (f *FastIO) NextInt64() int64 {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := int64(0)
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int64(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}
func (f *FastIO) NextInt64s(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt64()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}

func (f *FastIO) Print(a ...interface{}) {
	fmt.Fprint(f, a...)
}
func (f *FastIO) PrintInts(a ...int) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInts(a ...int) {
	f.PrintInts(a...)
	f.Println()
}
func (f *FastIO) PrintInt64s(a ...int64) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInt64s(a ...int64) {
	f.PrintInt64s(a...)
	f.Println()
}

package main

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

var rw = NewFastIO(os.Stdin, os.Stdout)

func main() {
	defer rw.Flush()
	n, k := rw.NextInt(), rw.NextInt64()
	a := make([]int64, n+1)
	par := 0
	all := true
	a0 := true
	for i := 0; i <= n; i++ {
		tokn := rw.Next()
		if tokn == "?" {
			all = false
			a0 = a0 && i != 0
		} else {
			par ^= 1
			a[i], _ = strconv.ParseInt(tokn, 10, 64)
		}
	}
	var win bool
	if k == 0 {
		if a0 {
			win = a[0] == 0
		} else {
			win = par == 1
		}
	} else {
		if all {
			mods := [...]int64{1e9 + 7, 1e9 + 9, 1e9 + 13}
			vals := [...]int64{0, 0, 0}
			for i := n; i >= 0; i-- {
				for j := 0; j < len(mods); j++ {
					vals[j] *= k
					vals[j] += a[i]
					vals[j] %= mods[j]
				}
			}
			win = vals[0] == 0 && vals[1] == 0
		} else {
			win = n%2 == 1
		}
	}
	if win {
		rw.Println("Yes")
	} else {
		rw.Println("No")
	}
}

// @meooow template uwu
type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) Next() string {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	var s []byte
	for ; c > ' '; c = f.readC() {
		s = append(s, c)
	}
	return string(s)
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}
func (f *FastIO) NextInt64() int64 {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := int64(0)
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int64(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}
func (f *FastIO) NextInt64s(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt64()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}

func (f *FastIO) Print(a ...interface{}) {
	fmt.Fprint(f, a...)
}
func (f *FastIO) PrintInts(a ...int) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInts(a ...int) {
	f.PrintInts(a...)
	f.Println()
}
func (f *FastIO) PrintInt64s(a ...int64) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInt64s(a ...int64) {
	f.PrintInt64s(a...)
	f.Println()
}

package main

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

var rw = NewFastIO(os.Stdin, os.Stdout)

func main() {
	defer rw.Flush()
	n, k := rw.NextInt(), rw.NextInt64()
	a := make([]int64, n+1)
	par := 0
	all := true
	a0 := true
	for i := 0; i <= n; i++ {
		tokn := rw.Next()
		if tokn == "?" {
			all = false
			a0 = a0 && i != 0
		} else {
			par ^= 1
			a[i], _ = strconv.ParseInt(tokn, 10, 64)
		}
	}
	var win bool
	if k == 0 {
		if a0 {
			win = a[0] == 0
		} else {
			win = par == 1
		}
	} else {
		if all {
			mods := [...]int64{1e9 + 7, 1e9 + 9, 1e9 + 47}
			vals := [...]int64{0, 0, 0}
			for i := n; i >= 0; i-- {
				for j := 0; j < len(mods); j++ {
					vals[j] *= k
					vals[j] += a[i]
					vals[j] %= mods[j]
				}
			}
			win = vals[0] == 0 && vals[1] == 0
		} else {
			win = n%2 == 1
		}
	}
	if win {
		rw.Println("Yes")
	} else {
		rw.Println("No")
	}
}

// @meooow template uwu
type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) Next() string {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	var s []byte
	for ; c > ' '; c = f.readC() {
		s = append(s, c)
	}
	return string(s)
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}
func (f *FastIO) NextInt64() int64 {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := int64(0)
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int64(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}
func (f *FastIO) NextInt64s(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt64()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}

func (f *FastIO) Print(a ...interface{}) {
	fmt.Fprint(f, a...)
}
func (f *FastIO) PrintInts(a ...int) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInts(a ...int) {
	f.PrintInts(a...)
	f.Println()
}
func (f *FastIO) PrintInt64s(a ...int64) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInt64s(a ...int64) {
	f.PrintInt64s(a...)
	f.Println()
}

package main

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

var rw = NewFastIO(os.Stdin, os.Stdout)

func main() {
	defer rw.Flush()
	n, k := rw.NextInt(), rw.NextInt64()
	a := make([]int64, n+1)
	par := 0
	all := true
	a0 := true
	for i := 0; i <= n; i++ {
		tokn := rw.Next()
		if tokn == "?" {
			all = false
			a0 = a0 && i != 0
		} else {
			par ^= 1
			a[i], _ = strconv.ParseInt(tokn, 10, 64)
		}
	}
	var win bool
	if k == 0 {
		if a0 {
			win = a[0] == 0
		} else {
			win = par == 1
		}
	} else {
		if all {
			mods := [...]int64{1e9 + 7, 1e9 + 9, 1e9 + 47}
			vals := [...]int64{0, 0, 0}
			for i := n; i >= 0; i-- {
				for j := 0; j < len(mods); j++ {
					vals[j] *= k
					vals[j] += a[i]
					vals[j] %= mods[j]
				}
			}
			win = vals[0] == 0 && vals[1] == 0 && vals[2] == 0
		} else {
			win = n%2 == 1
		}
	}
	if win {
		rw.Println("Yes")
	} else {
		rw.Println("No")
	}
}

// @meooow template uwu
type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) Next() string {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	var s []byte
	for ; c > ' '; c = f.readC() {
		s = append(s, c)
	}
	return string(s)
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}
func (f *FastIO) NextInt64() int64 {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := int64(0)
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int64(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}
func (f *FastIO) NextInt64s(n int) []int64 {
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt64()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}

func (f *FastIO) Print(a ...interface{}) {
	fmt.Fprint(f, a...)
}
func (f *FastIO) PrintInts(a ...int) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInts(a ...int) {
	f.PrintInts(a...)
	f.Println()
}
func (f *FastIO) PrintInt64s(a ...int64) {
	if len(a) > 0 {
		f.Print(a[0])
		for _, x := range a[1:] {
			f.Print(" ", x)
		}
	}
}
func (f *FastIO) PrintlnInt64s(a ...int64) {
	f.PrintInt64s(a...)
	f.Println()
}


PolandBall is playing a game with EnemyBall. The rules are simple. Players have to say words in turns. You cannot say a word which was already said. PolandBall starts. The Ball which can't say a new word loses.You're given two lists of words familiar to PolandBall and EnemyBall. Can you determine who wins the game, if both play optimally?

The first input line contains two integers n and m (1 ≤ n, m ≤ 103) — number of words PolandBall and EnemyBall know, respectively. Then n strings follow, one per line — words familiar to PolandBall. Then m strings follow, one per line — words familiar to EnemyBall. Note that one Ball cannot know a word more than once (strings are unique), but some words can be known by both players. Each word is non-empty and consists of no more than 500 lowercase English alphabet letters.

In a single line of print the answer — "YES" if PolandBall wins and "NO" otherwise. Both Balls play optimally.

2 2
kremowka
wadowicka
kremowka
wiedenska

NoteIn the first example PolandBall knows much more words and wins effortlessly.In the second example if PolandBall says kremowka first, then EnemyBall cannot use that word anymore. EnemyBall can only say wiedenska. PolandBall says wadowicka and wins.

package main

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

func main() {
	scanner := bufio.NewScanner(reader)
	scanner.Scan()
	line := scanner.Text()
	tokens := strings.Split(line, " ")
	n, _ := strconv.Atoi(tokens[0])
	m, _ := strconv.Atoi(tokens[1])
	poland := make(map[string]bool)
	enemy := make(map[string]bool)
	both := 0
	for n > 0 {
		n--
		scanner.Scan()
		poland[scanner.Text()] = true
	}
	for m > 0 {
		m--
		scanner.Scan()
		if _, contains := poland[scanner.Text()]; contains {
			delete(poland, scanner.Text())
			both++
		} else {
			enemy[scanner.Text()] = true
		}
	}
	fmt.Fprintln(writer, solve(len(poland), len(enemy), both))
	writer.Flush()
}

func solve(p, e, b int) string {
	turn := 0
	for b > 0 {
		turn++
		b--
	}
	for {
		if turn%2 == 0 {
			if p == 0 {
				return "NO"
			}
			p--
		} else {
			if e == 0 {
				return "YES"
			}
			e--
		}
		turn++
	}
}

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

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

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

func max64(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

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

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

var (
	reader = bufio.NewReaderSize(os.Stdin, 1<<13)
	writer = bufio.NewWriterSize(os.Stdout, 1<<13)
)

func readi() int {
	return int(readi64())
}

func read2i() (int, int) {
	return readi(), readi()
}

func readis(n int) []int {
	res := make([]int, n)
	for i := range res {
		res[i] = readi()
	}
	return res
}

func readi64() int64 {
	b, err := reader.ReadByte()
	for !isValid(b, err) {
		b, err = reader.ReadByte()
	}
	sign, res := int64(1), int64(0)
	if b == '-' {
		sign *= -1
		b, err = reader.ReadByte()
	}
	for isValid(b, err) {
		res = res*10 + int64(b-'0')
		b, err = reader.ReadByte()
	}
	return res * sign
}

func readline() string {
	res := new(bytes.Buffer)
	for {
		line, isPrefix, err := reader.ReadLine()
		if err != nil {
			panic(err)
		}
		res.Write(line)
		if !isPrefix {
			break
		}
	}
	return res.String()
}

func isValid(b byte, err error) bool {
	return err == nil && (('0' <= b && b <= '9') || b == '-')
}

package main

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

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

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

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

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

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

func solve(n int) {
	var m int
	I(&m, "\n")
	a, b := make([]string, n), make([]string, m)
	for i := 0; i < n; i++ {
		I(&a[i], "\n")
	}
	for i := 0; i < m; i++ {
		I(&b[i], "\n")
	}
	o := 0
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if a[i] == b[j] {
				o++
			}
		}
	}
	for i := 0; i < o; i++ {
		if i%2 == 0 {
			m--
		} else {
			n--
		}
	}
	if n > m {
		O("YES", "\n")
	} else {
		O("NO", "\n")
	}
}

package main

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

func solve() {
	n := readInt()
	m := readInt()
	words := map[string]int{}
	for i := 0; i < n; i++ {
		words[readString()]++
	}
	common := 0
	for i := 0; i < m; i++ {
		if _, ok := words[readString()]; ok {
			common++
		}
	}
	for {
		if common > 0 {
			common--
			n--
			m--
		} else if n > 0 {
			n--
		} else {
			fmt.Println("NO")
			return
		}
		if common > 0 {
			common--
			n--
			m--
		} else if m > 0 {
			m--
		} else {
			fmt.Println("YES")
			return
		}
	}
}

var scanner *bufio.Scanner

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

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

// IO

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

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

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

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

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

package main

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

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

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

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

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

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

func solve(n int) {
	var m int
	I(&m, "\n")
	a, aa, b, bb := make([]string, n), make([]string, n), make([]string, m), make([]string, m)
	for i := 0; i < n; i++ {
		I(&a[i], "\n")
	}
	for i := 0; i < m; i++ {
		I(&b[i], "\n")
		flag := false
		for j := 0; j < n; j++ {
			if a[j] == b[i] {
				flag = true
			}
		}
		if flag {
			bb = append([]string{b[i]}, bb...)

		} else {
			bb = append(bb, b[i])
		}
	}
	for i := 0; i < n; i++ {
		flag := false
		for j := 0; j < m; j++ {
			if a[i] == b[j] {
				flag = true
			}
		}
		if flag {
			aa = append([]string{a[i]}, aa...)
		} else {
			aa = append(aa, a[i])
		}
	}
	me := true
	for len(aa) > 0 && len(bb) > 0 {
		if aa[0] == bb[0] {
			aa = aa[1:]
			bb = bb[1:]
		} else {
			if me {
				aa = aa[1:]
			} else {
				bb = bb[1:]
			}
		}
		me = !me
	}
	if len(aa) > 0 {
		O("YES", "\n")
	} else {
		O("NO", "\n")
	}
}