Nikolay got a string $$$s$$$ of even length $$$n$$$, which consists only of lowercase Latin letters 'a' and 'b'. Its positions are numbered from $$$1$$$ to $$$n$$$.He wants to modify his string so that every its prefix of even length has an equal amount of letters 'a' and 'b'. To achieve that, Nikolay can perform the following operation arbitrary number of times (possibly, zero): choose some position in his string and replace the letter on this position with the other letter (i.e. replace 'a' with 'b' or replace 'b' with 'a'). Nikolay can use no letters except 'a' and 'b'.The prefix of string $$$s$$$ of length $$$l$$$ ($$$1 \le l \le n$$$) is a string $$$s[1..l]$$$.For example, for the string $$$s=$$$"abba" there are two prefixes of the even length. The first is $$$s[1\dots2]=$$$"ab" and the second $$$s[1\dots4]=$$$"abba". Both of them have the same number of 'a' and 'b'.Your task is to calculate the minimum number of operations Nikolay has to perform with the string $$$s$$$ to modify it so that every its prefix of even length has an equal amount of letters 'a' and 'b'.

The first line of the input contains one even integer $$$n$$$ $$$(2 \le n \le 2\cdot10^{5})$$$ — the length of string $$$s$$$. The second line of the input contains the string $$$s$$$ of length $$$n$$$, which consists only of lowercase Latin letters 'a' and 'b'.

In the first line print the minimum number of operations Nikolay has to perform with the string $$$s$$$ to modify it so that every its prefix of even length has an equal amount of letters 'a' and 'b'. In the second line print the string Nikolay obtains after applying all the operations. If there are multiple answers, you can print any of them.

NoteIn the first example Nikolay has to perform two operations. For example, he can replace the first 'b' with 'a' and the last 'b' with 'a'. In the second example Nikolay doesn't need to do anything because each prefix of an even length of the initial string already contains an equal amount of letters 'a' and 'b'.

package main

import (
    "fmt"
    "bufio"
    "os"
)
var input *bufio.Reader

func solve() {
    var (
        N int
        str string
        k int
    )
    fmt.Fscanf(input, "%d\n", &N)
    str, _ = input.ReadString('\n')
    res := make([]byte, N)
    for i:=0 ; i<N ; i++ {
        if i%2==1 {
            if str[i] == 'a' && str[i-1] == 'a' {
                k += 1
                res[i-1] = 'a'
                res[i] = 'b'
            } else if str[i] == 'b' && str[i-1] == 'b' {
                k += 1
                res[i-1] = 'a'
                res[i] = 'b'
            } else {
                res[i-1] = str[i-1]
                res[i] = str[i]
            }
        }
    }
    fmt.Println(k)
    fmt.Printf("%s",res)
}

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

package main

import (
    "fmt"
    "bufio"
    "os"
)
var input *bufio.Reader

func solve() {
    var (
        N int
        str string
        k int
        res string
    )
    fmt.Fscanf(input, "%d\n", &N)
    str, _ = input.ReadString('\n')
    for i:=0 ; i<N ; i++ {
        if i%2==1 {
            if str[i] == 'a' && str[i-1] == 'a' {
                k += 1
                res = res + "ab"
            } else if str[i] == 'b' && str[i-1] == 'b' {
                k += 1
                res = res + "ab"
            } else {
                res = res + str[(i-1):(i+1)]
            }
        }
    }
    fmt.Println(k)
    fmt.Println(res)
}

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

package main

import (
	"fmt"
	"strings"
)

func calc (str string) string {
	ans := make([]string,0)
	for i:=0;i<len(str)-1;i+=2{
		if string(str[i]) == "a"{
			ans = append(ans,"a")
			ans = append(ans,"b")
		}else{
			ans = append(ans,"b")
			ans = append(ans,"a")
		}
	}
	var count int
	ansfinal := strings.Join(ans,"")
	for i:=0;i<len(str);i++{
		if str[i]!=ansfinal[i]{
			count++
		}
	}
	fmt.Println(count)
	return ansfinal
}

func main(){
	var t int
	fmt.Scanln(&t)
	var str string
	fmt.Scanln(&str)
	fmt.Print(calc(str))
}

package main

import "fmt"

func main() {
	var n int
	var s []byte
	fmt.Scan(&n)
	fmt.Scan(&s)

	ret := 0
	for i:= 0; i < n; i += 2 {
		if s[i] == s[i + 1] {
			ret += 1

			if s[i] == 'a' {
				s[i + 1] = 'b'
			} else {
				s[i + 1] = 'a'
			}
		}
	}
	fmt.Printf("%d\n%s\n", ret, s)
}

package main

import "fmt"

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

	bytes := []byte(s)
	ret := 0
	for i:= 0; i < n; i += 2 {
		if s[i] == s[i + 1] {
			ret += 1

			if s[i] == 'a' {
				bytes[i + 1] = 'b'
			} else {
				bytes[i + 1] = 'a'
			}
		}
	}
	fmt.Printf("%d\n%s\n", ret, bytes)
}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	var s0 string
	fmt.Scanf("%s\n", &s0)
	s := []byte(s0)
	c := 0
	for i := 1; i < n; i += 2 {
		if s[i] == s[i-1] {
			c++
			if s[i] == 'a' {
				s[i] = 'b'
			} else {
				s[i] = 'a'
			}
		}
	}
	fmt.Println(c)
	fmt.Println(string(s))

}

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	var s0 string
	fmt.Scanf("%s\n", &s0)
	s := []byte(s0)
	c := 0
	for i := 1; i < n; i += 2 {
		if s[i] == 'a' && s[i-1] == 'a' {
			c++

			s[i] = 'b'

		} else if s[i] == 'b' && s[i-1] == 'b' {
			c++
			s[i] = 'a'
		}
	}
	fmt.Println(c)
	fmt.Println(string(s))

}

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

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

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

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

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

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

func main() {
	n := ReadInt()
	s := ReadString()
	ans := make([]byte, n)
	convNum := 0
	for i := 0; i < n; i += 2 {
		if s[i] == s[i+1] {
			ans[i], ans[i+1] = 'a', 'b'
			convNum += 1
		} else {
			ans[i], ans[i+1] = s[i], s[i+1]
		}
	}
	fmt.Println(convNum)
	fmt.Println(string(ans))
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	return string(res)
}

package main

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

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

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

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

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

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

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

func readInt() int32 {
	i, err := strconv.ParseInt(ReadString(), 0, 32)
	if err != nil {
		panic(err.Error())
	}
	return int32(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
}

// ReadFloat returns an float.
func ReadFloat() float32 {
	return float32(readFloat())
}

func readFloat() float32 {
	f, err := strconv.ParseFloat(ReadString(), 32)
	if err != nil {
		panic(err.Error())
	}
	return float32(f)
}

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

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

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

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

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

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

// const MOD = 1000000000 + 7
// const ALPHABET_NUM = 26
// const INF_INT = math.MaxInt
// const INF_BIT60 = 1 << 60

var n int
var S []rune

func main() {
	n = ReadInt()
	S = ReadRuneSlice()

	anum, bnum := 0, 0
	opnum := 0
	for i := 0; i < len(S); i++ {
		if S[i] == 'a' {
			if anum+1-bnum >= 2 {
				S[i] = 'b'
				opnum++
				bnum++
			} else {
				anum++
			}
		} else {
			if bnum+1-anum >= 2 {
				S[i] = 'a'
				opnum++
				anum++
			} else {
				bnum++
			}
		}
	}

	fmt.Println(opnum)
	fmt.Println(string(S))
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

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

package main

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

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

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

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

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

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

// ReadInt returns an integer.
func ReadInt() int {
	return 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())
}

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
}

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

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

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

