package main

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

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

	var T, n, m int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n, &m)
		a := make([][]int, n)
		for i := range a {
			a[i] = make([]int, m)
			for j := range a[i] {
				Fscan(in, &a[i][j])
			}
			sort.Ints(a[i])
		}
		for j := m; j > 1; j-- {
			p := 0
			for i, r := range a {
				if r[0] < a[p][0] {
					p = i
				}
			}
			a[p] = append(append(append([]int(nil), a[p][1:j]...), a[p][0]), a[p][j:]...)
		}
		for _, r := range a {
			for _, v := range r {
				Fprint(out, v, " ")
			}
			Fprintln(out)
		}
	}
}

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

package main

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

type path struct {
	i, j, l int
}

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

	var t int

	fmt.Fscanf(reader, "%d\n", &t)
	for ; t > 0; t-- {
		var n, m int
		fmt.Fscanf(reader, "%d %d\n", &n, &m)
		allPath := make([]path, 0, n*m)
		var tempPath path
		for i, j := 0, 0; i < n; i++ {
			tempPath.i = i
			for j = 0; j < m-1; j++ {
				tempPath.j = j
				fmt.Fscanf(reader, "%d ", &tempPath.l)
				allPath = append(allPath, tempPath)
			}

			tempPath.j = j
			fmt.Fscanf(reader, "%d\n", &tempPath.l)
			allPath = append(allPath, tempPath)
		}

		sort.Slice(allPath, func(i, j int) bool { return allPath[i].l < allPath[j].l })

		var ans [102][102]int

		for j := 1; j <= m; j++ {
			temp := allPath[j-1]
			ans[temp.i][j] = temp.l
		}

		for j := m; j < len(allPath); j++ {
			temp := allPath[j]

			start := ans[temp.i][0] + 1

			for ; ans[temp.i][start] > 0; start++ {

			}

			ans[temp.i][start] = temp.l
		}

		for i := 0; i < n; i++ {
			for j := 1; j < m; j++ {
				fmt.Printf("%d ", ans[i][j])
			}

			fmt.Printf("%d\n", ans[i][m])
		}
	}
}

package main

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

	//"math"
	"os"
)

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

	var t int
	for Fscan(in, &t); t > 0; t-- {
		var n, m int
		Fscan(in, &n, &m)

		paths := make([][2]int, n * m)

		for i, _ := range paths {
			Fscan(in, &paths[i][0])
			paths[i][1] = i
		}

		sort.Slice(paths, func(i, j int) bool {
			return paths[i][0] < paths[j][0]
		})

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

		for i := 0; i < m; i++ {
			ans[paths[i][1] / m][i] = paths[i][0]
		}

		for i := m; i < len(paths); i++ {
			for j, _ := range ans[paths[i][1] / m] {
				if ans[paths[i][1] / m][j] == 0 {
					ans[paths[i][1] / m][j] = paths[i][0]
					break
				}
			}
		}

		for _, row := range ans {
			for _, cell := range row {
				Fprint(out, cell, " ")
			}
			Fprintln(out)
		}
	}
}

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

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

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

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

package main

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

	//"math"
	"os"
)

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

	var t int
	for Fscan(in, &t); t > 0; t-- {
		var n, m int
		Fscan(in, &n, &m)

		paths := make([][2]int, n * m)

		for i, _ := range paths {
			Fscan(in, &paths[i][0])
			paths[i][1] = i
		}

		sort.Slice(paths, func(i, j int) bool {
			return paths[i][0] < paths[j][0]
		})

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

		for i, cnt := 0, 0; i < m; i++ {
			ans[paths[i][1] / m][cnt] = paths[i][0]
			cnt++
		}

		for i := m; i < len(paths); i++ {
			for j, _ := range ans[paths[i][1] / m] {
				if ans[paths[i][1] / m][j] == 0 {
					ans[paths[i][1] / m][j] = paths[i][0]
					break
				}
			}
		}

		for _, row := range ans {
			for _, cell := range row {
				Fprint(out, cell, " ")
			}
			Fprintln(out)
		}
	}
}

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

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

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

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


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"index/suffixarray"
	"log"
	"math"
	"net"
	"os"
	"path"
	"sort"
	"strconv"
	"strings"
	"time"
)

// For Codeforces
func main() {
	io := newStdIO()
	defer io.Flush()
	for T := io.ScanUInt16(); T > 0; T-- {
		solve(&io)
	}
}
func solve(io *IO) {
	n := io.ScanInt32()
	s := io.ScanString()

	var max byte = 'a'
	for i := int32(0); i < n; i++ {
		if s[i] > max {max = s[i]}
	}
	io.PrintLn(max - 'a'+1)
}

// #region INTERFACES

// From https://pkg.go.dev/golang.org/x/exp/constraints
type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}
type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}
type Integer interface {
	Signed | Unsigned
}
type Float interface {
	~float32 | ~float64
}
type Complex interface {
	~complex64 | ~complex128
}
type Ordered interface {
	Integer | Float | ~string
}

type Prioritizable[T any] interface {
	PriorTo(x T) bool // If you take this as a relation: if (a,b) in R => (b,a) not in R
}

// #endregion
// #region TYPES WITH METHODS
// #region SingleLinkedList
type singleLinkedListNode[T comparable] struct {
	Value T
	Next  *singleLinkedListNode[T]
}

type SingleLinkedList[T comparable, IndexType Unsigned] struct {
	first  *singleLinkedListNode[T]
	last   *singleLinkedListNode[T]
	length IndexType
}

func NewSingleLinkedList[T comparable, IndexType Unsigned]() *SingleLinkedList[T, IndexType] {
	return &SingleLinkedList[T, IndexType]{
		first:  nil,
		last:   nil,
		length: 0,
	}
}
func (l *SingleLinkedList[T, I]) Len() I { return l.length }

// length > 0
func (l *SingleLinkedList[T, I]) First() T { return l.first.Value }

// length > 0
func (l *SingleLinkedList[T, I]) Last() T { return l.last.Value }

func (l *SingleLinkedList[T, I]) InsertFirst(value T) {
	if l.length == 0 {
		nodeToInsert := &singleLinkedListNode[T]{
			Value: value,
			Next:  l.first,
		}
		l.first = nodeToInsert
		l.last = nodeToInsert
	} else {
		l.first = &singleLinkedListNode[T]{
			Value: value,
			Next:  l.first,
		}
	}
	l.length++
}

func (l *SingleLinkedList[T, I]) InsertLast(value T) {
	if l.length == 0 {
		nodeToInsert := &singleLinkedListNode[T]{
			Value: value,
			Next:  l.first,
		}
		l.first = nodeToInsert
		l.last = nodeToInsert
	} else {
		l.last.Next = &singleLinkedListNode[T]{
			Value: value,
			Next:  nil,
		}
		l.last = l.last.Next
	}
	l.length++
}

// index <= length
func (l *SingleLinkedList[T, I]) InsertAt(index I, value T) {
	if index == 0 {
		l.InsertFirst(value)
		return
	}
	if index == l.length {
		l.InsertLast(value)
		return
	}

	n := l.first
	for index > 1 {
		n = n.Next
		index--
	}
	n.Next = &singleLinkedListNode[T]{
		Value: value,
		Next:  n.Next,
	}
	l.length++
}

func (l *SingleLinkedList[T, I]) Contains(value T) bool {
	tmp := l.first
	for i := I(0); i < l.length; i++ {
		if tmp.Value == value {
			return true
		}
		tmp = tmp.Next
	}
	return false
}
func (l *SingleLinkedList[T, I]) Clear() {
	l.first = nil
	l.last = nil
	l.length = 0
}

// index < length
func (l *SingleLinkedList[T, I]) GetElementAt(index I) T {
	n := l.first
	for index > 0 {
		n = n.Next
		index--
	}
	return n.Value
}

// index < length
func (l *SingleLinkedList[T, I]) SetElementAt(index I, value T) {
	n := l.first
	for index > 0 {
		n = n.Next
		index--
	}
	n.Value = value
}

func (l *SingleLinkedList[T, I]) RemoveFirst() T {
	tmp := l.first
	l.first = l.first.Next
	l.length--
	if l.length == 0 {
		l.last = nil
	}
	return tmp.Value
}
func (l *SingleLinkedList[T, I]) RemoveLast() (value T) {
	value = l.last.Value
	if l.length == 1 {
		l.first = nil
		l.last = nil
		l.length = 0
		return
	}

	tmp := l.first
	for i := I(2); i < l.length; i++ {
		tmp = tmp.Next
	}
	l.last = tmp
	return
}

func (l *SingleLinkedList[T, I]) RemoveAt(index I) T {
	if index == 0 {
		return l.RemoveFirst()
	}
	if index == l.length-1 {
		return l.RemoveLast()
	}

	tmp := l.first
	for i := I(1); i < index; i++ {
		tmp = tmp.Next
	}
	res := tmp.Next.Value
	tmp.Next = tmp.Next.Next
	return res
}

func (l *SingleLinkedList[T, I]) ToSlice() (res []T) {
	res = make([]T, 0, l.length)
	tmp := l.first
	for i := I(0); i < l.length; i++ {
		res = append(res, tmp.Value)
		tmp = tmp.Next
	}
	return
}
func (it *SingleLinkedList[T, I]) String() string {
	return "Qua:: " + fmt.Sprint(it.ToSlice())
}

// #endregion
// #region Queue

type Queue[T comparable, I Unsigned] struct {
	l SingleLinkedList[T, I]
}

func NewQueue[T comparable, I Unsigned]() *Queue[T, I] {
	return &Queue[T, I]{
		l: SingleLinkedList[T, I]{
			first:  nil,
			last:   nil,
			length: 0,
		},
	}
}
func (q *Queue[T, I]) Len() I          { return q.l.length }
func (q *Queue[T, I]) Enqueue(value T) { q.l.InsertLast(value) }
func (q *Queue[T, I]) Dequeue(T) T     { return q.l.RemoveFirst() }
func (q *Queue[T, I]) Preview() T      { return q.l.First() }
func (q *Queue[T, I]) String() string  { return q.l.String() }

// #endregion
// #region Stack

type Stack[T comparable, I Unsigned] struct {
	l SingleLinkedList[T, I]
}

func NewStack[T comparable, I Unsigned]() *Stack[T, I] {
	return &Stack[T, I]{
		l: SingleLinkedList[T, I]{
			first:  nil,
			last:   nil,
			length: 0,
		},
	}
}
func (s *Stack[T, I]) Len() I         { return s.l.length }
func (s *Stack[T, I]) Push(value T)   { s.l.InsertFirst(value) }
func (s *Stack[T, I]) Pop(T) T        { return s.l.RemoveFirst() }
func (s *Stack[T, I]) Preview() T     { return s.l.First() }
func (s *Stack[T, I]) String() string { return s.l.String() }