/********** 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 MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n int
var S []rune

func main() {
	n = ReadInt()
	S = ReadRuneSlice()

	anum, bnum := 0, 0
	opnum := 0
	for i := 0; i < len(S); i++ {
		if S[i] == 'a' {
			if anum+1-bnum >= 2 {
				S[i] = 'b'
				opnum++
				bnum++
			} else {
				anum++
			}
		} else {
			if bnum+1-anum >= 2 {
				S[i] = 'a'
				opnum++
				anum++
			} else {
				bnum++
			}
		}
	}

	fmt.Println(opnum)
	fmt.Println(string(S))
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

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

package main

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

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

// IO helper functions

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// IO functions

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

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

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

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

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

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

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

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

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

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

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

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

// Simple math functions

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

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

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

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

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

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

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

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

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

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

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

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

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

func main() {
	defer Flush()

	n := readi()
	s := readb()

	var ans int
	for i := 0; i+1 < n; i = i + 2 {
		if s[i] == 'a' && s[i+1] == 'b' {
			continue
		}
		if s[i] == 'b' && s[i+1] == 'a' {
			continue
		}
		ans++
		if s[i] == 'a' {
			s[i] = 'b'
		} else {
			s[i] = 'a'
		}
	}
	println(ans)
	println(string(s))
}

package main

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

var scan *bufio.Scanner
var writer io.Writer

func init() {
	scan = bufio.NewScanner(os.Stdin)
	writer = os.Stdout
	scan.Split(bufio.ScanWords)
}

func nextWord() string {
	scan.Scan()
	str := scan.Text()
	return str
}

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

func main() {
	var n int
	var s string
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s\n", &s)
	ret := 0
	for i := 0; i < n; i++ {
		if i % 2 == 1 {
			if s[i - 1] == s[i] {
				ret++
			}
		}
	}
	fmt.Fprintln(writer, ret)
	for i := 0; i < n; i++ {
		if i % 2 == 1 {
			if s[i - 1] == s[i] {
				fmt.Fprint(writer, "ab")
			} else {
				fmt.Fprintf(writer, "%c%c", s[i - 1], s[i])
			}
		}
	}
	fmt.Fprintln(writer)
}

package main

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

func main() {
  var n int
  var s []byte
  in := bufio.NewReader(os.Stdin)
  fmt.Fscanf(in, "%d\n%s", &n , &s)
  ans := 0
  for i := 1; i < n; i += 2 {
    if s[i] == s[i - 1] {
      ans++
      if s[i] == 'a' {
        s[i] = 'b'
      } else {
        s[i] = 'a'
      }
    }
  }
  fmt.Println(ans)
  fmt.Println(string(s[:]))
}

package main

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

func main() {
	var n, result int
  var str string
  var resultStr []byte

  in := bufio.NewReader(os.Stdin)
  fmt.Fscanf(in, "%d\n%s", &n , &str)

	for i := 0; i < n - 1; i+=2 {
		if str[i] == str[i+1] {
			result++
      resultStr = append(resultStr, 'a')
      resultStr = append(resultStr, 'b')
		} else {
			resultStr = append(resultStr, str[i])
			resultStr = append(resultStr, str[i+1])
		}
	}
  fmt.Println(result)
  fmt.Println(string(resultStr[:]))

}

package main

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

func main() {
	var n,ans int
  var s string
  var a []rune

  // in := bufio.NewReader(os.Stdin)
  // fmt.Fscanf(in, "%d\n%s", &n , &s)
  fmt.Scan(&n)
  fmt.Scan(&s)

	for i := 0; i < len(s); i+=2 {
    if s[i] == s[i + 1] {
      if (s[i] == 'a') {
        a = append(a , 'b')
      } else {
        a = append(a , 'a')
      }
      ans++
    } else {
      a = append(a , rune(s[i]))
    }
    a = append(a , rune(s[i+1]))
  }

  out := bufio.NewWriter(os.Stdout)
  fmt.Fprintf(out, "%d\n", ans)
  for i := 0; i < n; i++ {
    fmt.Fprintf(out , "%c" , a[i])
  }
  out.Flush()
}

package main

import (
  "fmt"
)

func main() {
  var n int
  var s []byte
  fmt.Scan(&n)
  fmt.Scan(&s)
  ans := 0
  for i := 1; i < n; i += 2 {
    if s[i] == s[i - 1] {
      ans++
      if s[i] == 'a' {
        s[i] = 'b'
      } else {
        s[i] = 'a'
      }
    }
  }
  fmt.Println(ans)
  fmt.Println(string(s[:]))
}

package main

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

func main() {
	var text string
	_, err := fmt.Scanln(&text)
	if err != nil {
		panic(err)
	}

	n, err := strconv.Atoi(text)

	var result bytes.Buffer
	amount := 0

	var letter1 = make([]byte, 1)
	var letter2 = make([]byte, 1)

	for i := 0; i < n; i += 2 {
		os.Stdin.Read(letter1)
		os.Stdin.Read(letter2)

		letter1Str := string(letter1)
		letter2Str := string(letter2)

		if letter1Str == letter2Str {
			amount += 1
			switch letter1Str {
			case "a":
				letter1Str = "b"
				break
			case "b":
				letter1Str = "a"
				break
			}
		}

		result.WriteString(letter1Str)
		result.WriteString(letter2Str)
	}

	fmt.Println(amount)
	fmt.Println(result.String())
}

package main

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

var scan *bufio.Scanner
var writer io.Writer

func init() {
	scan = bufio.NewScanner(os.Stdin)
	writer = os.Stdout
	scan.Split(bufio.ScanWords)
}

func nextWord() string {
	scan.Scan()
	str := scan.Text()
	return str
}

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

func main() {
	//n := nextInt()
	//strs := nextWord()
	var n int
	var strs string
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s\n", &strs)
	ret := 0
	for i := 0; i < n; i++ {
		if i % 2 == 1 {
			if strs[i - 1] == strs[i] {
				ret++
			}
		}
	}
	fmt.Fprintln(writer, ret)
	for i := 0; i < n; i++ {
		if i % 2 == 1 {
			if strs[i - 1] == strs[i] {
				fmt.Fprint(writer, "ab")
			} else {
				fmt.Fprintf(writer, "%c%c", strs[i - 1], strs[i])
			}
		}
	}
	fmt.Fprintln(writer)
}

package main

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

const INF  = 1000000001

type Pair struct {
	first, second int
}

func sort(arr []int) []int {
	if len(arr) < 2 {
		return arr
	}
	left := 0
	right := len(arr) - 1
	pivot := rand.Int() % len(arr)

	arr[pivot], arr[right] = arr[right], arr[pivot]

	for i := 0; i < len(arr); i++ {
		if arr[i] < arr[right] {
			arr[i], arr[left] = arr[left], arr[i]
			left++
		}
	}

	arr[left], arr[right] = arr[right], arr[left]

	sort(arr[:left])
	sort(arr[left+1:])
	return arr
}

func solution(reader io.Reader, writer io.Writer) {
	var s string
	var n int
	fmt.Fscanf(reader, "%d\n%s\n", &n, &s)
	var r int
	a := make([]bool, n)
	for i := 1; i < n; i+=2 {
		if (s[i] == 'a' && s[i - 1] == 'a') || (s[i] == 'b' && s[i - 1] == 'b') {
			r++
			a[i] = true
			a[i - 1] = false
		} else {
			if s[i] == 'a' {
				a[i] = true
			} else {
				a[i-1]=true
			}
		}
	}
	fmt.Println(r)
	for i := 0; i < n; i++ {
		if a[i] {
			fmt.Fprintf(writer, "%s", "a")
		} else {
			fmt.Fprintf(writer, "%s", "b")
		}
	}
}

func main() {

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

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

	solution(reader, writer)
}

package main

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

func main() {

	var n int
	input := bufio.NewReader(os.Stdin)
	_, _ = fmt.Fscanln(input, &n)
	var s string
	_, _ = fmt.Fscanln(input, &s)
	var res = 0
	var sr = []rune(s)
	for i := 0; i < n; i += 2 {
		if s[i] == s[i+1] {
			res += 1
			sr[i] = 'a'
			sr[i+1] = 'b'
		} else if s[i] == 'a'{
			sr[i] = 'a'
			sr[i+1] = 'b'
		} else {
			sr[i] = 'b'
			sr[i+1] = 'a'
		}
	}
	fmt.Println(res)
	fmt.Println(string(sr))
}

package main

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

func main() {

	var n int
	input := bufio.NewReader(os.Stdin)
	_, _ = fmt.Fscanln(input, &n)
	var s string
	_, _ = fmt.Fscanln(input, &s)
	var res = 0
	var ss strings.Builder

	for i := 0; i < n; i += 2 {
		if s[i] == s[i+1] {
			res += 1
			ss.WriteString("ab")
		} else if s[i] == 'a'{
			ss.WriteString("ab")
		} else {
			ss.WriteString("ba")
		}
	}
	fmt.Println(res)
	fmt.Println(ss.String())
}

package main

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

func main() {

	var n int
	input := bufio.NewReader(os.Stdin)
	_, _ = fmt.Fscanln(input, &n)
	var s string
	_, _ = fmt.Fscanln(input, &s)
	var st = ""
	var res = 0
	for i := 0; i < n; i += 2 {
		if s[i] == s[i+1] {
			res += 1
			st += "ab"
		} else if s[i] == 'a'{
			st += "ab"
		} else {
			st += "ba"
		}
		//	var a, b int
		//	_, _ = fmt.Fscanf(input, "%d%d", &a, &b)
		//	fmt.Println(a, b)
	}
	fmt.Println(res)
	fmt.Println(st)
}

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

package main

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

type Solution struct {
	Count int
	S     string
}

func Solve(n int, s string) Solution {
	answer := make([]string, n/2)
	count := 0
	for i := 0; i < n; i += 2 {
		if s[i:i+2] == "aa" || s[i:i+2] == "bb" {
			answer = append(answer, "ab")
			count += 1
		} else {
			answer = append(answer, s[i:i+2])
		}
	}
	return Solution{Count: count, S: strings.Join(answer, "")}
}

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

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

	solution := Solve(n, s)
	fmt.Fprintf(writer, "%d\n%s\n", solution.Count, solution.S)
}

package main

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

func main() {
	var n,ans int
  var s string
  var a []rune

  in := bufio.NewReader(os.Stdin)
  fmt.Fscanf(in, "%d\n%s", &n , &s)

	for i := 0; i < len(s); i+=2 {
    if s[i] == s[i + 1] {
      if (s[i] == 'a') {
        a = append(a , 'b')
      } else {
        a = append(a , 'a')
      }
      ans++
    } else {
      a = append(a , rune(s[i]))
    }
    a = append(a , rune(s[i+1]))
  }

  out := bufio.NewWriter(os.Stdout)
  fmt.Fprintf(out, "%d\n", ans)
  for i := 0; i < n; i++ {
    fmt.Fprintf(out , "%c" , a[i])
  }
  out.Flush()
}

package main

import (
    "fmt"
    "bufio"
    "os"
)
var input *bufio.Reader

func solve() {
    var (
        N int
        str string
        k int
        res string
    )
    fmt.Fscanf(input, "%d\n", &N)
    str, _ = input.ReadString('\n')
    for i:=0 ; i<N ; i++ {
        if i%2==1 {
            if str[i] == 'a' && str[i-1] == 'a' {
                k += 1
                res = res + "ab"
            } else if str[i] == 'b' && str[i-1] == 'b' {
                k += 1
                res = res + "ab"
            } else {
                res = res + str[(i-1):i]
            }
        }
    }
    fmt.Println(k)
    fmt.Println(res)
}

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

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	var s0 string
	fmt.Scanf("%s\n", &s0)
	s := []byte(s0)
	c := 0
	for i := 1; i < n; i++ {
		if s[i] == s[i-1] {
			c++
			if s[i] == 'a' {
				s[i] = 'b'
			} else {
				s[i] = 'a'
			}
		}
	}
	fmt.Println(c)
	fmt.Println(string(s))

}

package main

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

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

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

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

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

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

// ReadInt returns an integer.
func ReadInt() int {
	return 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())
}

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
}

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

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// DigitSum returns digit sum of a decimal number.
// DigitSum only accept a positive integer.
func DigitSum(n int) int {
	if n < 0 {
		return -1
	}

	res := 0

	for n > 0 {
		res += n % 10
		n /= 10
	}

	return res
}

// DigitNumOfDecimal returns digits number of n.
// n is non negative number.
func DigitNumOfDecimal(n int) int {
	res := 0

	for n > 0 {
		n /= 10
		res++
	}

	return res
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// Kiriage returns Ceil(a/b)
// a >= 0, b > 0
func Kiriage(a, b int) int {
	return (a + (b - 1)) / b
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

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

/********** 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 MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

func main() {
	fmt.Println("Hello World.")
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

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

package main

import (
	"fmt"
	"strconv"
)

func main() {
	var text string
	_, err := fmt.Scanln(&text)
	if err != nil {
		panic(err)
	}

	n, err := strconv.Atoi(text)

	_, err = fmt.Scanln(&text)
	if err != nil {
		panic(err)
	}

	result := ""
	amount := 0

	for i := 0; i < n; i += 2 {
		letter1 := text[i : i+1]
		letter2 := text[i+1 : i+2]

		if letter1 == letter2 {
			amount += 1
			switch letter1 {
			case "a":
				letter1 = "b"
				break
			case "b":
				letter1 = "a"
				break
			}
		}

		result = fmt.Sprintf("%s%s%s", result, letter1, letter2)
	}

	println(amount)
	println(result)
}

package main

import (
	"fmt"
	"strconv"
)

func main() {
	var text string
	_, err := fmt.Scanln(&text)
	if err != nil {
		panic(err)
	}

	n, err := strconv.Atoi(text)

	_, err = fmt.Scanln(&text)
	if err != nil {
		panic(err)
	}

	result := ""
	amount := 0

	for i := 0; i < n; i += 2 {
		letter1 := text[i : i+1]
		letter2 := text[i+1 : i+2]

		if letter1 == letter2 {
			amount += 1
			switch letter1 {
			case "a":
				letter1 = "b"
				break
			case "b":
				letter1 = "a"
				break
			}
		}

		result = fmt.Sprintf("%s%s%s", result, letter1, letter2)
	}

	println(amount)
	print(result)
}

package main

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

var scan *bufio.Scanner
var writer io.Writer

func init() {
	scan = bufio.NewScanner(os.Stdin)
	writer = os.Stdout
	scan.Split(bufio.ScanWords)
}

func nextWord() string {
	scan.Scan()
	str := scan.Text()
	return str
}

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

func nextInt64() int64 {
	i, e := strconv.ParseInt(nextWord(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	n := nextInt()
	strs := nextWord()
	var a, b int
	for i := 0; i < len(strs); i++ {
		if strs[i] == 'a' {
			a++
		} else {
			b++
		}
	}
	ret := n / 2 - a
	if ret < 0 {
		ret = -ret
	}
	fmt.Fprintln(writer, ret)
	for i := 0; i < len(strs); i++ {
		if i % 2 == 1 {
			if strs[i - 1] == strs[i] {
				fmt.Fprint(writer, "ab")
			} else {
				fmt.Fprintf(writer, "%c%c", strs[i - 1], strs[i])
			}
		}
	}
	fmt.Fprintln(writer)
}

package main

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

var scan *bufio.Scanner
var writer io.Writer

func init() {
	scan = bufio.NewScanner(os.Stdin)
	writer = os.Stdout
	scan.Split(bufio.ScanWords)
}

func nextWord() string {
	scan.Scan()
	str := scan.Text()
	return str
}

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

func main() {
	n := nextInt()
	strs := nextWord()
	ret := 0
	if n != len(strs) {
		n = len(strs)
	}
	for i := 0; i < n; i++ {
		if i % 2 == 1 {
			if strs[i - 1] == strs[i] {
				ret++
			}
		}
	}
	fmt.Fprintln(writer, ret)
	for i := 0; i < n; i++ {
		if i % 2 == 1 {
			if strs[i - 1] == strs[i] {
				fmt.Fprint(writer, "ab")
			} else {
				fmt.Fprintf(writer, "%c%c", strs[i - 1], strs[i])
			}
		}
	}
	fmt.Fprintln(writer)
}

package main

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

func main() {

	var n int
	input := bufio.NewReader(os.Stdin)
	_, _ = fmt.Fscanln(input, &n)
	var s string
	_, _ = fmt.Fscanln(input, &s)
	var st = ""
	var res = 0
	for i := 0; i < n; i += 2 {
		if s[i] == s[+1] {
			res += 1
			st += "ab"
		} else if s[i] == 'a'{
			st += "ab"
		} else {
			st += "ba"
		}
		//	var a, b int
		//	_, _ = fmt.Fscanf(input, "%d%d", &a, &b)
		//	fmt.Println(a, b)
	}
	fmt.Println(res)
	fmt.Println(st)
}

package main

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

func main() {

	var n int
	input := bufio.NewReader(os.Stdin)
	_, _ = fmt.Fscanln(input, &n)
	var s string
	_, _ = fmt.Fscanln(input, &s)
	var st = ""
	var res = 0
	for i := 0; i < n; i += 2 {
		if s[i] == s[i+1] {
			res += 1
			st += "ab"
		} else if s[i] == 'a'{
			st += "ab"
		} else {
			st += "ba"
		}
	}
	out := bufio.NewWriter(os.Stdout)
	_, _ = fmt.Fprintln(out, res)
	_, _ = fmt.Fprintln(out, st)
}

package main

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

func main() {
	var n,ans int
  var s string
  var a []rune

  in := bufio.NewReader(os.Stdin)
  fmt.Fscanf(in, "%d\n%s", &n , &s)

	for i := 0; i < len(s); i+=2 {
    if s[i] == s[i + 1] {
      if (s[i] == 'a') {
        a = append(a , 'b')
      } else {
        a = append(a , 'a')
      }
      ans++
    } else {
      a = append(a , rune(s[i]))
    }
    a = append(a , rune(s[i]))
  }

  out := bufio.NewWriter(os.Stdout)
  fmt.Fprintf(out, "%d\n", ans)
  for i := 0; i < n; i++ {
    fmt.Fprintf(out , "%c" , a[i])
  }
  out.Flush()
}

package main

import (
	"fmt"
)

func main() {
	var n int
  var s string
	fmt.Scanf("%d\n%s", &n , &s)
  var result string
	for i := 0; i < len(s); i+=2 {
    if s[i] == s[i + 1] {
      if (s[i] == 'a') {
        result += "b"
      } else {
        result += "a"
      }
    } else {
      result += string(s[i])
    }
    result += string(s[i+1])
  }
  fmt.Println(result)
}


Sho has an array $$$a$$$ consisting of $$$n$$$ integers. An operation consists of choosing two distinct indices $$$i$$$ and $$$j$$$ and removing $$$a_i$$$ and $$$a_j$$$ from the array.For example, for the array $$$[2, 3, 4, 2, 5]$$$, Sho can choose to remove indices $$$1$$$ and $$$3$$$. After this operation, the array becomes $$$[3, 2, 5]$$$. Note that after any operation, the length of the array is reduced by two.After he made some operations, Sho has an array that has only distinct elements. In addition, he made operations such that the resulting array is the longest possible. More formally, the array after Sho has made his operations respects these criteria:   No pairs such that ($$$i < j$$$) and $$$a_i = a_j$$$ exist.  The length of $$$a$$$ is maximized. Output the length of the final array.

The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 50$$$) — the length of the array. The second line of each test case contains $$$n$$$ integers $$$a_i$$$ ($$$1 \leq a_i \leq 10^4$$$) — the elements of the array.

For each test case, output a single integer — the length of the final array. Remember that in the final array, all elements are different, and its length is maximum.

NoteFor the first test case Sho can perform operations as follows:   Choose indices $$$1$$$ and $$$5$$$ to remove. The array becomes $$$[2, 2, 2, 3, 3, 3] \rightarrow [2, 2, 3, 3]$$$.  Choose indices $$$1$$$ and $$$4$$$ to remove. The array becomes $$$[2, 2, 3, 3] \rightarrow [2, 3]$$$.  The final array has a length of $$$2$$$, so the answer is $$$2$$$. It can be proven that Sho cannot obtain an array with a longer length.For the second test case Sho can perform operations as follows:   Choose indices $$$3$$$ and $$$4$$$ to remove. The array becomes $$$[9, 1, 9, 9, 1] \rightarrow [9, 1, 1]$$$.  Choose indices $$$1$$$ and $$$3$$$ to remove. The array becomes $$$[9, 1, 1] \rightarrow [1]$$$.  The final array has a length of $$$1$$$, so the answer is $$$1$$$. It can be proven that Sho cannot obtain an array with a longer length.

package main
import(
    "fmt"
    "sort"
)
func main() {
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Scan(&n)
		var list []int = make([]int,n)
		for j:=0;j<n;j++{
			fmt.Scan(&list[j])
		}
		sort.Ints(list)
		counter:=1
		for j:=1;j<len(list);j++{
			if list[j] != list[j-1] {
				counter++
			}
		}
		if (n%2 == 0 && counter % 2 == 0) || (n%2 != 0 && counter % 2 != 0) {
			fmt.Println(counter)
		} else {
			fmt.Println(counter-1)
		}
	}
}

package main

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

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

func main() {
	defer w.Flush()

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

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Fscan(r, &lenSlice)

		slice := make([]int, lenSlice)
		for i := 0; i < lenSlice; i++ {
			_, _ = fmt.Fscan(r, &slice[i])
		}

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		var result int

		if (lenSlice-cantUniq)%2 == 0 {
			result = cantUniq
		} else {
			result = cantUniq - 1
		}

		_, _ = fmt.Fprintln(w, result)
	}

}

package main

import (
	"fmt"
)

func main() {

	var n int
	_, _ = fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Scan(&lenSlice)

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

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		var result int

		if (lenSlice-cantUniq)%2 == 0 {
			result = cantUniq
		} else {
			result = cantUniq - 1
		}

		fmt.Println(result)
	}

}

package main

import (
	"fmt"
)

func main() {

	var n int
	_, _ = fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Scan(&lenSlice)

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

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		var result int
		if cantUniq == lenSlice {
			result = lenSlice
		} else if lenSlice%2 == 0 && cantUniq%2 == 0 {
			result = cantUniq
		} else if lenSlice%2 != 0 && cantUniq%2 != 0 {
			result = cantUniq
		} else {
			result = cantUniq - 1
		}

		fmt.Println(result)
	}

}

package main

import (
	"fmt"
)

func main() {

	var n int
	_, _ = fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Scan(&lenSlice)

		slice := make([]int, 0)
		for i := 0; i < lenSlice; i++ {
			var val int
			_, _ = fmt.Scan(&val)

			slice = append(slice, val)
		}

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		var result int
		if cantUniq == lenSlice {
			result = lenSlice
		} else if lenSlice%2 == 0 && cantUniq%2 == 0 {
			result = cantUniq
		} else if lenSlice%2 != 0 && cantUniq%2 != 0 {
			result = cantUniq
		} else {
			result = cantUniq - 1
		}

		fmt.Println(result)
	}

}

package main

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

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

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

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		fmt.Fscan(in, &n)
		m := make(map[int]int)
		for i := 0; i < n; i++ {
			var v int
			fmt.Fscan(in, &v)
			m[v]++
		}

		tot := len(m)
		if (n-len(m))%2 > 0 {
			tot--
		}
		fmt.Fprintln(out, tot)
	}
}

package main

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

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

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

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		fmt.Fscan(in, &n)
		a := make([]int, n)
		m := make(map[int]int)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &a[i])
			m[a[i]]++
		}
		if (n-len(m))%2 > 0 {
			fmt.Fprintln(out, len(m)-1)
		} else {
			fmt.Fprintln(out, len(m))
		}
	}
}

package main

import (
  "fmt"
  "sort"
)

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

	for k:=0;k<t;k++{
	    ans := 0
	    var num int
	    mal := []int{}
	    fmt.Scan(&num)
	    for j:=0;j<num;j++{
	        var hui int
	        fmt.Scan(&hui)
	        mal = append(mal,hui)
	    }
	    sort.Ints(mal)

	    for i:= 1; i<len(mal);i++ {
	        if mal[i-1]==mal[i]{
	            ans++
	        }
	    }

	    if ans%2==1{
	        ans++
	    }

	    fmt.Println(len(mal)-ans)

	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var n,t,a int
	ans := 0
	//kisu := 0
	//guusuu := 0
	//count:= 0
	fmt.Fscan(in, &n)

	// bitsがn個の要素の各パターンを表す
	for i := 0;i < n;i++ {
		fmt.Fscan(in, &t)
		m := make(map[int]int)
		//list := make([]int,t)
		for j := 0;j < t;j++ {
			fmt.Fscan(in, &a)
			if _,ok := m[a];ok{
				m[a]++
				ans++
			}else{
				m[a] = 1
				ans++
				//list[count] = a
				//count++
			}
		}
		//for j := 0;j < len(m);j++ {
		//	if m[list[j]]%2 == 1{
		//		kisu++
		//	}else{
		//		guusuu++
		//	}
		//}
		//fmt.Println(len(m))
		if (ans-len(m))%2 == 1{
			fmt.Println(len(m)-1)
		}else{
			fmt.Println(len(m))
		}

		ans = 0
		//kisu = 0
		//guusuu = 0
		//count = 0
	}
}

package main

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

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

func solve() {
	var n int
	scanf("%d\n", &n)
	arr := IntArray(n)

	mp := map[int]int{}
	s := 0
	for i := range arr {
		if _, found := mp[arr[i]]; found {
			s += 1
		} else {
			mp[arr[i]] = 1
		}
	}

	if s%2 == 0 {
		n -= s
	} else {
		n -= (s + 1)
	}

	printf("%v\n", n)
}

func main() {
	defer writer.Flush()

	var cases int

	scanf("%d\n", &cases)
	// cases = 1

	for c := 0; c < cases; c++ {
		solve()
	}
}

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

func IntArray(size int) []int {
	arr := make([]int, size)
	for i := 0; i < size; i++ {
		scanf("%d", &arr[i])
	}
	scanf("\n")
	return arr
}

func Max(args ...int) int {
	m := args[0]
	for i := range args {
		if args[i] > m {
			m = args[i]
		}
	}
	return m
}

func Min(args ...int) int {
	m := args[0]
	for i := range args {
		if args[i] < m {
			m = args[i]
		}
	}
	return m
}

package main

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

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

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

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

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

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

/**
Run solve the problem CF1692B
Date: 18/06/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1692/B
Problem: CF1692B
**/
func (in *CF1692B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		mapa := make(map[int]bool)
		count := 0
		for i := 0; i < n; i++ {
			val := in.NextInt()
			if _, exist := mapa[val]; !exist {
				mapa[val] = true
			} else {
				count++
			}
		}
		if count%2 != 0 {
			fmt.Println(n - count - 1)
		} else {
			fmt.Println(n - count)
		}

	}
}

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

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