// #endregion
// #region Heap
type BinaryHeap[T Prioritizable[T], I Signed] struct {
	s []T
}

func NewBinaryHeap[T Prioritizable[T], I Signed](s []T) (h *BinaryHeap[T, I]) {
	h = &BinaryHeap[T, I]{
		s: s,
	}

	for i := (h.Len() - 2) / 2; i >= 0; i-- {
		h.heapifyDown(i)
	}
	return
}
func (h *BinaryHeap[T, I]) Len() I {
	return I(len(h.s))
}
func (h *BinaryHeap[T, I]) Push(value T) {
	h.s = append(h.s, value)
	h.heapifyUp(h.Len() - 1)
}
func (h *BinaryHeap[T, I]) Pop() (res T) {
	res = h.s[0]
	h.s[0] = h.s[h.Len()-1]
	h.s = h.s[:h.Len()-1]
	h.heapifyDown(0)
	return
}

func (h *BinaryHeap[T, I]) heapifyDown(index I) bool {
	origin := index
	for {
		j := index*2 + 2
		if j < h.Len() {
			if h.s[j-1].PriorTo(h.s[j]) {
				j--
			}
		} else {
			if j <= h.Len() && !h.s[j].PriorTo(h.s[index]) {
				h.s[j], h.s[index] = h.s[index], h.s[j]
			}
			break
		}
		if h.s[j].PriorTo(h.s[index]) {
			h.s[j], h.s[index] = h.s[index], h.s[j]
			index = j
		} else {
			break
		}
	}
	return origin != index
}
func (h *BinaryHeap[T, I]) heapifyUp(index I) {
	for {
		parent := (index - 1) / 2
		if parent == index || h.s[parent].PriorTo(h.s[index]) {
			break
		}
		h.s[index], h.s[parent] = h.s[parent], h.s[index]
		index = parent
	}
}

// #endregion

// #endregion

// #region FUNCTIONS
func Max[T Ordered](a, b T) T {
	if a >= b {
		return a
	}
	return b
}
func Min[T Ordered](a, b T) T {
	if a <= b {
		return a
	}
	return b
}
func Abs[T Integer | Float](a T) T {
	if a < 0 {
		return -a
	}
	return a
}
func Swap[T any](a, b *T) {
	*a, *b = *b, *a
}

// At least one != 0
func GCD[T Unsigned](a, b T) T {
	if b < a {
		Swap(&a, &b)
	}
	for {
		if a == 0 {
			return b
		}
		r := (b % a)
		b = a
		a = r
	}
}

// At least one != 0
func LCM[T Unsigned](a, b T) T {
	return (a * b) / GCD(a, b)
}

func First[T any](a T, _ any) T { return a }

// #endregion

// #region IO STUFF
type IO struct {
	r *bufio.Reader
	w *bufio.Writer
}

func newStdIO() IO {
	return IO{
		r: bufio.NewReader(os.Stdin),
		w: bufio.NewWriter(os.Stdout),
	}
}

// Is assumed that input.txt file exists
func newFileIO() IO {
	return IO{
		r: bufio.NewReader(First(os.Open("input.txt"))),
		w: bufio.NewWriter(First(os.OpenFile("output.txt", os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.ModePerm))),
	}
}

func (io *IO) ScanInt8() (x int8)   { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanInt16() (x int16) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanInt32() (x int32) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanInt64() (x int64) { fmt.Fscan(io.r, &x); return }

func (io *IO) ScanUInt8() (x uint8)   { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanUInt16() (x uint16) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanUInt32() (x uint32) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanUInt64() (x uint64) { fmt.Fscan(io.r, &x); return }

func (io *IO) ScanFloat32() (x float32) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanFloat64() (x float64) { fmt.Fscan(io.r, &x); return }

func (io *IO) ScanString() (x string) { fmt.Fscan(io.r, &x); return }

func (io *IO) Print(x ...any)   { fmt.Fprint(io.w, x...) }
func (io *IO) PrintLn(x ...any) { fmt.Fprintln(io.w, x...) }

func (io *IO) Flush() { io.w.Flush() }

// #endregion

// #region KEEP IMPORTS
func D() {
	_ = bufio.Reader{}
	_ = bytes.Buffer{}
	_ = suffixarray.Index{}
	_ = log.Default()
	_ = math.Abs(0)
	_ = net.Dialer{}
	_ = path.ErrBadPattern
	_ = sort.Float64sAreSorted(nil)
	_ = strconv.ErrRange
	_ = strings.Builder{}
	_ = time.ANSIC
	_ = newStdIO()
	_ = newFileIO()
}

// #endregion

package main

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

func main() {
    reader := bufio.NewReader(os.Stdin)
    line, _ := reader.ReadString('\n')
    T, err := strconv.Atoi(line[:len(line)-2])
   if err != nil {
       fmt.Println(err)
   }
    for t:= 0; t < T; t++ {
        line, _ := reader.ReadString('\n')
        n, _ := strconv.Atoi(line[:len(line)-2])
        s, _ := reader.ReadString('\n')
        z := 0
        for i:= 0; i < n; i++ {
            x := int(s[i]) - 97 + 1
            if x > z {
                z = x
            }
        }
        fmt.Println(z)
    }
}

package main

import (
	"fmt"
)

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

	for i := 0; i < t; i++ {
		execute()
	}
}

func execute() {
	var max rune
	var x int
	fmt.Scan(&x)
	var s string
	fmt.Scan(&s)
	for _, v := range s {
		if v > max {
			max = v
		}
	}
	fmt.Println(max - 'a' + 1)
}

package main
// github.com/jamesgrimard/codeforces
import(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n int
		var s string
		fmt.Fscan(in,&n,&s)
		var max byte = 0
		for j:=0;j<n;j++{
			if s[j] > max {
				max = s[j]
			}
		}
		fmt.Fprintln(out,max-96)
	}
}

package main

import "fmt"

func main() {
	var (
		t int
		n int
		str string
		max byte
	)
	fmt.Scanln(&t)
	for i := 0; i < t; i++ {
		fmt.Scanln(&n)
		fmt.Scanln(&str)
		max = str[0]
		for j := 0; j < n; j++ {
			if max < str[j] {
				max = str[j]
			}
		}
		fmt.Println(max - 96)
	}
}

package main

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

const cf = true

func solve() {
	var n int
	fmt.Fscan(in, &n)
	var str string
	fmt.Fscan(in, &str)
	mx := 0
	for i := range str {
		mx = max(mx, int(str[i]-'a'+1))
	}
	fmt.Fprintln(out, mx)
}

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
}

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"
	"os"
	"strconv"
	"strings"
)

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

func (in *CF1760B) 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 *CF1760B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

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

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

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

/**
Run solve the problem CF1760B
Date: 11/21/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1760/B
Problem: CF1760B
**/
func (in *CF1760B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		str := in.NextString()
		max := 0
		for i := 0; i < n; i++ {
			v := int(str[i] - 'a')
			if v > max {
				max = v
			}
		}
		fmt.Println(max+1)

	}
}

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

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

/*
	A template for Go on codeforces.com
	Author: Yakov, frvr.ru
*/

package main

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

// to sort a string
type sortRunes []rune

func (s sortRunes) Less(i, j int) bool {
	return s[i] < s[j]
}

func (s sortRunes) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}

func (s sortRunes) Len() int {
	return len(s)
}

func SortString(s string) string {
	r := []rune(s)
	sort.Sort(sortRunes(r))
	return string(r)
}

func main() {
	n := readInt()
	for i := 0; i < n; i++ {
		l := readInt()
		s := readString()
		var max int
		for i := 0; i < l; i++ {
			d := int(s[i] - 'a')
			if max < d {
				max = d
			}
		}
		writeLine(max + 1)
	}
}

/* ~~~~~~~~~~ */
/* ~~~~~~~~~~ */
/* ~~~~~~~~~~ */

var in = bufio.NewReader(os.Stdin)

type float = float32
type double = float64
type long = int64
type ulong = uint64

func typeOf(arg interface{}) string {
	switch reflect.TypeOf(arg).Kind() {
	case reflect.Int:
		return "int"
	case reflect.Int8:
		return "int8"
	case reflect.Int16:
		return "int16"
	case reflect.Int32:
		return "int32"
	case reflect.Int64:
		return "int64"
	case reflect.Uint:
		return "uint"
	case reflect.Uint8:
		return "uint8"
	case reflect.Uint16:
		return "uint16"
	case reflect.Uint32:
		return "uint32"
	case reflect.Uint64:
		return "uint64"
	case reflect.Float32:
		return "float32"
	case reflect.Float64:
		return "float64"
	case reflect.Complex64:
		return "complex64"
	case reflect.Complex128:
		return "complex128"
	case reflect.Bool:
		return "bool"
	case reflect.String:
		return "string"
	case reflect.Chan:
		return "chan"
	case reflect.Ptr:
		return "ptr"
	case reflect.Uintptr:
		return "uintptr"
	case reflect.UnsafePointer:
		return "unsafeptr"
	case reflect.Interface:
		return "interface"
	case reflect.Array:
		return "array"
	case reflect.Slice:
		return "slice"
	case reflect.Map:
		return "map"
	case reflect.Struct:
		return "struct"
	case reflect.Func:
		return "func"
	case reflect.Invalid:
		return "invalid"
	default:
		return "nil"
	}
}

/* ~~~~~~~~~~ */

func _scln() string {
	ln, _ := in.ReadString('\n')
	return strings.Trim(ln, " \r\n")
}
func _sc(s []string) string {
	if len(s) == 0 {
		return _scln()
	}
	return s[0]
}

func readLine() string              { return _scln() }
func readString() string            { return _scln() }
func readStrings() []string         { return strings.Split(_scln(), " ") }
func readBool(s ...string) bool     { t, _ := strconv.ParseBool(_sc(s)); return t }
func readByte(s ...string) byte     { t, _ := strconv.ParseUint(_sc(s), 10, 8); return byte(t) }
func readDouble(s ...string) double { t, _ := strconv.ParseFloat(_sc(s), 64); return t }
func readFloat(s ...string) float   { t, _ := strconv.ParseFloat(_sc(s), 32); return float32(t) }
func readInt(s ...string) int       { t, _ := strconv.Atoi(_sc(s)); return t }
func readLong(s ...string) long     { t, _ := strconv.ParseInt(_sc(s), 10, 64); return t }
func readULong(s ...string) ulong   { t, _ := strconv.ParseUint(_sc(s), 10, 64); return t }

/* ~~~~~~~~~~ */