package main

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

var sc = bufio.NewScanner(os.Stdin)
var wr = bufio.NewWriter(os.Stdout)

func out(x ...interface{}) {
	fmt.Fprint(wr, x...)
}

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

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

func nextInt64() int64 {
	i, e := strconv.ParseInt(next(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	defer wr.Flush()
	sc.Buffer(make([]byte, 0), 1000000009)
	sc.Split(bufio.ScanWords)

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

func solve() {
	n := nextInt()
	mp := make(map[int]bool)
	for i := 0; i < n; i++ {
		a := nextInt()
		mp[a] = true
	}
	ans := len(mp) - ((len(mp) - n) & 1)

	out(ans, "\n")
}

package main

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

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

func solve(n int, a []int) int {
	var b = make(map[int]int)
	for _, x := range a {
		b[x]++
	}
	var dup int
	for _, y := range b {
		dup += y - 1
	}
	return n - dup - dup%2
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n)
		a = make([]int, n)
		for i := range a {
			fmt.Fscan(reader, &a[i])
		}
		fmt.Println(solve(n, a))
	}
}

package main

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

var in = bufio.NewReader(os.Stdin)

func readInt() int {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return n
}

func readLine() []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	values := strings.Split(line, " ")
	return values
}

func readArrInt() []int {
	line := readLine()
	res := make([]int, 0, 0)
	for i := range line {
		var x, _ = strconv.Atoi(line[i])
		res = append(res, x)
	}
	return res
}

func main() {
	test := readInt()
	for ; 0 < test; test-- {
		var n = readInt()
		var a = readArrInt()
		var hs map[int]int
		hs = make(map[int]int)
		for i := range a {
			hs[a[i]]++
		}
		res := len(hs)
		if (n - res) % 2 == 1 {
			res--
		}
		fmt.Printf("%d\n", res)
	}
}

package main

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

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

func main() {
	defer writer.Flush()

	var Q int
	fmt.Fscan(reader, &Q)

	const MAX_VALUE int = 10000

	for ; Q > 0; Q-- {
		var n int
		fmt.Fscan(reader, &n)
		cnt := make([]int, MAX_VALUE+2)
		for i := 1; i <= n; i++ {
			var val int
			fmt.Fscan(reader, &val)
			cnt[val] += 1
		}

		var even, odd = 0, 0

		for i := 1; i <= MAX_VALUE; i++ {
			if cnt[i] > 0 {
				if cnt[i]%2 == 0 {
					even += 1
				} else {
					odd += 1
				}
			}
		}
		if even%2 == 1 {
			even -= 1
		}
		fmt.Fprintf(writer, "%d\n", even+odd)
	}
}

package main

import "fmt"

func main() {
	var t, n, temp, count int
	var arr [10007]int
	// fmt.Println(arr)
	fmt.Scan(&t)
	for i := 1; i <= t; i++ {
		count = 0
		fmt.Scan(&n)
		for j := 1; j <= n; j++ {
			fmt.Scan(&temp)
			if arr[temp] != i {
				arr[temp] = i
				count++
			}
			// fmt.Println(arr)
		}
		if (n-count)%2 != 0 {
			count--
		}
		fmt.Println(count)
	}
}