// Too much overhead with universal method using interface{}, wait for the generics,
// but for now — just don't look at the redundancy of the code after that commentary :)

func readBools() []bool {
	strs := readStrings()
	arr := make([]bool, len(strs))
	for i, s := range strs {
		arr[i] = readBool(s)
	}
	return arr
}
func readBytes() []byte {
	strs := readStrings()
	arr := make([]byte, len(strs))
	for i, s := range strs {
		arr[i] = readByte(s)
	}
	return arr
}
func readDoubles() []double {
	strs := readStrings()
	arr := make([]double, len(strs))
	for i, s := range strs {
		arr[i] = readDouble(s)
	}
	return arr
}
func readFloats() []float {
	strs := readStrings()
	arr := make([]float, len(strs))
	for i, s := range strs {
		arr[i] = readFloat(s)
	}
	return arr
}
func readInts() []int {
	strs := readStrings()
	arr := make([]int, len(strs))
	for i, s := range strs {
		arr[i] = readInt(s)
	}
	return arr
}
func readLongs() []long {
	strs := readStrings()
	arr := make([]long, len(strs))
	for i, s := range strs {
		arr[i] = readLong(s)
	}
	return arr
}
func readULongs() []ulong {
	strs := readStrings()
	arr := make([]ulong, len(strs))
	for i, s := range strs {
		arr[i] = readULong(s)
	}
	return arr
}

/* ~~~~~~~~~~ */

func write(arg ...interface{})                 { fmt.Print(arg...) }
func writeLine(arg ...interface{})             { fmt.Println(arg...) }
func writeFormat(f string, arg ...interface{}) { fmt.Printf(f, arg...) }

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < t; i++ {
		max := 0
		scanner.Scan()
		scanner.Scan()
		sl := strings.Split(scanner.Text(), "")
		for j := 0; j < len(sl); j++ {
			c := []rune(sl[j])
			if int(c[0]-'a'+1) > max {
				max = int(c[0]-'a') + 1
			}
		}
		fmt.Println(max)
	}
}

package main

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

func main() {
	var testCases int

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

	defer writer.Flush()
	fmt.Fscan(reader, &testCases)

	for testCase := 1; testCase <= testCases; testCase++ {
		var n int
		var s string
		fmt.Fscan(reader, &n)
		fmt.Fscan(reader, &s)

		output := solve(s, n)

		fmt.Fprintln(writer, output)
	}
}

func solve(s string, n int) int {

	max := 0
	for _, c := range s {
		t := int(c-'a') + 1
		if t > max {
			max = t
		}
	}

	return max

}

package main

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

func readArray(sc *bufio.Scanner) (arr []int) {
	sc.Scan()
	for _, value := range strings.Split(sc.Text(), " ") {
		number, _ := strconv.Atoi(value)
		arr = append(arr, number)
	}
	return
}

func readData(sc *bufio.Scanner) (a string) {
	sc.Scan()
	sc.Scan()
	a = sc.Text()
	return
}

func Sum(x, y int, arr []int) int {
	left, right := len(arr)-x, len(arr)-x+y
	l := 0
	if left != 0 {
		l = arr[left-1]
	}
	r := len(arr)
	if right <= len(arr) {
		r = arr[right-1]
	}
	return r - l
}

// 001   1
// 1010100101

func solve(a string) rune {
	max := rune(0)
	for _, i := range a {
		v := i - 96
		if v > max {
			max = v
		}
	}
	return max
}

func main() {
	var n int
	fmt.Scanln(&n)
	sc := bufio.NewScanner(os.Stdin)
	for ; n > 0; n-- {
		a := readData(sc)
		fmt.Println(solve(a))
	}
}

package main

import "fmt"

func main() {
	var n, t int
	var s string
	fmt.Scan(&t)
	for t > 0 {
		t--
		fmt.Scan(&n, &s)
		max := 'a'
		for _, c := range s {
			if c > max {
				max = c
			}
		}
		fmt.Println(max - 'a' + 1)
	}

}

package main

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

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

	maxx := 0
	for _, r := range s {
		maxx = max(int(r-'a'), maxx)
	}

	fmt.Fprintln(writer, maxx+1)
}

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

	t := readInt(reader)

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

	writer.Flush()
}

func min[T int | int64](a, b T) T {
	if a < b {
		return a
	}

	return b
}

func max[T int | int64](a, b T) T {
	if a > b {
		return a
	}

	return b
}

func abs[T int | int64](a T) T {
	if a < 0 {
		return a * -1
	} else {
		return a
	}
}

func gcd[T int | int64](x, y T) T {
	for y > 0 {
		x, y = y, x%y
	}

	return x
}

func lcm[T int | int64](x, y T) T {
	return x * y / gcd(x, y)
}

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 (
	"fmt"
)

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

func solve() {
	var s string
	var n int
	fmt.Scan(&n)
	fmt.Scan(&s)
	// n := len(s)
	mav := 0
	for _, r := range s {
		mav = max(mav, int(r - 'a') + 1)
	}
	fmt.Println(mav)
}

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

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	//输入t
	var t, n int
	var s string
	fmt.Fscan(in, &t)
	//nums := make([]int, 3)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &n)
		fmt.Fscan(in, &s)
		ans := s[0] - 'a' + 1
		for j := 0; j < len(s); j++ {
			id := s[j] - 'a' + 1
			if id > ans {
				ans = id
			}
		}
		// 输出res
		fmt.Fprintln(out, ans)
	}
}

package main

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

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

func main() {
	var t, n int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var s string
		fmt.Fscan(in, &n)
		fmt.Fscan(in, &s)
		mx := 0
		for _, v := range s {
			mx = max(mx, int(v-'a'+1))
		}
		fmt.Println(mx)
	}
}

package main

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

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

// source: _
func solve() {
	_, s := _readInt(), _readStr()
	l := make([]rune, 26)
	for _, r := range s {
		l[r-'a']++
	}
	for i := 25; i >= 0; i-- {
		if l[i] != 0 {
			_print(i + 1)
			return
		}
	}
}

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"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

const mod int = 998244353
const N int = 5e5 + 5

func main() {
	sc.Buffer(make([]byte, 500000*1+1), 500000)
	sc.Split(bufio.ScanWords)

	T := nextInt()
	for T > 0 {
		T--
		_, s := nextInt(), nextString()
		ans := 0
		for _, c := range s {
			ans = max(ans, int(c-'a')+1)
		}
		fmt.Println(ans)
	}
}

func max(args ...int) int {
	res := args[0]
	for _, v := range args {
		if v > res {
			res = v
		}
	}
	return res
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

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

package main

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

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

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

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

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

		var a []byte
		fmt.Fscan(r, &a)

		res := byte('a')
		for _, v := range a {
			if v > res {
				res = v
			}
		}

		fmt.Fprintln(w, res - 'a' + 1)
	}

}

package main

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

// https://space.bilibili.com/206214
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	solve := func(curCase int) {
		var n int
		s := []byte{}
		Fscan(in, &n,&s)
		sort.Slice(s, func(i, j int) bool { return s[i] < s[j] })
		Fprintln(out, s[n-1]-'a'+1)
	}

	cases := 1
	Fscan(in, &cases)
	for curCase := 1; curCase <= cases; curCase++ {
		solve(curCase)
	}

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

}

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

package main

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

func main() {
    reader := bufio.NewReader(os.Stdin)
    line, _ := reader.ReadString('\n')
    T, err := strconv.Atoi(line[:len(line)-1])
   if err != nil {
       fmt.Println(err)
   }
    for t:= 0; t < T; t++ {
        line, _ := reader.ReadString('\n')
        n, _ := strconv.Atoi(line[:len(line)-1])
        s, _ := reader.ReadString('\n')
        z := 0
        for i:= 0; i < n; i++ {
            x := int(s[i]) - 97 + 1
            if x > z {
                z = x
            }
        }
        fmt.Println(z)
    }
}

package main

import (
	"fmt"
)

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

	for i := 0; i < t; i++ {
		execute()
	}
}

func execute() {
	var max rune
	var x int
	fmt.Scan(&x)
	var s string
	fmt.Scan(&s)
	for _, v := range s {
		if v > max {
			max = v
		}
	}
	fmt.Println(string(max))
	fmt.Println(max - 'a' + 1)
}

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"index/suffixarray"
	"log"
	"math"
	"net"
	"os"
	"path"
	"sort"
	"strconv"
	"strings"
	"time"
)

// For Codeforces
func main() {
	io := newStdIO()
	defer io.Flush()
	for T := io.ScanUInt16(); T > 0; T-- {
		solve(&io)
	}
}
func solve(io *IO) {
	n := io.ScanInt32()
	s := io.ScanString()

	m := make(map[byte]bool)
	c := 0
	for i := int32(0); i < n; i++ {
		_, is := m[s[i]]
		if !is {
			c++
			m[s[i]] = true
		}
	}
	io.PrintLn(c)
}

// #region INTERFACES

// From https://pkg.go.dev/golang.org/x/exp/constraints
type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}
type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}
type Integer interface {
	Signed | Unsigned
}
type Float interface {
	~float32 | ~float64
}
type Complex interface {
	~complex64 | ~complex128
}
type Ordered interface {
	Integer | Float | ~string
}

type Prioritizable[T any] interface {
	PriorTo(x T) bool // If you take this as a relation: if (a,b) in R => (b,a) not in R
}

// #endregion
// #region TYPES WITH METHODS
// #region SingleLinkedList
type singleLinkedListNode[T comparable] struct {
	Value T
	Next  *singleLinkedListNode[T]
}

type SingleLinkedList[T comparable, IndexType Unsigned] struct {
	first  *singleLinkedListNode[T]
	last   *singleLinkedListNode[T]
	length IndexType
}

func NewSingleLinkedList[T comparable, IndexType Unsigned]() *SingleLinkedList[T, IndexType] {
	return &SingleLinkedList[T, IndexType]{
		first:  nil,
		last:   nil,
		length: 0,
	}
}
func (l *SingleLinkedList[T, I]) Len() I { return l.length }

// length > 0
func (l *SingleLinkedList[T, I]) First() T { return l.first.Value }

// length > 0
func (l *SingleLinkedList[T, I]) Last() T { return l.last.Value }

func (l *SingleLinkedList[T, I]) InsertFirst(value T) {
	if l.length == 0 {
		nodeToInsert := &singleLinkedListNode[T]{
			Value: value,
			Next:  l.first,
		}
		l.first = nodeToInsert
		l.last = nodeToInsert
	} else {
		l.first = &singleLinkedListNode[T]{
			Value: value,
			Next:  l.first,
		}
	}
	l.length++
}