package main

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

const (
	MaxInt32 = 1 << 31 - 1
)

func main(){
	cin := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(cin, &t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(cin, &n)
		m := map[int]bool{}
		for j := 0; j < n; j++ {
			var a int
			fmt.Fscan(cin, &a)
			m[a] = true
		}
		if (len(m) + n) % 2 == 0 {
			// same parity
			fmt.Println(len(m))
		}else {
			fmt.Println(len(m) - 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 t := 0; t < T; t++ {

		res := make(map[int]int)
		var n, x, l, z int
		fmt.Fscan(in, &n)

		for i := 0; i < n; i++ {
			fmt.Fscan(in, &x)
			res[x] = (res[x] + 1) % 2
		}
		for _, v := range res {
			if v > 0 {
				l++
			} else {
				z++
			}
		}
		fmt.Fprintln(out, l+z/2*2)
	}
}

package main

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

func slove() {
	var n int
	fmt.Fscan(r,&n)
	a := make([]int,n)
	for i := 0; i < n; i++ {
		fmt.Fscan(r,&a[i])
	}
	mp := map[int]int{}

	for i := 0; i < n; i++ {
		mp[a[i]]++
	}
	cnt := len(mp)
	if (n-cnt) % 2 == 0 {
		fmt.Fprintln(w,cnt)
	} else {
		fmt.Fprintln(w,cnt-1)

	}

}

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

package main

import "fmt"

func main() {
	var t int
	fmt.Scan(&t)
	for ; t > 0; t-- {
		var n, m int
		fmt.Scan(&n)
		var nums []int
		count := make(map[int]int)
		for i := 0; i < n; i++ {
			fmt.Scan(&m)
			nums = append(nums, m)
			count[m]++
		}
		var a, b int
		for _, v := range count {
			if v%2 == 1 {
				a++
			} else {
				b++
			}
		}
		if b%2 == 0 {
			fmt.Println(a + b)
		} else {
			fmt.Println(a + b - 1)
		}
	}
}

package main

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

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

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

func rw(r io.Reader, w io.Writer) {
	var t int
	var n int
	fmt.Fscan(r, &t)
	for ti := 0; ti < t; ti++ {
		fmt.Fscan(r, &n)
		var a = make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(r, &a[i])
		}
		w1 := do(a)
		fmt.Fprintln(w, w1)
	}
}

func do(a []int) int {
	m := map[int]int{}
	for _, v := range a {
		m[v]++
	}
	c := 0
	d := 0
	for _, v := range m {
		if v%2 == 1 {
			c++
		} else {
			d++
		}
	}
	if d%2 == 1 {
		d--
	}
	return c + d
}

package main

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

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

	var testCases int
	Fscan(in, &testCases)

	for c := 0; c < testCases; c++ {
		var n int
		Fscan(in, &n)
		mp := make(map[int]int)
		nums := make([]int, n)

		var a int
		for i := 0; i < n; i++ {
			Fscan(in, &a)
			nums[i] = a
			mp[a]++
		}

		for i := 0; i < n; i++ {
			if mp[nums[i]] > 1 {
				removed := false
				for j := i + 1; j < n; j++ {
					if mp[nums[j]] > 1 && nums[i] != nums[j] {
						mp[nums[i]]--
						mp[nums[j]]--
						nums[i] = -1
						nums[j] = -1
						removed = true
						break
					}
				}
				if !removed {
					for j := i + 1; j < n; j++ {
						if mp[nums[j]] > 1 && nums[i] == nums[j] {
							mp[nums[i]]--
							mp[nums[j]]--
							nums[i] = -1
							nums[j] = -1
							break
						}
					}
				}
			}
		}

		cnt := 0
		for i := 0; i < n; i++ {
			if nums[i] != -1 {
				cnt++
			}
		}

		Fprintln(out, cnt)

	}
}

package main

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

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

func solve() string {
	var n int
	fmt.Fscan(in, &n)
	var values = make(map[int]bool, n)
	var tmp int
	var res int
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &tmp)
		if !values[tmp] {
			values[tmp] = true
		}
	}

	res = len(values)
	if (n-res)%2 == 1 {
		res--
	}

	return strconv.FormatInt(int64(res), 10)
}

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

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

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

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return 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"
	"math"
	"os"
)

/*

 */

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

	a := make([]int, n)

	numToCnt := make(map[int]int)

	for i := range a {
		scanf("%d", &a[i])

		numToCnt[a[i]]++
	}
	scanf("\n")

	removeCnt := 0

	for _, cnt := range numToCnt {
		removeCnt += cnt - 1
	}

	if removeCnt%2 != 0 {
		removeCnt++
	}

	fmt.Fprintln(writer, n-removeCnt)
}

//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 (
	"bufio"
	"fmt"
	"os"
	"runtime/debug"
)

/* begin of MyIO */
const eof = 0

type any = interface{}

type MyIO struct {
	in  *os.File
	out *bufio.Writer
	_i  int
	_n  int
	buf []byte
}

func NewIO(in *os.File, out *os.File) *MyIO {
	return &MyIO{
		in,
		bufio.NewWriter(out),
		0, 0, make([]byte, 1<<12),
	}
}

func (myio *MyIO) rc() byte {
	if myio._i == myio._n {
		myio._n, _ = myio.in.Read(myio.buf)
		if myio._n == 0 { // EOF
			return eof
		}
		myio._i = 0
	}
	b := myio.buf[myio._i]
	myio._i++
	return b
}

func (myio *MyIO) ReadInt() (x int) {
	rc := myio.rc
	b := rc()
	neg := false
	for ; '0' > b || b > '9'; b = rc() {
		if b == eof {
			return
		}
		if b == '-' {
			neg = true
		}
	}
	for ; '0' <= b && b <= '9'; b = rc() {
		x = x*10 + int(b&15)
	}
	if neg {
		return -x
	}
	return
}

func (myio *MyIO) ReadInt64() (x int64) {
	rc := myio.rc
	b := rc()
	neg := false

	for ; '0' > b || b > '9'; b = rc() {
		if b == eof {
			return
		}
		if b == '-' {
			neg = true
		}
	}
	for ; '0' <= b && b <= '9'; b = rc() {
		x = x*10 + int64(b&15)
	}
	if neg {
		return -x
	}
	return x
}

func (myio *MyIO) ReadBytes() (s []byte) {
	rc := myio.rc
	b := rc()
	for ; b <= ' '; b = rc() {
	}
	for ; b > ' '; b = rc() {
		s = append(s, b)
	}
	return
}

func (myio *MyIO) ReadStr() (s string) {
	return string(myio.ReadBytes())
}

func (myio *MyIO) Flush() {
	myio.out.Flush()
}

func (myio *MyIO) Printf(format string, a ...any) (n int, err error) {
	return fmt.Fprintf(myio.out, format, a...)
}

func (myio *MyIO) Println(a ...any) (n int, err error) {
	return fmt.Fprintln(myio.out, a...)
}

func (myio *MyIO) Print(a ...any) (n int, err error) {
	return fmt.Fprint(myio.out, a...)
}

var myio *MyIO

func ri() int {
	return myio.ReadInt()
}

func ri64() int64 {
	return myio.ReadInt64()
}

func ria(_n int) []int {
	a := make([]int, _n)
	for i := range a {
		a[i] = ri()
	}
	return a
}

/* End of MyIO */

func sol() {
	n := ri()
	a := ria(n)
	m := make(map[int]bool)
	c := 0
	for i := 0; i < n; i++ {
		if _, ok := m[a[i]]; !ok {
			m[a[i]] = true
			c += 1
		}
	}
	z := n - c
	if z%2 == 1 {
		myio.Println(c - 1)
	} else {
		myio.Println(c)
	}
}

func main() {
	debug.SetGCPercent(-1)
	in, out := os.Stdin, os.Stdout
	myio = NewIO(in, out)
	defer myio.Flush()

	var t = 1
	t = ri()
	for ; t > 0; t-- {
		sol()
	}
}

package main

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

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

func slove() {
	var n int
	fmt.Fscan(r, &n)
	nums := make([]int, n)
	for i:=0;i<n;i++ {
		fmt.Fscan(r, &nums[i])
	}
	cnt := map[int]int{}
	ans := len(nums)
	for i := range nums {
		cnt[nums[i]]++
	}
	out := len(cnt)
	if (ans - out) % 2 == 0 {
		fmt.Fprintln(w, out)
	} else {
		fmt.Fprintln(w, out-1)
	}

}

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

package main

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

// https://space.bilibili.com/206214/dynamic
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
		Fscan(in, &n)
		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		cnt := map[int]int{}
		for _, v := range a {
			cnt[v]++
		}
		rm := 0
		for _, c := range cnt {
			rm+=c-1
		}
		if rm&1==1 {
			rm++
		}
		Fprintln(out, n-rm)
	}

	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(
    "fmt"
    "sort"
)
func main() {
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Scan(&n)
		var list []int = make([]int,n)
		for j:=0;j<n;j++{
			fmt.Scan(&list[j])
		}
		sort.Ints(list)
		for j:=1;j<len(list);j++{
			if list[j] == list[j-1] {
				list = append(list[:j-1],list[j:len(list)-1]...)
				j--
			}
		}
		fmt.Println(len(list))
	}
}

package main
import(
    "fmt"
    "sort"
)
func main() {
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Scan(&n)
		var list []int = make([]int,n)
		for j:=0;j<n;j++{
			fmt.Scan(&list[j])
		}
		sort.Ints(list)
		counter:=0
		for j:=1;j<len(list);j++{ // iterate over each element
			if len(list) == 2 && list[j] == list[j-1] && counter>0 {
				break
			}
			if list[j] == list[j-1] {
				counter++
				list = append(list[:j-1],list[j:len(list)-1]...)
				j--
			}
		}
		fmt.Println(len(list))
	}
}

package main
import(
    "fmt"
    "sort"
)
func main() {
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Scan(&n)
		var list []int = make([]int,n)
		for j:=0;j<n;j++{
			fmt.Scan(&list[j])
		}
		sort.Ints(list)
		for j:=1;j<len(list);j++{ // iterate over each element
			if len(list) == 2 && list[j] == list[j-1] {
				break
			}
			if list[j] == list[j-1] {
				list = append(list[:j-1],list[j:len(list)-1]...)
				j--
			}
		}
		fmt.Println(len(list))
	}
}

package main
import(
    "fmt"
    "sort"
)
func main() {
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Scan(&n)
		var list []int = make([]int,n)
		for j:=0;j<n;j++{
			fmt.Scan(&list[j])
		}
		sort.Ints(list)
		for j:=1;j<len(list);j++{ // iterate over each element
			if list[j] == list[j-1] {
				list = append(list[:j-1],list[j:len(list)-1]...)
				j--
			}
		}
		fmt.Println(len(list))
	}
}