func (l *SingleLinkedList[T, I]) InsertLast(value T) {
	if l.length == 0 {
		nodeToInsert := &singleLinkedListNode[T]{
			Value: value,
			Next:  l.first,
		}
		l.first = nodeToInsert
		l.last = nodeToInsert
	} else {
		l.last.Next = &singleLinkedListNode[T]{
			Value: value,
			Next:  nil,
		}
		l.last = l.last.Next
	}
	l.length++
}

// index <= length
func (l *SingleLinkedList[T, I]) InsertAt(index I, value T) {
	if index == 0 {
		l.InsertFirst(value)
		return
	}
	if index == l.length {
		l.InsertLast(value)
		return
	}

	n := l.first
	for index > 1 {
		n = n.Next
		index--
	}
	n.Next = &singleLinkedListNode[T]{
		Value: value,
		Next:  n.Next,
	}
	l.length++
}

func (l *SingleLinkedList[T, I]) Contains(value T) bool {
	tmp := l.first
	for i := I(0); i < l.length; i++ {
		if tmp.Value == value {
			return true
		}
		tmp = tmp.Next
	}
	return false
}
func (l *SingleLinkedList[T, I]) Clear() {
	l.first = nil
	l.last = nil
	l.length = 0
}

// index < length
func (l *SingleLinkedList[T, I]) GetElementAt(index I) T {
	n := l.first
	for index > 0 {
		n = n.Next
		index--
	}
	return n.Value
}

// index < length
func (l *SingleLinkedList[T, I]) SetElementAt(index I, value T) {
	n := l.first
	for index > 0 {
		n = n.Next
		index--
	}
	n.Value = value
}

func (l *SingleLinkedList[T, I]) RemoveFirst() T {
	tmp := l.first
	l.first = l.first.Next
	l.length--
	if l.length == 0 {
		l.last = nil
	}
	return tmp.Value
}
func (l *SingleLinkedList[T, I]) RemoveLast() (value T) {
	value = l.last.Value
	if l.length == 1 {
		l.first = nil
		l.last = nil
		l.length = 0
		return
	}

	tmp := l.first
	for i := I(2); i < l.length; i++ {
		tmp = tmp.Next
	}
	l.last = tmp
	return
}

func (l *SingleLinkedList[T, I]) RemoveAt(index I) T {
	if index == 0 {
		return l.RemoveFirst()
	}
	if index == l.length-1 {
		return l.RemoveLast()
	}

	tmp := l.first
	for i := I(1); i < index; i++ {
		tmp = tmp.Next
	}
	res := tmp.Next.Value
	tmp.Next = tmp.Next.Next
	return res
}

func (l *SingleLinkedList[T, I]) ToSlice() (res []T) {
	res = make([]T, 0, l.length)
	tmp := l.first
	for i := I(0); i < l.length; i++ {
		res = append(res, tmp.Value)
		tmp = tmp.Next
	}
	return
}
func (it *SingleLinkedList[T, I]) String() string {
	return "Qua:: " + fmt.Sprint(it.ToSlice())
}

// #endregion
// #region Queue

type Queue[T comparable, I Unsigned] struct {
	l SingleLinkedList[T, I]
}

func NewQueue[T comparable, I Unsigned]() *Queue[T, I] {
	return &Queue[T, I]{
		l: SingleLinkedList[T, I]{
			first:  nil,
			last:   nil,
			length: 0,
		},
	}
}
func (q *Queue[T, I]) Len() I          { return q.l.length }
func (q *Queue[T, I]) Enqueue(value T) { q.l.InsertLast(value) }
func (q *Queue[T, I]) Dequeue(T) T     { return q.l.RemoveFirst() }
func (q *Queue[T, I]) Preview() T      { return q.l.First() }
func (q *Queue[T, I]) String() string  { return q.l.String() }

// #endregion
// #region Stack

type Stack[T comparable, I Unsigned] struct {
	l SingleLinkedList[T, I]
}

func NewStack[T comparable, I Unsigned]() *Stack[T, I] {
	return &Stack[T, I]{
		l: SingleLinkedList[T, I]{
			first:  nil,
			last:   nil,
			length: 0,
		},
	}
}
func (s *Stack[T, I]) Len() I         { return s.l.length }
func (s *Stack[T, I]) Push(value T)   { s.l.InsertFirst(value) }
func (s *Stack[T, I]) Pop(T) T        { return s.l.RemoveFirst() }
func (s *Stack[T, I]) Preview() T     { return s.l.First() }
func (s *Stack[T, I]) String() string { return s.l.String() }

// #endregion
// #region Heap
type BinaryHeap[T Prioritizable[T], I Signed] struct {
	s []T
}

func NewBinaryHeap[T Prioritizable[T], I Signed](s []T) (h *BinaryHeap[T, I]) {
	h = &BinaryHeap[T, I]{
		s: s,
	}

	for i := (h.Len() - 2) / 2; i >= 0; i-- {
		h.heapifyDown(i)
	}
	return
}
func (h *BinaryHeap[T, I]) Len() I {
	return I(len(h.s))
}
func (h *BinaryHeap[T, I]) Push(value T) {
	h.s = append(h.s, value)
	h.heapifyUp(h.Len() - 1)
}
func (h *BinaryHeap[T, I]) Pop() (res T) {
	res = h.s[0]
	h.s[0] = h.s[h.Len()-1]
	h.s = h.s[:h.Len()-1]
	h.heapifyDown(0)
	return
}

func (h *BinaryHeap[T, I]) heapifyDown(index I) bool {
	origin := index
	for {
		j := index*2 + 2
		if j < h.Len() {
			if h.s[j-1].PriorTo(h.s[j]) {
				j--
			}
		} else {
			if j <= h.Len() && !h.s[j].PriorTo(h.s[index]) {
				h.s[j], h.s[index] = h.s[index], h.s[j]
			}
			break
		}
		if h.s[j].PriorTo(h.s[index]) {
			h.s[j], h.s[index] = h.s[index], h.s[j]
			index = j
		} else {
			break
		}
	}
	return origin != index
}
func (h *BinaryHeap[T, I]) heapifyUp(index I) {
	for {
		parent := (index - 1) / 2
		if parent == index || h.s[parent].PriorTo(h.s[index]) {
			break
		}
		h.s[index], h.s[parent] = h.s[parent], h.s[index]
		index = parent
	}
}

// #endregion

// #endregion

// #region FUNCTIONS
func Max[T Ordered](a, b T) T {
	if a >= b {
		return a
	}
	return b
}
func Min[T Ordered](a, b T) T {
	if a <= b {
		return a
	}
	return b
}
func Abs[T Integer | Float](a T) T {
	if a < 0 {
		return -a
	}
	return a
}
func Swap[T any](a, b *T) {
	*a, *b = *b, *a
}

// At least one != 0
func GCD[T Unsigned](a, b T) T {
	if b < a {
		Swap(&a, &b)
	}
	for {
		if a == 0 {
			return b
		}
		r := (b % a)
		b = a
		a = r
	}
}

// At least one != 0
func LCM[T Unsigned](a, b T) T {
	return (a * b) / GCD(a, b)
}

func First[T any](a T, _ any) T { return a }

// #endregion

// #region IO STUFF
type IO struct {
	r *bufio.Reader
	w *bufio.Writer
}

func newStdIO() IO {
	return IO{
		r: bufio.NewReader(os.Stdin),
		w: bufio.NewWriter(os.Stdout),
	}
}

// Is assumed that input.txt file exists
func newFileIO() IO {
	return IO{
		r: bufio.NewReader(First(os.Open("input.txt"))),
		w: bufio.NewWriter(First(os.OpenFile("output.txt", os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.ModePerm))),
	}
}

func (io *IO) ScanInt8() (x int8)   { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanInt16() (x int16) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanInt32() (x int32) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanInt64() (x int64) { fmt.Fscan(io.r, &x); return }

func (io *IO) ScanUInt8() (x uint8)   { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanUInt16() (x uint16) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanUInt32() (x uint32) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanUInt64() (x uint64) { fmt.Fscan(io.r, &x); return }

func (io *IO) ScanFloat32() (x float32) { fmt.Fscan(io.r, &x); return }
func (io *IO) ScanFloat64() (x float64) { fmt.Fscan(io.r, &x); return }

func (io *IO) ScanString() (x string) { fmt.Fscan(io.r, &x); return }

func (io *IO) Print(x ...any)   { fmt.Fprint(io.w, x...) }
func (io *IO) PrintLn(x ...any) { fmt.Fprintln(io.w, x...) }

func (io *IO) Flush() { io.w.Flush() }

// #endregion

// #region KEEP IMPORTS
func D() {
	_ = bufio.Reader{}
	_ = bytes.Buffer{}
	_ = suffixarray.Index{}
	_ = log.Default()
	_ = math.Abs(0)
	_ = net.Dialer{}
	_ = path.ErrBadPattern
	_ = sort.Float64sAreSorted(nil)
	_ = strconv.ErrRange
	_ = strings.Builder{}
	_ = time.ANSIC
	_ = newStdIO()
	_ = newFileIO()
}

// #endregion


package main

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

type IO struct {
	in  io.Reader
	out io.Writer
}

func NewIO(in io.Reader, out io.Writer) *IO {
	return &IO{in: bufio.NewReader(in), out: out}
}

func (io *IO) ReadInt() int {
	var res int
	_, _ = fmt.Fscanf(io.in, "%d\n", &res)
	return res
}

func (io *IO) ReadPairInt() (int, int) {
	var a, b int
	_, _ = fmt.Fscanf(io.in, "%d %d\n", &a, &b)
	return a, b
}

func (io *IO) ReadString() string {
	var res string
	_, _ = fmt.Fscanf(io.in, "%s\n", &res)
	return res
}

func (io *IO) ReadIntSlice(n int) sort.IntSlice {
	var t int
	res := make(sort.IntSlice, 0, n)
	for i := 0; i < n; i++ {
		_, _ = fmt.Fscanf(io.in, "%d", &t)
		res = append(res, t)
	}
	_, _ = fmt.Fscanf(io.in, "\n")
	return res
}

func (io *IO) Println(v ...interface{}) {
	_, _ = fmt.Fprintln(io.out, v...)
}

func (io *IO) Print(v ...interface{}) {
	_, _ = fmt.Fprint(io.out, v...)
}

func (io *IO) Printf(format string, v ...interface{}) {
	_, _ = fmt.Fprintf(io.out, format, v...)
}

func (io *IO) PrintIntSlice(s sort.IntSlice) {
	for _, v := range s {
		io.Printf("%d ", v)
	}
}

func (io *IO) PrintlnIntSlice(s sort.IntSlice) {
	io.PrintIntSlice(s)
	io.Printf("\n")
}

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

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

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

func main() {
	io := NewIO(os.Stdin, os.Stdout)
	for t := io.ReadInt(); t > 0; t-- {
		a := io.ReadIntSlice(2)
		if a[1]%a[0] == 0 {
			io.Println(1, a[1]/a[0])
		} else {
			io.Println(0, 0)
		}
	}
}

package main

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

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

	var T, X, Y int
	for fmt.Fscan(in, &T); T > 0; T-- {
		fmt.Fscan(in, &X, &Y)
		if X > Y || Y%X != 0 {
			fmt.Fprintln(out, 0, 0)
		} else {
			fmt.Fprintln(out, 1, Y/X)
		}
	}
}

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

package main

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

func main() {
	var (
		t int
	)

	reader := bufio.NewReader(os.Stdin)
	fmt.Scanf("%d\n", &t)

	for t > 0 {
		t--

		text, _ := reader.ReadString('\n')
		ninps := strings.Fields(text)
		x, _ := strconv.Atoi(ninps[0])
		y, _ := strconv.Atoi(ninps[1])

		a := float64(0)
		i := 0
		done := false
		for i = 1; i < 100; i++ {
			a = float64((float64(y)/float64(x))/float64(i))
			if ( a - float64(int(float64((float64(y)/float64(x))/float64(i)))) ) == float64(0) {
				done = true
				break
			}
		}
		if done {
			fmt.Println(i, a)
		} else {
                        fmt.Println(0, 0)
		}
	}
}

package main

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

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

	store := map[int]map[int]int{}
	for a := 1; a <= 10; a++ {
		for b := 1; b <= 100; b++ {
			num := int(math.Pow(float64(b), float64(a)))
			if _, ok := store[num]; !ok {
				store[num] = map[int]int{}
			}
			store[num][a] = b
		}
	}
	var t int

	for fmt.Fscan(in, &t); t > 0; t-- {
		var x, y int
		fmt.Fscan(in, &x, &y)

		if y%x != 0 {
			fmt.Fprintln(out, "0 0")
			continue
		}

		y /= x

		//fmt.Println(y)
		//fmt.Println(store[y])

		a, b := 0, 0
		if val, ok := store[y]; ok {
			for k, v := range val {
				a, b = k, v
				break
			}
		}
		fmt.Fprintln(out, a, b)
	}
}