package main
import(
    "fmt"
    "sort"
)
func main() {
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Scan(&n)
		var list []int = make([]int,n)
		for j:=0;j<n;j++{
			fmt.Scan(&list[j])
		}
		sort.Ints(list)
		counter:=1
		for j:=1;j<len(list);j++{ // iterate over each element
			if list[j-1] == list[j] {
				counter++
				if counter >= 3 {
					list = append(list[:j-2],list[j:]...)
					j-=2
					counter=1
				} else if j == len(list)-1 {
					if counter >= 2 {
						list= list[:len(list)-2]
					}
				}
			} else if list[j-1] != list[j] {
				if counter >= 2 {
					list = append(list[:j-1],list[j:]...)
					list = list[:len(list)-1]
					j--
					counter=1
				}
			}
		}
		fmt.Println(len(list))
	}
}

package main
import(
    "fmt"
    "sort"
)
func main() {
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Scan(&n)
		var list []int = make([]int,n)
		for j:=0;j<n;j++{
			fmt.Scan(&list[j])
		}
		sort.Ints(list)
		counter:=1
		for j:=1;j<len(list);j++{ // iterate over each element
			if list[j-1] == list[j] {
				counter++
				if counter >= 3 {
					list = append(list[:j-2],list[j:]...)
					j--
					counter=1
				} else if j == len(list)-1 {
					if counter >= 2 {
						list= list[:len(list)-2]
					}
				}
			} else if list[j-1] != list[j] {
				if counter >= 2 {
					list = append(list[:j-1],list[j:]...)
					list = list[:len(list)-1]
					j--
					counter=1
				}
			}
		}
		fmt.Println(len(list))
	}
}

package main
import(
    "fmt"
    "sort"
)
func main() {
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Scan(&n)
		var list []int = make([]int,n)
		for j:=0;j<n;j++{
			fmt.Scan(&list[j])
		}
		sort.Ints(list)
		for j:=0;j<len(list)-1;j++{ // iterate over each element
			if list[j] == list[j+1] {
				for k:=0;k<len(list);k++{ // search for other
					if list[k] != list[j] {
						list= append(list[:k],list[k+1:]...)
						list= append(list[:j],list[j+1:]...)
						break
					}
				}
			}
		}
		fmt.Println(len(list))
	}
}

package main

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

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

func main() {

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

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Fscan(r, &lenSlice)

		slice := make([]int, lenSlice)
		for i := 0; i < lenSlice; i++ {
			_, _ = fmt.Fscan(r, &slice[i])
		}

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		var result int

		if (lenSlice-cantUniq)%2 == 0 {
			result = cantUniq
		} else {
			result = cantUniq - 1
		}

		_, _ = fmt.Fprintln(w, result)
	}

}

package main

import (
	"fmt"
)

func main() {

	var n int
	_, _ = fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Scan(&lenSlice)

		slice := make([]int, 0)
		for i := 0; i < lenSlice; i++ {
			var val int
			_, _ = fmt.Scan(&val)

			slice = append(slice, val)
		}

		if lenSlice == 1 {
			println(1)
			continue
		}

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		var result int
		if cantUniq == lenSlice {
			result = lenSlice
		} else if lenSlice%2 == 0 && cantUniq%2 == 0 {
			result = cantUniq
		} else {
			result = cantUniq - 1
		}

		fmt.Println(result)
	}

}

package main

import (
	"fmt"
)

func main() {

	var n int
	_, _ = fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Scan(&lenSlice)

		slice := make([]int, 0)
		for i := 0; i < lenSlice; i++ {
			var val int
			_, _ = fmt.Scan(&val)

			slice = append(slice, val)
		}

		if lenSlice == 1 {
			println(1)
			continue
		}

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		var result int
		if lenSlice%2 == 0 {
			if cantUniq%2 == 0 {
				result = cantUniq
			}
		} else {
			result = cantUniq - 1
		}

		fmt.Println(result)
	}

}

package main

import (
	"fmt"
)

func main() {

	var n int
	_, _ = fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Scan(&lenSlice)

		slice := make([]int, 0)
		for i := 0; i < lenSlice; i++ {
			var val int
			_, _ = fmt.Scan(&val)

			slice = append(slice, val)
		}

		if lenSlice == 1 {
			println(1)
			continue
		}

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		var result int
		if lenSlice%2 == 0 {
			if cantUniq%2 == 0 {
				result = cantUniq
			}
		} else {
			fmt.Println(cantUniq - 1)
		}

		fmt.Println(result)
	}

}

package main

import (
	"fmt"
)

func main() {

	var n int
	_, _ = fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Scan(&lenSlice)

		slice := make([]int, 0)
		for i := 0; i < lenSlice; i++ {
			var val int
			_, _ = fmt.Scan(&val)

			slice = append(slice, val)
		}

		if lenSlice == 1 {
			println(1)
			continue
		}

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		if lenSlice%2 == 0 {
			fmt.Println(cantUniq)
		} else {
			fmt.Println(cantUniq - 1)
		}
	}

}

package main

import (
	"fmt"
)

func main() {

	var n int
	_, _ = fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var lenSlice int
		_, _ = fmt.Scan(&lenSlice)

		slice := make([]int, 0)
		for i := 0; i < lenSlice; i++ {
			var val int
			_, _ = fmt.Scan(&val)

			slice = append(slice, val)
		}

		if lenSlice == 1 {
			println(1)
			continue
		}

		uniques := make(map[int]int)
		for _, s := range slice {
			uniques[s]++
		}

		cantUniq := len(uniques)
		if lenSlice%2 == 0 {
			println(cantUniq)
		} else {
			println(cantUniq - 1)
		}
	}

}

package main

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

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

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

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

		m := make([]int, 10002)
		for i := 0; i < n; i++ {
			var v int
			fmt.Fscan(in, &v)
			m[v]++
		}

		sort.Slice(m, func(i, j int) bool {
			return m[i] > m[j]
		})
		c := m[0] - 1
		m[0] = 1
		for i := 1; i < 10002; i++ {
			if m[i] == 0 {
				break
			}
			d := min(c, m[i])
			m[i] -= d
			c -= d
		}

		var tot int
		for _, v := range m {
			if v > 0 {
				tot++
			}
		}
		fmt.Fprintln(out, tot)
	}
}

package main

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

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

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

		m := make(map[int]int)
		var max int
		for i := 0; i < n; i++ {
			var v int
			fmt.Fscan(in, &v)
			m[v]++
			if m[v] > max {
				max = m[v]
			}
		}

		var tot int
		for _, v := range m {
			if v == max {
				tot++
			}
		}
		fmt.Fprintln(out, tot)
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var n,t,a int
	//ans := 0
	kisu := 0
	guusuu := 0
	count:= 0
	fmt.Fscan(in, &n)

	// bitsがn個の要素の各パターンを表す
	for i := 0;i < n;i++ {
		fmt.Fscan(in, &t)
		m := make(map[int]int)
		list := make([]int,t)
		for j := 0;j < t;j++ {
			fmt.Fscan(in, &a)
			if _,ok := m[a];ok{
				m[a]++
			}else{
				m[a] = 1
				list[count] = a
				count++
			}
		}
		for j := 0;j < len(m);j++ {
			if m[list[j]]%2 == 1{
				kisu++
			}else{
				guusuu++
			}
		}

		if kisu > 0{
			fmt.Println(kisu)
		}else if len(m) == 1{
			fmt.Println(0)
		}else if len(m)%2 == 1{
			fmt.Println(guusuu-1)
		}else{
			fmt.Println(guusuu)
		}

		//ans = 0
		kisu = 0
		guusuu = 0
		count = 0
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var n,t,a int
	//ans := 0
	kisu := 0
	guusuu := 0
	count:= 0
	fmt.Fscan(in, &n)

	// bitsがn個の要素の各パターンを表す
	for i := 0;i < n;i++ {
		fmt.Fscan(in, &t)
		m := make(map[int]int)
		list := make([]int,t)
		for j := 0;j < t;j++ {
			fmt.Fscan(in, &a)
			if _,ok := m[a];ok{
				m[a]++
			}else{
				m[a] = 1
				list[count] = a
				count++
			}
		}
		for j := 0;j < len(m);j++ {
			if m[list[j]]%2 == 1{
				kisu++
			}else{
				guusuu++
			}
		}

		if kisu > 0{
			fmt.Println(kisu)
		}else if len(m) == 1{
			fmt.Println(0)
		}else{
			fmt.Println(guusuu)
		}

		//ans = 0
		kisu = 0
		guusuu = 0
		count = 0
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var n,t,a int
	//ans := 0
	kisu := 0
	guusuu := 0
	count:= 0
	fmt.Fscan(in, &n)

	// bitsがn個の要素の各パターンを表す
	for i := 0;i < n;i++ {
		fmt.Fscan(in, &t)
		m := make(map[int]int)
		list := make([]int,t)
		for j := 0;j < t;j++ {
			fmt.Fscan(in, &a)
			if _,ok := m[a];ok{
				m[a]++
			}else{
				m[a] = 1
				list[count] = a
				count++
			}
		}
		for j := 0;j < len(m);j++ {
			if m[list[j]]%2 == 1{
				kisu++
			}else{
				guusuu++
			}
		}

		if kisu > 0{
			fmt.Println(kisu)
		}else{
			fmt.Println(guusuu)
		}

		//ans = 0
		kisu = 0
		guusuu = 0
		count = 0
	}
}

package main

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

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

func solve() {
	var n int
	scanf("%d\n", &n)
	arr := IntArray(n)

	mp := map[int]int{}
	for i := range arr {
		if _, found := mp[arr[i]]; found {
			n -= 1
			mp[arr[i]] += 1
		} else {
			mp[arr[i]] = 1
		}
	}

	preVal := -1
	for _, val := range mp {
		if preVal == -1 {
			preVal = val
			continue
		}
		if val != preVal {
			n -= 1
			break
		}
	}

	printf("%v\n", n)
}

func main() {
	defer writer.Flush()

	var cases int

	scanf("%d\n", &cases)
	// cases = 1

	for c := 0; c < cases; c++ {
		solve()
	}
}

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

func IntArray(size int) []int {
	arr := make([]int, size)
	for i := 0; i < size; i++ {
		scanf("%d", &arr[i])
	}
	scanf("\n")
	return arr
}

func Max(args ...int) int {
	m := args[0]
	for i := range args {
		if args[i] > m {
			m = args[i]
		}
	}
	return m
}

func Min(args ...int) int {
	m := args[0]
	for i := range args {
		if args[i] < m {
			m = args[i]
		}
	}
	return m
}

package main

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

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

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

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

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

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

/**
Run solve the problem CF1692B
Date: 18/06/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1692/B
Problem: CF1692B
**/
func (in *CF1692B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		mapa := make(map[int]bool)
		for i:=0;i<n;i++{
			mapa[in.NextInt()] = true
		}
		fmt.Println(len(mapa))

	}
}

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

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


Ilya is working for the company that constructs robots. Ilya writes programs for entertainment robots, and his current project is "Bob", a new-generation game robot. Ilya's boss wants to know his progress so far. Especially he is interested if Bob is better at playing different games than the previous model, "Alice". So now Ilya wants to compare his robots' performance in a simple game called "1-2-3". This game is similar to the "Rock-Paper-Scissors" game: both robots secretly choose a number from the set {1, 2, 3} and say it at the same moment. If both robots choose the same number, then it's a draw and noone gets any points. But if chosen numbers are different, then one of the robots gets a point: 3 beats 2, 2 beats 1 and 1 beats 3. Both robots' programs make them choose their numbers in such a way that their choice in (i + 1)-th game depends only on the numbers chosen by them in i-th game. Ilya knows that the robots will play k games, Alice will choose number a in the first game, and Bob will choose b in the first game. He also knows both robots' programs and can tell what each robot will choose depending on their choices in previous game. Ilya doesn't want to wait until robots play all k games, so he asks you to predict the number of points they will have after the final game.

The first line contains three numbers k, a, b (1 ≤ k ≤ 1018, 1 ≤ a, b ≤ 3).  Then 3 lines follow, i-th of them containing 3 numbers Ai, 1, Ai, 2, Ai, 3, where Ai, j represents Alice's choice in the game if Alice chose i in previous game and Bob chose j (1 ≤ Ai, j ≤ 3).  Then 3 lines follow, i-th of them containing 3 numbers Bi, 1, Bi, 2, Bi, 3, where Bi, j represents Bob's choice in the game if Alice chose i in previous game and Bob chose j (1 ≤ Bi, j ≤ 3).

Print two numbers. First of them has to be equal to the number of points Alice will have, and second of them must be Bob's score after k games.

NoteIn the second example game goes like this:The fourth and the seventh game are won by Bob, the first game is draw and the rest are won by Alice.

package main

import "fmt"

type Pair struct {
	a, b interface{}
}

func main() {
	var k int64
	var a, b int
	n, err := fmt.Scanf("%v%v%v", &k, &a, &b)
	a--
	b--
	if n != 3 {
		panic(err)
	}

	var g [2][3][3]int
	for k := 0; k < 2; k++ {
		for i, _ := range g[k] {
			for j, _ := range g[k][i] {
				fmt.Scan(&g[k][i][j])
				g[k][i][j]--
			}
		}
	}

	var t int64
	z := make(map[Pair]Pair)

	var x, y int64
	for t < k {
		// fmt.Printf("a: %v b: %v t: %v x: %v y: %v\n", a, b, t, x, y)

		if val, ok := z[Pair{a, b}]; ok {
			cycle := t - val.a.(int64)
			cnt := (k - t) / cycle
			if cnt > 0 {
				dx := x - val.b.(Pair).a.(int64)
				dy := y - val.b.(Pair).b.(int64)
				x += cnt * dx
				y += cnt * dy
				t += cnt * cycle

				// fmt.Printf("in cycle\n")
				continue
			}
		}

		z[Pair{a, b}] = Pair{t, Pair{x, y}}

		if a != b {
			if (a+2)%3 == b {
				x++
			} else {
				y++
			}
		}

		aa := g[0][a][b]
		bb := g[1][a][b]
		a = aa
		b = bb
		// fmt.Printf("a: %v b: %v aa: %v bb: %v\n", a, b, aa, bb)
		t++
	}

	fmt.Println(x, y)
}


The average miner Vaganych took refresher courses. As soon as a miner completes the courses, he should take exams. The hardest one is a computer test called "Testing Pants for Sadness".The test consists of n questions; the questions are to be answered strictly in the order in which they are given, from question 1 to question n. Question i contains ai answer variants, exactly one of them is correct. A click is regarded as selecting any answer in any question. The goal is to select the correct answer for each of the n questions. If Vaganych selects a wrong answer for some question, then all selected answers become unselected and the test starts from the very beginning, from question 1 again. But Vaganych remembers everything. The order of answers for each question and the order of questions remain unchanged, as well as the question and answers themselves.Vaganych is very smart and his memory is superb, yet he is unbelievably unlucky and knows nothing whatsoever about the test's theme. How many clicks will he have to perform in the worst case?

The first line contains a positive integer n (1 ≤ n ≤ 100). It is the number of questions in the test. The second line contains space-separated n positive integers ai (1 ≤ ai ≤ 109), the number of answer variants to question i.

Print a single number — the minimal number of clicks needed to pass the test it the worst-case scenario.  Please do not use the %lld specificator to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specificator.

NoteNote to the second sample. In the worst-case scenario you will need five clicks:   the first click selects the first variant to the first question, this answer turns out to be wrong.  the second click selects the second variant to the first question, it proves correct and we move on to the second question;  the third click selects the first variant to the second question, it is wrong and we go back to question 1;  the fourth click selects the second variant to the first question, it proves as correct as it was and we move on to the second question;  the fifth click selects the second variant to the second question, it proves correct, the test is finished.

package main

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

func main() {
    var n,i,k,ans int64
    ans=0
    fmt.Scan(&n)
    input:= bufio.NewScanner(os.Stdin)
    input.Split(bufio.ScanWords)

    for i=1;i<=n;i++ {
    	input.Scan()
	bb,_:=strconv.ParseInt(input.Text(),0,64)
	k=bb
	ans+=((k-1)*i+1)
    }
    fmt.Println(ans)
}