package main

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

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

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

	var T int
	var x int
	var y int

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

		a, b := 0, 0
		if x > y || y%x != 0 {
			Fprintln(out, a, b)
		} else {
			Fprintln(out, 1, y/x)
		}

	}
}

package main

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

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

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

		if y%x == 0 {
			fmt.Fprintf(out, "%d %d\n", 1, y/x)
		} else {
			fmt.Fprintln(out, "0 0")
		}
	}
}

package main

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

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

func slove() {
	defer w.Flush()
	var x, y int
	fmt.Fscan(r, &x, &y)
	if y % x != 0 {
		fmt.Fprintln(w, "0 0")
		return
	}
	a := y / x
	fmt.Fprintf(w, "1 %d\n", a)
}

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

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

package main

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

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

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

package main

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

func toInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func strsToInts(s []string) []int {
	resp := make([]int, len(s))
	for idx := 0; idx < len(s); idx++ {
		resp[idx] = toInt(s[idx])
	}
	return resp
}
func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	testCases, _ := strconv.Atoi(scanner.Text())

	for testCase := 0; testCase < testCases; testCase++ {
		scanner.Scan()
		ab := strsToInts(strings.Split(scanner.Text(), " "))
		a, b := ab[0], ab[1]
		if b%a != 0 {
			fmt.Println("0 0")
			continue
		}
		fmt.Printf("%d %d\n", 1, b/a)
	}
}

package main

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

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

func (in *CF1674A) 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 *CF1674A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

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

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

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

/**
Run solve the problem CF1674A
Date: 6/05/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1674/A
Problem: CF1674A
**/
func (in *CF1674A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		x, y := in.NextInt(), in.NextInt()

		p, q := 0, 0
		if y%x == 0 {
			p = 1
			q = y / x
		}
		fmt.Println(p, q)
	}
}

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

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

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)
var wrtr = bufio.NewWriterSize(os.Stdout, 10_000_000)
var rdr = bufio.NewScanner(os.Stdin)
func gs() string  { rdr.Scan(); return rdr.Text() }
func gi() int     { i,e := strconv.Atoi(gs()); if e != nil {panic(e)}; return i }
func main() {
	//f1, _ := os.Create("cpu.prof"); pprof.StartCPUProfile(f1); defer pprof.StopCPUProfile()
	defer wrtr.Flush()
	infn := ""; if infn == "" && len(os.Args) > 1 {	infn = os.Args[1] }
	if infn != "" {	f, e := os.Open(infn); if e != nil { panic(e) }; rdr = bufio.NewScanner(f) }
	rdr.Split(bufio.ScanWords); rdr.Buffer(make([]byte,1024),1_000_000_000)
	// PROGRAM STARTS HERE
	T := gi()
	for tt:=1;tt<=T;tt++ {
		x,y := gi(),gi()
		if y < x || y % x != 0 { fmt.Fprintln(wrtr,"0 0") } else { fmt.Fprintf(wrtr,"1 %v\n",y/x) }
	}
}

package main

import "fmt"

func main() {
	var t int64
	fmt.Scan(&t)
	for ii := t; ii > 0; ii = ii - 1 {
		var x int64
		var y int64
		fmt.Scan(&x)
		fmt.Scan(&y)

		if y%x != 0 {
			fmt.Print("0 0\n")
		} else {
			var n = y / x
			fmt.Printf("1 %v\n", n)
		}
	}
}

package main

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

const mod = 998244353

func solve(in *bufio.Reader, out *bufio.Writer) {
	defer out.Flush()
	var x, y int
	fmt.Fscan(in, &x, &y)
	if x == y {
		fmt.Fprintf(out, "%d %d\n", x, 1)
		return
	}
	c := y / x
	if y%x != 0 {
		fmt.Fprintf(out, "%d %d\n", 0, 0)
		return
	}
	fmt.Fprintf(out, "%d %d\n", 1, c)
}

func abs(a int64) int64 {
	if a > 0 {
		return a
	}
	return -a
}
func sum(a, b int64) int64 {
	return (b + a) * (b - a + 1) / 2
}

func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}
func min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func gcd(a, b int) int {
	if a%b == 0 {
		return b
	}
	return gcd(b, a%b)
}

func main() {
	stdin := os.Stdin
	stdout := os.Stdout
	in := bufio.NewReader(stdin)
	out := bufio.NewWriter(stdout)
	n := 1
	fmt.Fscan(in, &n)
	for i := 0; i < n; i++ {
		solve(in, out)
	}
}

package main

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

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

func solve() {
	var x, y int
	fmt.Fscan(in, &x, &y)
	if y < x || y%x != 0 {
		fmt.Fprintf(out, "0 0\n")
		return
	}
	if x == y {
		fmt.Fprintf(out, "1 1\n")
		return
	}
	fmt.Fprintf(out, "1 %d\n", y/x)
}

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

package main

import (
	"fmt"
)

func solve() {
	var a, b int64
	fmt.Scan(&a, &b)
	if b%a == 0 {
		fmt.Println(1, b/a)
	} else {
		fmt.Println(0, 0)
	}
}
func main() {
	var t int
	fmt.Scan(&t)
	for t > 0 {
		solve()
		t--
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var T,X,Y int

	fmt.Fscan(in, &T)
	//list := make([]string,N)

	for i := 0;i < T;i++{
		fmt.Fscan(in, &X,&Y)
		if Y%X == 0 && X <= Y{
			fmt.Println(1,Y/X)
		}else{
			fmt.Println(0,0)
		}

	}
}

package main

import "fmt"

func main() {
	var t int
    fmt.Scanf("%d\n",&t)
    for i:=1;i<=t;i++{
        var x,y int;
        fmt.Scanf("%d %d\n",&x,&y)
        if y%x!=0{
            fmt.Println(0,0)
            continue
        }
        fmt.Printf("1 %d\n",y/x)
    }
}

package main

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

/*
2
21 42
21 43
---
1 2
0 0
*/

//goland:noinspection GoUnhandledErrorResult
func solve() {
	var x, y int
	scanf("%d %d\n", &x, &y)

	if y%x != 0 {
		fmt.Fprintln(writer, 0, 0)
		return
	}

	a := 1
	b := y / x

	fmt.Fprintln(writer, a, b)
}

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

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

	for ; t > 0; t-- {
		solve()
	}
}

const maxUint = ^uint(0)

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

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

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

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

//goland:noinspection GoUnusedFunction
func reversed(s string) string {
	input := []rune(s)
	li := len(input)
	ret := make([]rune, li)
	for i, r := range input {
		ret[li-i-1] = r
	}
	return string(ret)
}

//goland:noinspection GoUnusedFunction
func divCeil(num, div int64) int64 {
	quot := num / div
	if num%div > 0 {
		quot++
	} else if num%div < 0 {
		quot--
	}
	return quot
}

//goland:noinspection GoUnusedFunction
func min(nums ...int) int {
	return nums[minIdx(nums...)]
}

//goland:noinspection GoUnusedFunction
func minIdx(nums ...int) int {
	minNumIdx := 0
	for i, num := range nums {
		if num < nums[minNumIdx] {
			minNumIdx = i
		}
	}

	return minNumIdx
}

//goland:noinspection GoUnusedFunction
func max(nums ...int) int {
	return nums[maxIdx(nums...)]
}

//goland:noinspection GoUnusedFunction
func maxIdx(nums ...int) int {
	maxNumIdx := 0
	for i, num := range nums {
		if num > nums[maxNumIdx] {
			maxNumIdx = i
		}
	}

	return maxNumIdx
}

//goland:noinspection GoUnusedFunction
func sum(nums ...int) (sum int) {
	for _, num := range nums {
		sum += num
	}
	return
}

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

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

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

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

	return true
}

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

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

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

	num = abs(num)

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

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

//goland:noinspection GoUnusedFunction
func factorize(num int64) []int64 {
	factors := make([]int64, 0)

	for ftr := int64(2); ftr*ftr <= num; ftr++ {
		for num%ftr == 0 {
			num /= ftr
			factors = append(factors, ftr)
		}
	}

	if num > 1 {
		factors = append(factors, num)
	}

	return factors
}

package main

import "fmt"

func main() {
	var t, x, y int
	fmt.Scanf("%d\n", &t)
	for ; t > 0; t-- {
		fmt.Scanf("%d %d\n", &x, &y)
		if y%x == 0 {
			fmt.Printf("%v %v\n", 1, y/x)
		} else {
			fmt.Println("0 0")
		}
	}
}

package main

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

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

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

	t := 0
	x, y := 0, 0
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		fmt.Fscan(in, &x, &y)
		if y < x || y%x != 0 {
			fmt.Fprintln(out, 0, 0)
		} else {
			fmt.Fprintln(out, 1, y/x)
		}
	}
}

package main

import (
	"fmt"
)

func getA(z, base int) int {
	result := 0
	for z != 1 {
		if z%base != 0 {
			return 0
		}
		z /= base
		result++
	}
	return result
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var x, y int
		fmt.Scanf("%d %d\n", &x, &y)
		if x == y {
			fmt.Println("1 1")
			continue
		}
		if x == 0 {
			fmt.Println("0 0")
			continue
		}
		z := y / x
		if z == 0 || z*x != y {
			fmt.Println("0 0")
			continue
		}
		for j := 2; j <= z; j++ {
			if a := getA(z, j); a != 0 {
				fmt.Printf("%d %d\n", a, j)
				break
			}
		}
	}
}

package main

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

// source: https://codeforces.com/contest/1674/problem/A?locale=en

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

func solve() string {
    var x, y int
    fmt.Fscan(in, &x, &y)

    if x > y {
        return "0 0"
    }
    if x == y {
        return "1 1"
    }
    for b := 2; b <= y/x; b++ {
        for a := 1; int(math.Pow(float64(b), float64(a)))*x <= y; a++ {
            tmp := int(math.Pow(float64(b), float64(a))) * x
            if tmp == y {
                return fmt.Sprintf("%d %d", a, b)
            }
        }
    }
    return "0 0"
}

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

package main

import (
	"fmt"
	"math"
)

func solve(x, y int) string {
	if x > y {
		return "0 0"
	}
	if x == y {
		return "1 1"
	}
	for b := 2; b <= y/x; b++ {
		for a := 1; int(math.Pow(float64(b), float64(a)))*x <= y; a++ {
			tmp := int(math.Pow(float64(b), float64(a))) * x
			if tmp == y {
				return fmt.Sprintf("%d %d", a, b)
			}
		}
	}
	return "0 0"
}

func main() {
	var t int
	fmt.Scanln(&t)
	var tc = make([][2]int, t)
	for i := 0; i < t; i++ {
		fmt.Scanln(&tc[i][0], &tc[i][1])
	}

	for i := 0; i < t; i++ {
		fmt.Println(solve(tc[i][0], tc[i][1]))
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var x, y int
		fmt.Fscan(in, &x, &y)
		if y%x == 0 {
			fmt.Fprintf(out, "%d %d\n", 1, y/x)
		} else {
			fmt.Fprintf(out, "0 0\n")
		}
	}
}

package main

import "fmt"

func sol() {
	var a, b int
	fmt.Scanf("%d %d\n", &a, &b)
	if b%a == 0 {
		fmt.Println(1, b/a)
	} else {
		fmt.Println(0, 0)
	}
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for ; t > 0; t-- {
		sol()
	}
}

package main

import (
	"fmt"
)

func getA(z, base int) int {
	result := 0
	for z != 1 {
		if z%base != 0 {
			return 0
		}
		z /= base
		result++
	}
	return result
}

func main() {
	var t int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		var x, y int
		fmt.Scanf("%d %d\n", &x, &y)
		if x == y {
			fmt.Println("1 1")
			continue
		}
		if x == 0 {
			fmt.Println("0 0")
			continue
		}
		z := y / x
		if z == 0 || z*x != y {
			fmt.Println("0 0")
			continue
		}
		for j := 2; j < z; j++ {
			if a := getA(z, j); a != 0 {
				fmt.Printf("%d %d\n", a, j)
				break
			}
		}
	}
}

package main

import (
	"fmt"
)

func getA(z, base int) int {
	result := 0
	for z != 1 {
		if z%base != 0 {
			return 0
		}
		z /= base
		result++
	}
	return result
}

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for i := 0; i < t; i++ {
		var x, y int
		fmt.Scanf("%d %d", &x, &y)
		if x == y {
			fmt.Println("1 1")
			continue
		}
		if x == 0 {
			fmt.Println("0 0")
			continue
		}
		z := y / x
		if z == 0 || z*x != y {
			fmt.Println("0 0")
			continue
		}
		for j := 2; j < z; j++ {
			if a := getA(z, j); a != 0 {
				fmt.Printf("%d %d\n", a, j)
				break
			}
		}
	}
}

package main

import (
	"fmt"
)

func getA(z, base int) int {
	result := 0
	for z != 1 {
		if z%base != 0 {
			return 0
		}
		z /= base
		result++
	}
	return result
}

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for i := 0; i < t; i++ {
		var x, y int
		fmt.Scanf("%d %d", &x, &y)
		if x == y {
			fmt.Println("1 1")
			continue
		}
		if x == 0 {
			fmt.Println("0 0")
			continue
		}
		z := y / x
		if z == 0 || z*x != y {
			fmt.Println("0 0")
			continue
		}
		for j := 2; j < z; j++ {
			if a := getA(z, j); a != 0 {
				fmt.Printf("%d %d\n", a, j)
			}
		}
	}
}

package main

import (
	"fmt"
)

func getA(z, base int) int {
	result := 0
	for z != 1 {
		if z%base != 0 {
			return 0
		}
		z /= base
		result++
	}
	return result
}

func main() {
	var t int
	fmt.Scanf("%d", &t)
	for i := 0; i < t; i++ {
		var x, y int
		fmt.Scanf("%d %d", &x, &y)
		if x == 0 {
			fmt.Println("0 0")
			continue
		}
		z := y / x
		if z == 0 || z*x != y {
			fmt.Println("0 0")
			continue
		}
		if x == y {
			fmt.Println("1 1")
			continue
		}
		for j := 2; j < z; j++ {
			if a := getA(z, j); a != 0 {
				fmt.Printf("%d %d\n", a, j)
			}
		}
	}
}

package main

import (
	"fmt"
	"math"
)

func solve(x, y int) string {
	if x > y {
		return "0 0"
	}
	if x == y {
		return "1 1"
	}
	for b := 2; b <= y/x; b++ {
		for a := 1; int(math.Pow(float64(b), float64(a)))*x <= y; a++ {
			tmp := int(math.Pow(float64(b), float64(a))) * x
			if tmp == y {
				return fmt.Sprintf("%d %d", a, b)
			}
		}
	}
	return "0 0"
}

func main() {
	var t int
	fmt.Scanln(&t)
	var tc = make([][2]int, t)
	for i := 0; i < t; i++ {
		fmt.Scanln(&tc[i][0], &tc[i][1])
	}

	for i := 0; i < t; i++ {
		println(solve(tc[i][0], tc[i][1]))
	}
}

package main

import (
	"fmt"
	math "math"
)

func solve(x, y int) string {
	if x > y {
		return "0 0"
	}
	if x == y {
		return "1 1"
	}
	for b := 2; b <= y/x; b++ {
		for a := 1; int(math.Pow(float64(b), float64(a)))*x <= y; a++ {
			tmp := int(math.Pow(float64(b), float64(a))) * x
			if tmp == y {
				return fmt.Sprintf("%d %d", a, b)
			}
		}
	}
	return "0 0"
}

func main() {
	var t int
	fmt.Scanln(&t)
	var tc = make([][2]int, t)
	for i := 0; i < t; i++ {
		fmt.Scanln(&tc[i][0], &tc[i][1])
	}

	for i := 0; i < t; i++ {
		println(solve(tc[i][0], tc[i][1]))
	}
}

package main

import (
	"fmt"
	math "math"
)

func solve() string {
	var x, y int
	fmt.Scanln(&x, &y)
	if x > y {
		return "0 0"
	}
	if x == y {
		return "1 1"
	}
	for b := 2; b <= y/x; b++ {
		for a := 1; int(math.Pow(float64(b), float64(a)))*x <= y; a++ {
			tmp := int(math.Pow(float64(b), float64(a))) * x
			if tmp == y {
				return fmt.Sprintf("%d %d", a, b)
			}
		}
	}
	return "0 0"
}

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

	for i := 0; i < t; i++ {
		println(solve())
	}
}

package main

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

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

	var T, X, Y int
	for fmt.Fscan(in, &T); T > 0; T-- {
		fmt.Fscan(in, &X, &Y)
		if X < Y || Y%X != 0 {
			fmt.Fprintln(out, 0, 0)
		} else {
			fmt.Fprintln(out, 1, Y/X)
		}
	}
}

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

package main

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

func main() {
	var (
		t int
	)

	reader := bufio.NewReader(os.Stdin)
	fmt.Scanf("%d\n", &t)

	for t > 0 {
		t--

		text, _ := reader.ReadString('\n')
		ninps := strings.Fields(text)
		x, _ := strconv.Atoi(ninps[0])
		y, _ := strconv.Atoi(ninps[1])

		a := float64(0)
		i := 0
		done := false
		for i = 1; i < 100; i++ {
			a = float64((float64(y)/float64(x))/float64(i))
			if ( a - float64(int(float64((float64(y)/float64(x))/float64(i)))) ) == float64(0) {
				done = true
				break
			}
		}
		if done {
			fmt.Println(a, i)
		} else {
                        fmt.Println(0, 0)
		}
	}
}

package main

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

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

	store := map[int]map[int]int{}
	for a := 1; a <= 10; a++ {
		for b := 0; b <= 10; b++ {
			num := int(math.Pow(float64(b), float64(a)))
			if _, ok := store[num]; !ok {
				store[num] = map[int]int{}
			}
			store[num][a] = b
		}
	}
	var t int

	for fmt.Fscan(in, &t); t > 0; t-- {
		var x, y int
		fmt.Fscan(in, &x, &y)

		if y%x != 0 {
			fmt.Fprintln(out, "0 0")
			continue
		}

		y /= x

		//fmt.Println(y)
		//fmt.Println(store[y])

		a, b := 0, 0
		if val, ok := store[y]; ok {
			for k, v := range val {
				a, b = k, v
				break
			}
		}
		fmt.Fprintln(out, a, b)
	}
}

package main

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

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

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

	var T int
	var x int
	var y int

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

		a, b := 0, 0
		if x < y || y%x != 0 {
			Fprintln(out, a, b)
		} else {
			Fprintln(out, 1, y/x)
		}

	}
}

package main

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

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

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

		if y%x == 0 {
			fmt.Fprintf(out, "%d %d\n", y/x, 1)
		} else {
			fmt.Fprintln(out, "0 0")
		}
	}
}

package main

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

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

func slove() {
	defer w.Flush()
	var x, y int
	fmt.Fscan(r, &x, &y)
	if y % x != 0 {
		fmt.Fprintln(w, "0 0")
		return
	}
	a := y / x
	fmt.Fprintf(w, "1 %d", a)
}

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


package main

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

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

	rows := make(map[string]int)

	reader := bufio.NewReader(os.Stdin)
	re := regexp.MustCompile(`\r?\n`)

	for i := 0; i < n; i++ {
		if s, err := reader.ReadString('\n'); err != nil {
			if err == io.EOF {
				break
			} else {
				return
			}
		} else {
			s = re.ReplaceAllString(s, "")
			rows[s] += 1
		}
	}

	max := 0
	for _, c := range rows {
		if c > max {
			max = c
		}
	}

	fmt.Println(max)
}

package main

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

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

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

	n := nextInt()
	m := map[string]int{}

	for i := 0; i < n; i++ {
		m[next()]++
	}

	max := 0

	for _, v := range m {
		if v > max {
			max = v
		}
	}

	println(max)
}

func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}

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

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

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

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

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

package main

import "fmt"

var output chan int

func cnt(rows []string, idx int) {
    c := 0
    for i := 0; i < len(rows); i++ {
        if rows[i] == rows[idx] {
            c++
        }
    }
    output <- c
}

func main() {
    var n int
    fmt.Scan(&n)
    rows := make([]string, n)
    for i := 0; i < n; i++ {
        fmt.Scan(&rows[i])
    }
    output = make(chan int, n)
    for i := 0; i < n; i++ {
        go cnt(rows, i)
    }
    ans := 0
    for i := 0; i < n; i++ {
        tmp := <-output
        if tmp > ans {
            ans = tmp
        }
    }
    fmt.Println(ans)
}


package main

import (
	"fmt"
)

var arr[ 1010 ] int

func my_gcd( x , y int ) ( res int ) {
	if y == 0 {
		res = x ;
	} else {
		res = my_gcd( y , x % y ) ;
	}
	return ;
}

func ok( x , y int ) ( is_ok bool ) {
	is_ok = true ;
	if my_gcd( x , y ) == 1 {
		return ;
	} else {
		is_ok = false ;
		return;
	}
}

func get_res( x , y int ) ( ret int ) {
	for i := 1 ; i <= 1000000000 ; i ++ {
		if my_gcd( x , i ) == 1 && my_gcd( i , y ) == 1 {
			ret = i;
			return ;
		}
	}
	return ;
}

func main() {

	var n int ;

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

	for i := 0 ; i < n ; i ++ {
		fmt.Scanf("%d",&arr[i]);
	}

	var fin[] int ;
	//fin := []int;
	fin = append( fin , arr[ 0 ] ) ;
	// this is fine!
	for i := 0 ; i < (n - 1) ; i ++ {
		if ok( arr[ i ] , arr[ i + 1 ] ) == true {
			//fin = append( fin , arr[ i ] ) ;
			fin = append( fin , arr[ i + 1 ] ) ;
			continue ;
		} else {
			res := get_res( arr[ i ] , arr[ i + 1 ] ) ;
			fin = append( fin , res ) ;
			fin = append( fin , arr[ i + 1 ] ) ;
		}
	}

	k := len( fin ) - n ;

	fmt.Println(k);

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

package main

import "fmt"

const MAXN = 1006

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

func main() {
	var N,i,prev,now,cnt int
	var arr[MAXN] int
	fmt.Scanf("%d\n", &N)
	prev = 1
	cnt = 0
	for i=1; i<=N; i++ {
		fmt.Scanf("%d", &now);
		if gcd(prev,now) != 1 {cnt++}
		prev = now
		arr[i] = now
	}
	fmt.Printf("%d\n", cnt)
	prev = 1
	for i=1; i<=N; i++ {
		now = arr[i]
		if gcd(prev,now) != 1 {fmt.Printf("1 ")}
		fmt.Printf("%d ", now)
		prev = now
	}
}

package main

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

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

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

	n := nextInt()
	a := make([]int, n)
	newA := make([]int, 1)
	ret := 0

	for i := range a {
		a[i] = nextInt()
	}

	newA[0] = a[0]

	for i := 1; i < len(a); i++ {
		if gcd(a[i-1], a[i]) != 1 {
			newA = append(newA, 1)
			ret++
		}
		newA = append(newA, a[i])
	}

	println(ret)

	for i := range newA {
		print(newA[i], " ")
	}
}

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

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

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

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

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

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

package main

import (
	"fmt"
	"strings"
)

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

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

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

func findCoPrime(a, b int) int {
	var result = 2

	for gcd(max(a, result), min(a, result)) != 1 || gcd(max(b, result), min(b, result)) != 1 {
		result++
	}
	return result
}

func main() {
	var n int
	fmt.Scan(&n)
	last := 1
	result := make([]string, 0, n*2)

	for i := 0; i < n; i++ {
		var curr int
		fmt.Scan(&curr)
		divisor := gcd(max(curr, last), min(curr, last))

		if divisor != 1 {
			result = append(result, fmt.Sprintf("%d", findCoPrime(curr, last)))
		}
		result = append(result, fmt.Sprintf("%d", curr))
		last = curr
	}
	fmt.Println(len(result) - n)
	fmt.Println(strings.Join(result, " "))
}

package main

import (
	"fmt"
)

var arr[ 1010 ] int

func my_gcd( x , y int ) ( res int ) {
	if y == 0 {
		res = x ;
	} else {
		res = my_gcd( y , x % y ) ;
	}
	return ;
}

func ok( x , y int ) ( is_ok bool ) {
	is_ok = true ;
	if my_gcd( x , y ) == 1 {
		return ;
	} else {
		is_ok = false ;
		return;
	}
}

func get_res( x , y int ) ( ret int ) {
	for i := 1 ; i <= 1000000000 ; i ++ {
		if my_gcd( x , i ) == 1 && my_gcd( i , y ) == 1 {
			ret = i;
			return ;
		}
	}
	return ;
}

func main() {

	var n int ;

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

	for i := 0 ; i < n ; i ++ {
		fmt.Scanf("%d",&arr[i]);
	}

	var fin[] int ;
	//fin := []int;
	fin = append( fin , arr[ 0 ] ) ;
	// this is fine!
	for i := 0 ; i < (n - 1) ; i ++ {
		if ok( arr[ i ] , arr[ i + 1 ] ) == true {
			//fin = append( fin , arr[ i ] ) ;
			fin = append( fin , arr[ i + 1 ] ) ;
			continue ;
		} else {
			res := get_res( arr[ i ] , arr[ i + 1 ] ) ;
			fin = append( fin , res ) ;
			fin = append( fin , arr[ i + 1 ] ) ;
		}
	}

	k := len( fin ) - n ;

	fmt.Println(k);

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

package main

import (
	"fmt"
)

var arr[ 1010 ] int

func my_gcd( x , y int ) ( res int ) {
	if y == 0 {
		res = x ;
	} else {
		res = my_gcd( y , x % y ) ;
	}
	return ;
}

func ok( x , y int ) ( is_ok bool ) {
	is_ok = true ;
	if my_gcd( x , y ) == 1 {
		return ;
	} else {
		is_ok = false ;
		return;
	}
}

func get_res( x , y int ) ( ret int ) {
	for i := 1 ; i <= 1000000000 ; i ++ {
		if my_gcd( x , i ) == 1 && my_gcd( i , y ) == 1 {
			ret = i;
			return ;
		}
	}
	return ;
}

func main() {

	var n int ;

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

	for i := 0 ; i < n ; i ++ {
		fmt.Scanf("%d\n",&arr[i]);
	}

	var fin[] int ;
	//fin := []int;
	fin = append( fin , arr[ 0 ] ) ;
	// this is fine!
	for i := 0 ; i < (n - 1) ; i ++ {
		if ok( arr[ i ] , arr[ i + 1 ] ) == true {
			//fin = append( fin , arr[ i ] ) ;
			fin = append( fin , arr[ i + 1 ] ) ;
			continue ;
		} else {
			res := get_res( arr[ i ] , arr[ i + 1 ] ) ;
			fin = append( fin , res ) ;
			fin = append( fin , arr[ i + 1 ] ) ;
		}
	}

	k := len( fin ) - n ;

	fmt.Println(k);

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

package main

import (
	"fmt"
)

var arr[ 1010 ] int

func my_gcd( x , y int ) ( res int ) {
	if y == 0 {
		res = x ;
	} else {
		res = my_gcd( y , x % y ) ;
	}
	return ;
}

func ok( x , y int ) ( is_ok bool ) {
	is_ok = true ;
	if my_gcd( x , y ) == 1 {
		return ;
	} else {
		is_ok = false ;
		return;
	}
}

func get_res( x , y int ) ( ret int ) {
	for i := 1 ; i <= 1000000000 ; i ++ {
		if my_gcd( x , i ) == 1 && my_gcd( i , y ) == 1 {
			ret = i;
			return ;
		}
	}
	return ;
}

func main() {

	var n int ;

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

	for i := 0 ; i < n ; i ++ {
		fmt.Scanf("%d",&arr[i]);
	}

	var fin[] int ;
	//fin := []int;
	fin = append( fin , arr[ 0 ] ) ;

	for i := 0 ; i < (n - 1) ; i ++ {
		if ok( arr[ i ] , arr[ i + 1 ] ) == true {
			//fin = append( fin , arr[ i ] ) ;
			fin = append( fin , arr[ i + 1 ] ) ;
			continue ;
		} else {
			res := get_res( arr[ i ] , arr[ i + 1 ] ) ;
			fin = append( fin , res ) ;
			fin = append( fin , arr[ i + 1 ] ) ;
		}
	}

	k := len( fin ) - n ;

	fmt.Println(k);

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

package main

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

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

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

	n := nextInt()
	a := make([]int, n)

	for i := range a {
		a[i] = nextInt()
	}

	print(a[0], " ")

	for i := 1; i < len(a); i++ {
		if gcd(a[i-1], a[i]) != 1 {
			print(1, " ")
		}
		print(a[i], " ")
	}
}

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

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

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

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

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

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

package main

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

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

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

	n := nextInt()
	a := make([]int, n)
	ret := 0

	for i := range a {
		a[i] = nextInt()
	}

	print(a[0], " ")

	for i := 1; i < len(a); i++ {
		if gcd(a[i-1], a[i]) != 1 {
			print(1, " ")
			ret++
		}
		print(a[i], " ")
	}

	fmt.Println(ret)
}

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

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

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

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

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

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


package main

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

// github.com/EndlessCheng/codeforces-go
func CF895C(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mod int64 = 1e9 + 7
	cnt := [71]int64{}
	var n, v int
	Fscan(in, &n)
	for i := 0; i < n; i++ {
		Fscan(in, &v)
		cnt[v]++
	}
	pow2 := make([]int64, n)
	pow2[0] = 1
	for i := 1; i < n; i++ {
		pow2[i] = pow2[i-1] << 1 % mod
	}
	ps := []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67}

	dp := [2][1 << 19]int64{}
	dp[0][0] = 1
	cur := 0
	for i, c := range cnt {
		if c == 0 {
			continue
		}
		cur ^= 1
		dp[cur] = [1 << 19]int64{}
		for s := 0; s < 1<<19; s++ {
			ss, x := s, i
			for j, p := range ps {
				for ; x%p == 0; x /= p {
					ss ^= 1 << j
				}
			}
			v := dp[cur^1][s] * pow2[cnt[i]-1]
			dp[cur][ss] = (dp[cur][ss] + v) % mod
			dp[cur][s] = (dp[cur][s] + v) % mod
		}
	}
	Fprint(out, (dp[cur][0]-1+mod)%mod)
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF895C(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mod int64 = 1e9 + 7
	cnt := [71]int64{}
	var n, v int
	Fscan(in, &n)
	for i := 0; i < n; i++ {
		Fscan(in, &v)
		cnt[v]++
	}
	pow2 := make([]int64, n)
	pow2[0] = 1
	for i := 1; i < n; i++ {
		pow2[i] = pow2[i-1] << 1 % mod
	}
	ps := [...]int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67}

	dp := [2][1 << 19]int64{}
	dp[0][0] = 1
	cur := 0
	for i, c := range cnt {
		if c == 0 {
			continue
		}
		mask, x := 0, i
		for j, p := range ps {
			for ; x%p == 0; x /= p {
				mask ^= 1 << j
			}
		}
		cur ^= 1
		dp[cur] = [1 << 19]int64{}
		for s := 0; s < 1<<19; s++ {
			v := dp[cur^1][s] * pow2[cnt[i]-1]
			dp[cur][s^mask] = (dp[cur][s^mask] + v) % mod
			dp[cur][s] = (dp[cur][s] + v) % mod
		}
	}
	Fprint(out, (dp[cur][0]-1+mod)%mod)
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
func CF895C(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mod int64 = 1e9 + 7
	cnt := [71]int64{}
	var n, v int
	Fscan(in, &n)
	for i := 0; i < n; i++ {
		Fscan(in, &v)
		cnt[v]++
	}
	pow2 := make([]int64, n)
	pow2[0] = 1
	for i := 1; i < n; i++ {
		pow2[i] = pow2[i-1] << 1 % mod
	}
	ps := []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67}

	dp := [2][1 << 19]int64{}
	dp[0][0] = 1
	cur := 0
	for i, c := range cnt {
		if c == 0 {
			continue
		}
		mask, x := 0, i
		for j, p := range ps {
			for ; x%p == 0; x /= p {
				mask ^= 1 << j
			}
		}
		cur ^= 1
		dp[cur] = [1 << 19]int64{}
		for s := 0; s < 1<<19; s++ {
			ss := s ^ mask
			v := dp[cur^1][s] * pow2[cnt[i]-1]
			dp[cur][ss] = (dp[cur][ss] + v) % mod
			dp[cur][s] = (dp[cur][s] + v) % mod
		}
	}
	Fprint(out, (dp[cur][0]-1+mod)%mod)
}

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

package main

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

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

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

func toInt(buf []byte) (o int) {
    for _, v := range buf {
        o = o*10 + int(v-'0')
    }
    return
}

var MD int

var n int
var a,mask,cnt [100005]int
var to_35,from_35 []int
var is_prime [100]bool
var fact [100005]int64
var dp [2][1<<11 + 1]int

func deg(x int64,d int) int64 {
	var res int64
	res = 1
	for ;d>0; {
		if d & 1 == 1 {
			res *= x
			res %= int64(MD)
		}
		x = x * x % int64(MD)
		d >>= 1
	}
	return res
}

func C(x,y int) int {
	d := fact[x]*fact[y - x]%int64(MD)
	return int(fact[y] * deg(d,MD - 2) % int64(MD))
}

func main() {
	MD = 1000000007
	fmt.Scanf("%d",&n)
	fact[0] = 1
	for i:=1;i<=n;i++ {
		fact[i] = fact[i-1] * int64(i) % int64(MD)
	}
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i:=1;i<=n;i++ {
		scanner.Scan()
		a[i] = toInt(scanner.Bytes())
	}
	is_prime[2] = true
	to_35 = append(to_35, 2)
	for i:=3;i<=70;i++ {
		prime := true
		for j:=2;j<i;j++ {
			if i % j == 0 {
				prime = false
				break
			}
		}
		is_prime[i] = prime
		if prime == true {
			if i <= 35 {
				to_35 = append(to_35, i)
			}else {
				from_35 = append(from_35, i)
			}
		}
	}
	for i:=1;i<=n;i++ {
		if a[i] > 35 && is_prime[a[i]] {
			cnt[a[i]]++
			continue
		}
		x := a[i]
		for j := range to_35 {
			c := 0
			for ;x % to_35[j] == 0; x /= to_35[j] {
				c++
			}
			if c % 2 == 1 {
				mask[i] += (1 << uint32(j))
			}
		}
	}
	now := 1
	prev := 0
	dp[prev][0] = 1
	for i:=1;i<=n;i++ {
		if a[i] > 35 && is_prime[a[i]] {
			continue
		}
		for j:=0;j<(1 << 11);j++ {
			dp[now][j] = dp[prev][j]
			dp[now][j] += dp[prev][j ^ mask[i]]
			if dp[now][j] >= MD {
				dp[now][j] -= MD
			}
			// if j == 0 {
			// 	fmt.Println(now,j,dp[now][j])
			// }
		}
		now ^= 1
		prev ^= 1
	}
	var res int64
	res = 1
	for i := range from_35 {
		y := cnt[from_35[i]]
		sum := 0
		for i:=0;i<=y;i+=2 {
			sum += C(i,y)
			if sum >= MD {
				sum -= MD
			}
		}
		res = (res * int64(sum)) % int64(MD)
	}
	res = int64(dp[prev][0]) * res % int64(MD) - 1
	if res < 0 {
		res += int64(MD)
	}
	fmt.Println(res)
}


package main

import "fmt"

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

	an := make([]int, 1001, 1001)
	for i := 0; i < n; i++ {
		fmt.Scan(&a)
		an[a]++
	}

	ans := true
	for i := 1; i <= 1000; i++ {
		if an[i] > (n+1)/2 {
			ans = false
			break
		}
	}

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

package main

import (
	"fmt"
	//"sort"
)

func main() {
	var n,x int
	flag:=true
	fmt.Scan(&n)
	a:=make([]int,1001)
	for i:=0;i<n;i++ {
		fmt.Scan(&x)
		a[x]++
		if a[x]>(n+1)/2 {
			fmt.Println("NO")
			flag=false
			break
		}
	}
	if flag==true {

	fmt.Println("YES")

	}
}

package main

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

var scanner *bufio.Scanner

func getI() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

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

  n := int(getI())
  counts := map[int]int{}
  for i := 0; i < n; i++ {
    x := int(getI())
    counts[x] += 1
  }
  for _, count := range counts {
    if count > (n+1)/2 {
      writer.WriteString("NO\n")
      return
    }
  }
  writer.WriteString("YES\n")
}

package main

import "fmt"

func main() {
    var n,a int
    var f [1001]int
    fmt.Scan(&n)
    ans := true
    for i := 0; i < n; i++ {
        fmt.Scan(&a)
        f[a]++
        if f[a] > ((n+1)/2) { ans = false }
    }
    if ans { fmt.Println("YES") } else { fmt.Println("NO") }
}

package main

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

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

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

func getLine() string {
	s, _ := reader.ReadString('\n')
	if strings.HasSuffix(s, "\r\n") {
		s = s[:len(s)-2]
	} else if strings.HasSuffix(s, "\n") {
		s = s[:len(s)-1]
	}
	return s
}
func getLine2Int() (n int) {
	scanf("%d\n", &n)
	return
}
func getLine2Int2() (a, b int) {
	scanf("%d %d\n", &a, &b)
	return
}
func getLine2Ints(n int) []int {
	ans := make([]int, n)
	for i := 0; i < n; i++ {
		scanf("%d ", &ans[i])
	}
	scanf("%d\n", &ans[n-1])
	return ans
}

var debug = false

func see(a interface{}) {
	if debug {
		printf("DEBUG:%v\n", a)
	}
}

func main() {
	defer writer.Flush()

	n := getLine2Int()
	counter := make(map[int]int)
	input := getLine2Ints(n)
	for i := 0; i < n; i++ {
		counter[input[i]]++
	}
	ok := true
	for _, c := range counter {
		if c > (n+1)/2 {
			ok = false
			break
		}
	}
	if ok {
		printf("YES\n")
	} else {
		printf("NO\n")
	}
}

package main

import (
	"fmt"
	//"sort"
)

func main() {
	var n,x int
	flag:=true
	fmt.Scan(&n)
	a:=make([]int,1001)
	for i:=0;i<n;i++ {
		fmt.Scan(&x)
		a[x]++
		if a[x]>(n+1)/2 {
			fmt.Println("NO")
			flag=false
		}
	}
	if flag==true {

	fmt.Println("YES")

	}
}

package main
import (
       	"fmt"
)
func main() {
       	var n,m,x,y int
       	var a [102]int
       	fmt.Scan(&n)
       	for i:=1;i<=n;i++ {
       		fmt.Scan(&a[i])
       	}
       	fmt.Scan(&m)
       	for i:=0;i<m;i++ {
       		fmt.Scan(&x,&y)
       		a[x-1]+=(y-1)
       		a[x+1]+=(a[x]-y)
       		a[x]=0
       	}
       	for i:=1;i<=n;i++ {
       		fmt.Println(a[i])
       	}

}

package main

import (
	"fmt"
	//"sort"
)

func main() {
	var n,x int
	fmt.Scan(&n)
	a:=make([]int,1001)
	for i:=0;i<n;i++ {
		fmt.Scan(&x)
		a[x]++
		if a[x]>(n+1)/2 {
			fmt.Println("NO")
		} else{
			fmt.Println("YES")
		}
	}
}

package main

import "fmt"

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

	an := make([]int, 1001, 1001)
	for i := 0; i < n; i++ {
		fmt.Scan(&a)
		an[a]++
	}

	ans := true
	for i := 1; i <= 1000; i++ {
		if an[i] >= (n+1)/2 {
			ans = false
		}
	}

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

package main

import "fmt"

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

	an := make([]int, n, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&an[i])
	}

	ans := true
	for i := 1; i < n-1; i++ {
		if an[i-1] == an[i] && an[i] == an[i+1] {
			ans = false
			break
		}
	}

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