package main

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

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

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

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

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

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

/**
Run solve the problem CF1658A
Date: 19/04/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1658/A
Problem: CF1658A
**/
func (in *CF1658A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		in.NextInt()
		str := in.NextString()
		ans := 0

		for i := 1; i < len(str); i++ {
			if str[i] == '0' && str[i-1] == '0' {
				str = str[:i] + "11" + str[i:]
				ans += 2
			}
		}

		for i:=2;i< len(str);i++{
			if str[i-2]=='0' && str[i-1]=='1' && str[i] == '0'{
				str = str[:i-1] + "1" + str[i-1:]
				ans += 1
			}
		}

		fmt.Println(ans)
	}
}

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

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

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
		fmt.Fscan(in,&n)
		var word string
		fmt.Fscan(in,&word)
		var sum int
		for j:=0;j<n-1;j++{
			if string(word[j]) == "0" {
				count:=2
				for k:=j+1;k<n;k++{
					if string(word[k]) == "1" {
						count--
					}
					if string(word[k]) == "0" || count == 0 {
						sum+=count
						break
					}
				}
			}
		}
		fmt.Fprintln(out,sum)
	}
}

package main

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

const mod = 998244353

func solve(in *bufio.Reader, out *bufio.Writer) {
	defer out.Flush()
	var n int
	fmt.Fscan(in,&n)
	var str string
	fmt.Fscan(in,&str)
	var arr []int
	for i := 0;i < len(str);i++{
		if str[i] == '0'{
			arr = append(arr,i)
		}
	}
	ans := 0
	for i := 1;i < len(arr);i++{
		if arr[i] - arr[i - 1] <= 2{
			ans += 3 - (arr[i] - arr[i - 1])
		}
	}
	fmt.Fprintln(out,ans)
}

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

func max(a,b int)int{
	if a > b{
		return a
	}
	return b
}
func min(a,b int)int{
	if a > b{
		return b
	}
	return a
}
func 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 (
	"fmt"
	"strings"
)

func count(sub, pat string) int {
	var c int
	for d := range sub {
	   if strings.HasPrefix(sub[d:], pat) { c++ }
	}
	return c
 }

func main() {
	var (
		t   int
		n   int
		str string
	)
	for fmt.Scan(&t); t > 0; t-- {
		fmt.Scan(&n, &str)
		ans := 0
		ans += (count(str, "00") * 2)
		ans += count(str, "010")
		fmt.Println(ans)
	}
}

package main

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

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

const mod = 998244353

// 1 2 3 4
func main() {
	in, out := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t := 0
	fmt.Fscan(in, &t)

	for ii := 0; ii < t; ii++ {
		var n int
		fmt.Fscan(in, &n)
		var s string
		fmt.Fscan(in, &s)
		ans := 0
		last := -1
		for i := 0; i < n; i++ {
			if s[i] == '0' {
				if last != -1 && i-last < 3 {
					ans += 3 - i + last
				}
				last = i
			}
		}
		fmt.Fprintln(out, ans)
	}
}

package main

import "fmt"

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

func main() {
	var T int
	fmt.Scan(&T)
	for ; T > 0; T-- {
		var n int
		var str string
		fmt.Scan(&n, &str)
		last := -10
		ans := 0
		for i := 0; i < n; i++ {
			if str[i] == '0' {
				ans += Max(0, 2-(i-last)+1)
				last = i
			}
		}
		fmt.Println(ans)
	}
}

package main

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

var T int

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	Fscan(in, &T)
	for ; T > 0; T-- {
		var n int
		var str string
		Fscan(in, &n, &str)
		ans := 0
		i, j := 0, -1
		for i < n {
			if str[i] == '1' {
				i++
				continue
			}
			if j == -1 {
				j = i
				i++
			} else {
				if i - j == 1 {
					ans += 2
				} else if i - j == 2 {
					ans += 1
				}
				j = i
				i++
			}
		}
		Fprintln(out, ans)
	}
	defer out.Flush()
}

package main

import "fmt"

func main() {
	var T, n int
	var pos []int
	var s string
	fmt.Scan(&T)
	for ; T > 0; T-- {
		fmt.Scan(&n, &s)
		pos = []int{}
		for i, e := range s {
			if e == '0' {
				pos = append(pos, i)
			}
		}
		var ans int
		for i := 1; i < len(pos); i++ {
			if pos[i]-pos[i-1]-1 < 2 {
				ans += 2 - (pos[i] - pos[i-1] - 1)
			}
		}
		fmt.Println(ans)
	}
}

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

		var req int
		for i := 0; i < n-1; i++ {
			if s[i] == '0' && s[i+1] == '0' {
				req += 2
			} else if s[i] == '0' && s[i+1] == '1' && i < n-2 && s[i+2] == '0' {
				req += 1
			}
		}
		fmt.Fprintln(out, req)
	}
}

package main

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

const (
	INF = 3e5 + 10
)

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

	var t int
	Fscan(in, &t)

	for k := 0; k < t; k++ {
		var n int
		var s string
		Fscan(in, &n, &s)

		last := -1
		ans := 0
		for i := 0; i < len(s); i++ {
			if s[i] == '0' {
				if last != -1 {
					if i-last < 3 {
						ans += 3 - i + last
					}

				}
				last = i
			}

		}

		Fprintln(out, ans)
	}

}

package main

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

/*
4
1
0
1
1
2
00
3
010
---
0
0
2 0110
1 0110
==========
000
0110110
*/

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

	cnt := 0

	for i := 1; i < n; i++ {
		if s[i] == '0' && s[i-1] == '0' {
			cnt += 2
		}
	}

	for i := 2; i < n; i++ {
		if s[i-2] == '0' && s[i-1] == '1' && s[i] == '0' {
			cnt += 1
		}
	}

	fmt.Fprintln(writer, cnt)
}

//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 minIdx(nums ...int) int {
	minNumIdx := 0
	for i, num := range nums {
		if num < nums[minNumIdx] {
			minNumIdx = i
		}
	}

	return minNumIdx
}

//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 abs(num int) int {
	if num < 0 {
		return -num
	}
	return num
}

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

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

	for i := 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))
}

package main

import "fmt"

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

	for ; t > 0; t-- {
		var n int
		var s string

		fmt.Scan(&n)
		fmt.Scan(&s)

		var ans int

		var last int = -1
		for i := 0; i < n; i++ {
			switch s[i] {
			case '0':
				if last != -1 {
					length := i - last
					if length == 1 {
						ans += 2
					} else if length == 2 {
						ans += 1
					}
				}
				last = i
			}
		}

		fmt.Println(ans)
	}
}

// generated by 1e9y at 27-03-2022
// template version: 2022-01-11

package main

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

// 101101101101101101101101101101101101

// 0000.A
func solve(n int, s string) int {
	// here goes solution
	c := 0
	for i := 0; i < n-1; i++ {
		if s[i] == '0' && s[i+1] == '0' {
			c += 2
		} else if s[i] == '0' && s[i+1] == '1' {
			if i < n-2 {
				if s[i+2] == '0' {
					c += 1
				}
			}
		}
	}
	if c < 0 {
		return 0
	}
	return c
}

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

	t := ReadInt(in)
	for i := 0; i < t; i++ {
		// here goes input reading
		n := ReadInt(in)
		s := ReadLine(in)
		Output(solve(n, s))
	}
}

// helpers for convenient input reading

func ReadInt(in *bufio.Reader) int {
	line, _ := in.ReadString('\n')
	line = strings.Trim(line, "\n\r")
	n, _ := strconv.Atoi(line)
	return n
}

func ReadLine(in *bufio.Reader) string {
	line, _ := in.ReadString('\n')
	line = strings.Trim(line, "\n\r")
	return line
}

func ReadLineParts(in *bufio.Reader) []string {
	line, _ := in.ReadString('\n')
	line = strings.Trim(line, "\n\r")
	parts := strings.Split(line, " ")
	return parts
}

func ReadIntSlice(in *bufio.Reader) []int {
	parts := ReadLineParts(in)
	slice := make([]int, len(parts))
	for i, n := range parts {
		slice[i] = MustAtoi(n)
	}
	return slice
}

func ReadInt64Slice(in *bufio.Reader) []int64 {
	parts := ReadLineParts(in)
	slice := make([]int64, len(parts))
	for i, n := range parts {
		slice[i] = MustParseInt(n, 10, 64)
	}
	return slice
}

func ReadUint64Slice(in *bufio.Reader) []uint64 {
	parts := ReadLineParts(in)
	slice := make([]uint64, len(parts))
	for i, n := range parts {
		slice[i] = MustParseUint(n, 10, 64)
	}
	return slice
}

func MustAtoi(s string) int {
	v, _ := strconv.Atoi(s)
	return v
}

func MustParseInt(s string, base, bitSize int) int64 {
	v, _ := strconv.ParseInt(s, base, bitSize)
	return v
}

func MustParseUint(s string, base, bitSize int) uint64 {
	v, _ := strconv.ParseUint(s, base, bitSize)
	return v
}

func SkipLine(in *bufio.Reader) {
	_, _ = in.ReadString('\n')
}

// helper for convenient answer output

func Output(v interface{}) {
	switch v.(type) {
	case bool:
		if v == true {
			Println("YES")
		} else {
			Println("NO")
		}
	default:
		Println(v)
	}
}

package main

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

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

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 4096), 1e9)
}

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

func _int() int {
	s := _string()
	i := 0
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int(r - '0')
	}
	return i
}

func _int64() int64 {
	s := _string()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

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

func main() {
	defer writer.Flush()
	for t := _int(); t > 0; t-- {
		_ = _int()
		sol(_string())
	}
}

func sol(s string) {
	pos := []int{}
	for i := range s {
		if s[i] == '0' {
			pos = append(pos, i)
		}
	}
	res := 0
	for i := 0; i < len(pos)-1; i++ {
		if pos[i] == pos[i+1]-1 {
			res += 2
			continue
		}
		if pos[i] == pos[i+1]-2 {
			res += 1
			continue
		}
	}
	printf("%d\n", res)
}

package main

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

func readInt(in *bufio.Reader) int {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return n
}
func readInt64(in *bufio.Reader) int64 {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.ParseInt(nStr, 10, 64)
	return n
}
func readLineNumbs(in *bufio.Reader) []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt(in *bufio.Reader) []int {
	numbs := readLineNumbs(in)
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}
func readArrInt64(in *bufio.Reader) []int64 {
	numbs := readLineNumbs(in)
	arr := make([]int64, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.ParseInt(n, 10, 64)
		arr[i] = val
	}
	return arr
}

func main() {
	ip := bufio.NewReader(os.Stdin)
	t := readInt(ip)
	for t > 0 {
		t--
		n := readInt(ip)
		s, _ := ip.ReadString('\n')
		ans := 0
		for i := 0; i < n; {
			if s[i] == '0' {
				if i < n-1 && s[i+1] == '0' {
					ans += 2
				} else if i < n-2 && s[i+2] == '0' {
					ans++
					i++
				}
			}
			i++
		}
		fmt.Println(ans)
	}
}

package main

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

// var N int = 2e5 + 10
// var MOD int64 = 1e9 + 7

func main() {

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

	var T, n int
	var s string
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n, &s)
		sz := len(s)
		ans := 0
		for i := 0; i+1 < sz; i++ {
			if s[i] == '0' {
				if s[i+1] == '0' {
					ans += 2
				} else if i+2 < sz && s[i+2] == '0' {
					ans++
				}
			}
		}
		Fprintln(out, ans)
	}
}

package main

import (
	"fmt"
)

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

	for ; T > 0; T-- {
		fmt.Scan(&n, &s)
		sz := len(s)
		ans := 0
		for i := 0; i+1 < sz; i++ {
			if s[i] == '0' {
				if s[i+1] == '0' {
					ans += 2
				} else if i+2 < sz && s[i+2] == '0' {
					ans++
				}
			}
		}
		fmt.Println(ans)
	}
}


package main

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

func main() {
	defer out.Flush()
	n := in.NextInt()
	m := in.NextInt()
	inDeg := make([]int, n)
	edges := make([][]int, n)
	inputs := make([]Line, m)
	for i := range inputs {
		a := in.NextInt() - 1
		b := in.NextInt() - 1
		inputs[i] = Line{a, b}
		edges[a] = append(edges[a], b)
		inDeg[b]++
	}

	root := -1
	for i := range inDeg {
		if inDeg[i] == 0 {
			if root != -1 {
				fmt.Fprintln(out, -1)
				return
			}
			root = i
		}
	}

	next := make([]int, n)
	for root != -1 {
		nextRoot := -1
		for _, u := range edges[root] {
			inDeg[u]--
			if inDeg[u] == 0 {
				if nextRoot != -1 {
					fmt.Fprintln(out, -1)
					return
				}
				nextRoot = u
			}
		}
		next[root] = nextRoot
		root = nextRoot
	}

	for i := range inDeg {
		if inDeg[i] != 0 {
			fmt.Fprintln(out, -1)
			return
		}
	}

	k := 0
	for i := range inputs {
		a := inputs[i].a
		b := inputs[i].b
		if next[a] == b {
			k++
			if k == n-1 {
				fmt.Fprintln(out, i+1)
				return
			}
		}
	}

	fmt.Fprintln(out, -1)
}

type Line struct {
	a, b int
}

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

type FastReader struct {
	r   *bufio.Reader
	buf string
}

func NewFastReader(r io.Reader) *FastReader {
	return &FastReader{
		r: bufio.NewReader(r),
	}
}

func (r *FastReader) advance() {
	for len(r.buf) != 0 && r.buf[0] == ' ' {
		r.buf = r.buf[1:]
	}
	for len(r.buf) == 0 {
		var buf bytes.Buffer
		for {
			chunk, more, _ := r.r.ReadLine()
			buf.Write(chunk)
			if !more {
				break
			}
		}
		r.buf = buf.String()
	}
}

func (r *FastReader) NextLine() string {
	r.advance()
	line := r.buf
	r.buf = ""
	return line
}

func (r *FastReader) NextWord() string {
	r.advance()
	var word string
	wordStart := 0
	for i := 0; i < len(r.buf); i++ {
		b := r.buf[i]
		if b == ' ' {
			if i != wordStart {
				word = r.buf[wordStart:i]
				r.buf = r.buf[i:]
				break
			}
			wordStart = i + 1
		}
	}
	if len(word) == 0 {
		word = r.buf
		r.buf = ""
	}
	return word
}

func (r *FastReader) NextInt() int {
	return parseInt(r.NextWord())
}

func parseInt(word string) int {
	sign := 1
	if word[0] == '-' {
		sign = -1
		word = word[1:]
	}
	result := 0
	for i := 0; i < len(word); i++ {
		result = result*10 + int(word[i]) - '0'
	}
	result *= sign
	return result
}

package main

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

type Pair struct {
	first,second int
}

const MAXN = 100006

var edges [MAXN][] Pair
var vis [MAXN] bool
var cur int
var ord[MAXN] int

func ini(N int) {
	var i int
	var emp[] Pair
	for i=1; i<=N; i++ {
		vis[i] = false
		edges[i] = emp
	}
	cur = N
}

func dfs(node int) {
	if vis[node] == true {return}
	vis[node] = true
	length := len(edges[node])
	for i:=0; i<length; i++ {
		dfs(edges[node][i].first)
	}
	ord[cur] = node
	cur--
}

func check(node,now int) int {
	length := len(edges[node])
	for i:=0; i<length; i++ {
		if edges[node][i].first == now {return edges[node][i].second}
	}
	return -1
}

func main() {
	var N,M,ans int
	var u,v,i int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &N)
	fmt.Fscan(in, &M)
	ini(N)
	for m:=1; m<=M; m++ {
		fmt.Fscan(in, &u)
		fmt.Fscan(in, &v)
		edges[u] = append(edges[u],Pair{v,m})
	}
	for i=1; i<=N; i++ {
		dfs(i)
	}
	ans = -1
	for i=2; i<=N; i++ {
		u = check(ord[i-1],ord[i])
		if u == -1 {break}
		if u > ans {ans = u}
	}
	if i<=N { ans = -1 }
	fmt.Printf("%d\n", ans)
}


package main

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

// github.com/EndlessCheng/codeforces-go
type seg []struct {
	l, r  int
	state int8
	flip  bool
}

func (t seg) maintain(o int) {
	x, y := t[o<<1].state, t[o<<1|1].state
	if x < 0 && y < 0 {
		t[o].state = -1
	} else if x > 0 && y > 0 {
		t[o].state = 1
	} else {
		t[o].state = 0
	}
}

func (t seg) build(o, l, r int) {
	t[o].l, t[o].r, t[o].state = l, r, -1
	if l == r {
		return
	}
	m := (l + r) >> 1
	t.build(o<<1, l, m)
	t.build(o<<1|1, m+1, r)
}

func (t seg) do(o int) {
	t[o].state = -t[o].state
	t[o].flip = !t[o].flip
}

func (t seg) spread(o int) {
	if t[o].flip {
		t.do(o << 1)
		t.do(o<<1 | 1)
		t[o].flip = false
	}
}

func (t seg) flip(o, l, r int) {
	if l <= t[o].l && t[o].r <= r {
		t.do(o)
		return
	}
	t.spread(o)
	m := (t[o].l + t[o].r) >> 1
	if l <= m {
		t.flip(o<<1, l, r)
	}
	if m < r {
		t.flip(o<<1|1, l, r)
	}
	t.maintain(o)
}

func (t seg) next0(o, l int) int {
	if t[o].l == t[o].r {
		if t[o].state < 0 {
			return t[o].l
		}
		return 0
	}
	t.spread(o)
	m := (t[o].l + t[o].r) >> 1
	if l <= m && t[o<<1].state <= 0 {
		if p := t.next0(o<<1, l); p > 0 {
			return p
		}
	}
	return t.next0(o<<1|1, l)
}

func (t seg) next1(o, l int) int {
	if t[o].l == t[o].r {
		if t[o].state > 0 {
			return t[o].l
		}
		return 0
	}
	t.spread(o)
	m := (t[o].l + t[o].r) >> 1
	if l <= m && t[o<<1].state >= 0 {
		if p := t.next1(o<<1, l); p > 0 {
			return p
		}
	}
	return t.next1(o<<1|1, l)
}

func (t seg) last1(o int) int {
	if t[o].l == t[o].r {
		return t[o].l
	}
	t.spread(o)
	if t[o<<1|1].state >= 0 {
		return t.last1(o<<1 | 1)
	}
	return t.last1(o << 1)
}

func CF1705E(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mx int = 2e5 + 20

	var n, q, i, v int
	Fscan(in, &n, &q)
	a := make([]int, n+1)
	t := make(seg, mx*4)
	t.build(1, 1, mx)
	for i := 1; i <= n; i++ {
		Fscan(in, &a[i])
		t.flip(1, a[i], t.next0(1, a[i]))
	}
	for ; q > 0; q-- {
		Fscan(in, &i, &v)
		t.flip(1, a[i], t.next1(1, a[i]))
		a[i] = v
		t.flip(1, v, t.next0(1, v))
		Fprintln(out, t.last1(1))
	}
}

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

package main

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

// github.com/EndlessCheng/codeforces-go
type seg []struct {
	l, r  int
	state int8
	flip  bool
}

func (t seg) maintain(o int) {
	x, y := t[o<<1].state, t[o<<1|1].state
	if x < 0 && y < 0 {
		t[o].state = -1
	} else if x > 0 && y > 0 {
		t[o].state = 1
	} else {
		t[o].state = 0
	}
}

func (t seg) build(o, l, r int) {
	t[o].l, t[o].r, t[o].state = l, r, -1
	if l == r {
		return
	}
	m := (l + r) >> 1
	t.build(o<<1, l, m)
	t.build(o<<1|1, m+1, r)
}

func (t seg) do(o int) {
	t[o].state = -t[o].state
	t[o].flip = !t[o].flip
}

func (t seg) spread(o int) {
	if t[o].flip {
		t.do(o << 1)
		t.do(o<<1 | 1)
		t[o].flip = false
	}
}

func (t seg) flip(o, l, r int) {
	if l <= t[o].l && t[o].r <= r {
		t.do(o)
		return
	}
	t.spread(o)
	m := (t[o].l + t[o].r) >> 1
	if l <= m {
		t.flip(o<<1, l, r)
	}
	if m < r {
		t.flip(o<<1|1, l, r)
	}
	t.maintain(o)
}

func (t seg) next0(o, l int) int {
	if t[o].l == t[o].r {
		if t[o].state < 0 {
			return t[o].l
		}
		return 0
	}
	t.spread(o)
	m := (t[o].l + t[o].r) >> 1
	if l <= m && t[o<<1].state <= 0 {
		if p := t.next0(o<<1, l); p > 0 {
			return p
		}
	}
	return t.next0(o<<1|1, l)
}

func (t seg) next1(o, l int) int {
	if t[o].l == t[o].r {
		if t[o].state > 0 {
			return t[o].l
		}
		return 0
	}
	t.spread(o)
	m := (t[o].l + t[o].r) >> 1
	if l <= m && t[o<<1].state >= 0 {
		if p := t.next1(o<<1, l); p > 0 {
			return p
		}
	}
	return t.next1(o<<1|1, l)
}

func (t seg) last1(o int) int {
	if t[o].l == t[o].r {
		return t[o].l
	}
	t.spread(o)
	if t[o<<1|1].state >= 0 {
		return t.last1(o<<1 | 1)
	}
	return t.last1(o << 1)
}

func CF1705E(_r io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	buf := make([]byte, 1<<12)
	_i := len(buf)
	rc := func() byte {
		if _i >= len(buf) {
			_r.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}

	n, q := r(), r()
	a := make([]int, n+1)
	t := make(seg, (2e5+20)*4)
	t.build(1, 1, 2e5+20)
	for i := 1; i <= n; i++ {
		a[i] = r()
		t.flip(1, a[i], t.next0(1, a[i]))
	}
	for ; q > 0; q-- {
		i, v := r(), r()
		t.flip(1, a[i], t.next1(1, a[i]))
		a[i] = v
		t.flip(1, v, t.next0(1, v))
		Fprintln(out, t.last1(1))
	}
}

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

package main

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

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

	var buf bytes.Buffer

	n, m := readTwoNums(reader)
	A := readNNums(reader, n)
	ques := make([][]int, m)
	for i := 0; i < m; i++ {
		ques[i] = readNNums(reader, 2)
	}
	res := solve(A, ques)

	for _, ans := range res {
		buf.WriteString(fmt.Sprintf("%d\n", ans))
	}

	fmt.Print(buf.String())
}

func readString(reader *bufio.Reader) string {
	s, _ := reader.ReadString('\n')
	for i := 0; i < len(s); i++ {
		if s[i] == '\n' || s[i] == '\r' {
			return s[:i]
		}
	}
	return s
}

func normalize(s string) string {

	for i := len(s); i > 0; i-- {
		if s[i-1] >= 'a' && s[i-1] <= 'z' {
			return s[:i]
		}
	}
	return ""
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func readNInt64s(reader *bufio.Reader, n int) []int64 {
	res := make([]int64, n)
	s, _ := reader.ReadBytes('\n')

	var pos int

	for i := 0; i < n; i++ {
		pos = readInt64(s, pos, &res[i]) + 1
	}

	return res
}

func readInt64(bytes []byte, from int, val *int64) int {
	i := from
	var sign int64 = 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	var tmp int64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int64(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

const MAX_A = 200100

type Node struct {
	left, right *Node
	start, end  int
	tag         int
	val         int
	lazy        bool
}

func NewNode(start int, end int) *Node {
	node := new(Node)
	node.start = start
	node.end = end
	node.tag = 0
	node.val = 0
	node.lazy = false
	if start < end {
		mid := (start + end) / 2
		node.left = NewNode(start, mid)
		node.right = NewNode(mid+1, end)
	}
	return node
}

func (node *Node) push() {
	if !node.lazy {
		return
	}

	node.val = (node.end - node.start + 1) * node.tag

	if node.start == node.end {
		return
	}

	node.left.lazy = node.lazy
	node.left.tag = node.tag
	node.right.lazy = node.lazy
	node.right.tag = node.tag
	node.tag = 0
	node.lazy = false
}

func (node *Node) Update(start int, end int, x int) {
	node.push()
	if node.end < start || end < node.start {
		// out of bound
		return
	}
	if start <= node.start && node.end <= end {
		node.tag = x
		node.lazy = true
		node.push()
	} else {
		node.left.Update(start, end, x)
		node.right.Update(start, end, x)
		node.val = node.left.val + node.right.val
	}
}

func (node *Node) Query(start int, end int) int {
	if node.end < start || end < node.start {
		return 0
	}
	node.push()

	if start <= node.start && node.end <= end {
		return node.val
	}

	if node.left == nil {
		return 0
	}

	return node.left.Query(start, end) + node.right.Query(start, end)
}

// pre = prefix_sum([0...k))
func (node *Node) max_right(k int, pre int, v int) int {
	node.push()

	if node.start == node.end {
		if node.val == v {
			return node.start
		}
		return node.start - 1
	}

	node.left.push()

	mid := (node.start + node.end) / 2
	if mid < k {
		return node.right.max_right(k, pre-node.left.val, v)
	}
	if node.left.val-pre == v*(mid+1-k) {
		return node.right.max_right(mid+1, 0, v)
	}

	return node.left.max_right(k, pre, v)
}

func (node *Node) get_answer() int {
	node.push()
	if node.start == node.end {
		if node.val == 1 {
			return node.start
		}
		return node.start - 1
	}

	node.right.push()

	if node.right.val == 0 {
		return node.left.get_answer()
	}

	return node.right.get_answer()
}

func solve(A []int, queries [][]int) []int {
	root := NewNode(0, MAX_A)

	add := func(x int) {
		// x 右边连续1的位置
		y := root.max_right(x, root.Query(0, x-1), 1) + 1
		if x == y {
			root.Update(x, x, 1)
		} else {
			root.Update(x, y-1, 0)
			root.Update(y, y, 1)
		}
	}

	remove := func(x int) {
		y := root.max_right(x, root.Query(0, x-1), 0) + 1
		if x == y {
			root.Update(x, x, 0)
		} else {
			root.Update(x, y-1, 1)
			root.Update(y, y, 0)
		}
	}

	for i := 0; i < len(A); i++ {
		add(A[i])
	}

	ans := make([]int, len(queries))

	for i, cur := range queries {
		k, l := cur[0], cur[1]
		k--
		remove(A[k])
		add(l)
		A[k] = l
		ans[i] = root.get_answer()
	}
	return ans
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"math/bits"
	"os"
)

// github.com/EndlessCheng/codeforces-go
const w = bits.UintSize

var b [6253]uint

func flip(l, r int) {
	r++
	maskL, maskR := ^uint(0)<<(l%w), ^uint(0)<<(r%w)
	i := l / w
	if i == r/w {
		b[i] ^= maskL ^ maskR
		return
	}
	b[i] ^= maskL
	for i++; i < r/w; i++ {
		b[i] = ^b[i]
	}
	b[i] ^= ^maskR
}

func next0(p int) int {
	i := p / w
	v := b[i]
	if p%w > 0 {
		v |= ^(^uint(0) << (p % w))
	}
	if ^v != 0 {
		return i*w | bits.TrailingZeros(^v)
	}
	for i++; ; i++ {
		if ^b[i] != 0 {
			return i*w | bits.TrailingZeros(^b[i])
		}
	}
}

func next1(p int) int {
	i := p / w
	v := b[i] & (^uint(0) << (p % w))
	if v != 0 {
		return i*w | bits.TrailingZeros(v)
	}
	for i++; ; i++ {
		if b[i] != 0 {
			return i*w | bits.TrailingZeros(b[i])
		}
	}
}

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

	var n, q, i, v int
	Fscan(in, &n, &q)
	a := make([]int, n+1)
	for i := 1; i <= n; i++ {
		Fscan(in, &a[i])
		flip(a[i], next0(a[i]))
	}
	for ; q > 0; q-- {
		Fscan(in, &i, &v)
		flip(a[i], next1(a[i]))
		a[i] = v
		flip(v, next0(v))
		for i := len(b) - 1; i >= 0; i-- {
			if b[i] != 0 {
				Fprintln(out, i*w|bits.Len(b[i])-1)
				break
			}
		}
	}
}

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

package main

import (
	"bufio"
	. "fmt"
	"io"
	"math/bits"
	"os"
)

// github.com/EndlessCheng/codeforces-go
const w = bits.UintSize

var b [6253]uint

func flip(l, r int) {
	r++
	maskL, maskR := ^uint(0)<<(l%w), ^uint(0)<<(r%w)
	i := l / w
	if i == r/w {
		b[i] ^= maskL ^ maskR
		return
	}
	b[i] ^= maskL
	for i++; i < r/w; i++ {
		b[i] = ^b[i]
	}
	b[i] ^= maskR
}

func next0(p int) int {
	i := p / w
	v := b[i]
	if p%w > 0 {
		v |= ^(^uint(0) << (p % w))
	}
	if ^v != 0 {
		return i*w | bits.TrailingZeros(^v)
	}
	for i++; ; i++ {
		if ^b[i] != 0 {
			return i*w | bits.TrailingZeros(^b[i])
		}
	}
}

func next1(p int) int {
	i := p / w
	v := b[i] & (^uint(0) << (p % w))
	if v != 0 {
		return i*w | bits.TrailingZeros(v)
	}
	for i++; ; i++ {
		if b[i] != 0 {
			return i*w | bits.TrailingZeros(b[i])
		}
	}
}

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

	var n, q, i, v int
	Fscan(in, &n, &q)
	a := make([]int, n+1)
	for i := 1; i <= n; i++ {
		Fscan(in, &a[i])
		flip(a[i], next0(a[i]))
	}
	for ; q > 0; q-- {
		Fscan(in, &i, &v)
		flip(a[i], next1(a[i]))
		a[i] = v
		flip(v, next0(v))
		for i := len(b) - 1; i >= 0; i-- {
			if b[i] != 0 {
				Fprintln(out, i*w|bits.Len(b[i])-1)
				break
			}
		}
	}
}

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


package main

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

// github.com/EndlessCheng/codeforces-go
func CF1491B(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	abs := func(x int) int {
		if x < 0 {
			return -x
		}
		return x
	}
	min := func(a, b int) int {
		if a < b {
			return a
		}
		return b
	}
	var T, n, ud, lr int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n, &ud, &lr)
		a := make([]int, n)
		d := 0
		for i := range a {
			if Fscan(in, &a[i]); i > 0 && abs(a[i]-a[i-1]) > d {
				d = abs(a[i] - a[i-1])
			}
		}
		if d > 1 {
			Fprintln(out, 0)
		} else if d == 1 {
			Fprintln(out, min(ud, lr))
		} else {
			Fprintln(out, lr+min(ud, lr))
		}
	}
}

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

package main

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

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

func solve() {
	n, u, v := getI(), getI(), getI()
	a := getInts(n)

	var res int64
	for i := int64(1); i < n; i++ {
		cur := abs(a[i] - a[i-1])
		if cur > res {
			res = cur
		}
	}

	if res > 1 {
		out(0)
	} else if res == 1 {
		out(min(u, v))
	} else {
		out(v + min(u, v))
	}
}

func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 4096), 1e9)
	// this template is new version.
	// use getI(), getS(), getInts(), getF()
	for i := getI(); i > 0; i-- {
		solve()
	}
	out()
}

// !------- HELPERS -------!

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

func printf(f string, a ...interface{}) {
	fmt.Fprintf(wr, f, a...)
}

func getI() int64 {
	s := getS()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func getF() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int64) []int64 {
	ret := make([]int64, N)
	for i := range ret {
		ret[i] = getI()
	}
	return ret
}

func getS() string {
	if !sc.Scan() {
		panic(sc.Err())
	}
	return sc.Text()
}

func nsort(data ...int64) {
	sort.Slice(data, func(i, j int) bool { return data[i] < data[j] })
}

func nsum(data ...int64) int64 {
	var res int64
	for _, n := range data {
		res += n
	}
	return res
}

func njoin(s ...int64) string {
	return strings.Trim(fmt.Sprintf("%v", s), "[]")
}

func forEach(n int64, fn func(int64)) {
	for i := int64(0); i < n; i++ {
		fn(i)
	}
}

// min, max, asub, abs
func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

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

// min for n entry
func nmin(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = min(ret, e)
	}
	return ret
}

// max for n entry
func nmax(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = max(ret, e)
	}
	return ret
}

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

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

func lowerBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

package main

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

func main() {
	var tcs int
	in := bufio.NewReader(os.Stdin)
	_, _ = fmt.Fscan(in, &tcs)

	for tc := 0; tc < tcs; tc++ {
		var n int
		var u, v int64
		_, _ = fmt.Fscan(in, &n, &u, &v)

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

		firstCheck := true
		for i := 1; i < n; i++ {
			if a[i-1] != a[i] {
				firstCheck = false
			}
		}

		ans := int64(0)

		if firstCheck {
			ans = v
			if v < u {
				ans += v
			} else {
				ans += u
			}
		} else {
			secondCheck := true
			for i := 1; i < n; i++ {
				if !(((a[i] - a[i-1]) <= 1) && ((a[i] - a[i-1]) >= -1)) {
					secondCheck = false
				}
			}
			if secondCheck {
				if v < u {
					ans += v
				} else {
					ans += u
				}
			}
		}
		fmt.Println(ans)
	}
}

package main

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

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

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 4096), 1e9)
}

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

func sint64() int64 {
	s := sstring()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func sint64s(n int64) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = sint64()
	}
	return a
}

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

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		u := sint64()
		v := sint64()
		a := sint64s(n)
		printf("%d\n", sol(n, u, v, a))
	}
}

func sol(n, u, v int64, a []int64) int64 {
	d := maxDelta(a)
	if d == 0 {
		return min(v+v, u+v)
	}
	if d == 1 {
		return min(u, v)
	}
	if d > 1 {
		return 0
	}
	panic("unexpected count")
}

func maxDelta(a []int64) int64 {
	maxD := int64(0)
	for i := range a {
		if i == 0 {
			continue
		}
		maxD = max(maxD, abs(a[i]-a[i-1]))
	}
	return maxD
}

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

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

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

package main

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

func min(a int, rest ...int) int {
	for _, v := range rest {
		if v < a {
			a = v
		}
	}
	return a
}

func abs(n int) int {
	if n < 0 {
		return n * -1
	}
	return n
}

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

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

		tot := math.MaxInt32
		for i := 1; i < n; i++ {
			d := abs(aa[i] - aa[i-1])
			if d >= 2 {
				tot = 0
				break
			} else if d == 1 {
				tot = min(tot, u, v)
			} else {
				tot = min(tot, v+min(u, v))
			}
		}

		fmt.Fprintln(out, tot)
	}
}

package main
import "fmt"
func main() {
	const Inf int = int(^uint(0)  >> 1)
	var tc int
	fmt.Scanln(&tc)
	for t:=0;t < tc;t++ {
		var n int
		var u int
		var v int
		var arr []int
		var minCost int
		minCost = Inf
		fmt.Scanln(&n, &u, &v)
		arr = make([]int,n)
		for i:=0;i < n;i++ {
			if i==n-1{
				fmt.Scanln(&arr[i])
			} else {
				fmt.Scan(&arr[i])
			}
		}
		for i:=1;i < n;i++{
			if abs(arr[i]-arr[i-1]) >= 2 {
				minCost = 0
			} else if abs(arr[i]-arr[i-1]) == 1 {
				minCost = min(minCost, min(u,v))
			} else if arr[i]==arr[i-1] {
				minCost = min(minCost, v+min(u,v))
			}

		}
		fmt.Println(minCost)
	}
}
func min (a int, b int) int {
	if a <= b {
		return a
	} else {
		return b
	}
}
func abs(a int) int {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

package main

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

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

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

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

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

		}
		return initial
	}
}

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

}

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

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

		// STRING := make([]byte, 0)
		// fmt.Fscan(input, &STRING)
		ARRAY := make([]int, n+1)

		for i := 1; i < n+1; i++ {
			fmt.Fscan(input, &ARRAY[i])
		}

		tru := 0
		trumax := 0
		for i := 1; i < n; i++ {
			m := MAX(ARRAY[i], ARRAY[i+1]) - MIN(ARRAY[i], ARRAY[i+1])
			if m > 1 {
				trumax = 1
			} else {
				if m == 1 {
					tru = 1
				}
			}

		}

		if trumax == 1 {
			fmt.Println(0)
		} else {
			if tru == 1 {
				fmt.Println(MIN(v, u))
			} else {
				fmt.Println(int64(MIN(v, u)) + int64(v))
			}
		}

	}
}

package main

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

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

func solve() {
	n, u, v := getI(), getI(), getI()
	a := getInts(n)
	movesU := u * 2
	movesV := v * 2
	movesUV := u*2 + v*2
	for i := int64(0); i < n-1; i++ {
		if a[i] != a[i+1] {
			movesU = 1
			if i-2 >= 0 || i+2 < n {
				movesV = 1
			}
		} else {
			if i-2 >= 0 || i+2 < n {
				movesV = min(movesV, 2)
			}
			movesUV = min(movesUV, 1)
		}
	}

	res := nmin(movesU*u, movesV*v, movesUV*u+movesUV*v)
	out(res)
}

func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 4096), 1e9)
	// this template is new version.
	// use getI(), getS(), getInts(), getF()
	for i := getI(); i > 0; i-- {
		solve()
	}
	out()
}

// !------- HELPERS -------!

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

func printf(f string, a ...interface{}) {
	fmt.Fprintf(wr, f, a...)
}

func getI() int64 {
	s := getS()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func getF() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int64) []int64 {
	ret := make([]int64, N)
	for i := range ret {
		ret[i] = getI()
	}
	return ret
}

func getS() string {
	if !sc.Scan() {
		panic(sc.Err())
	}
	return sc.Text()
}

func nsort(data ...int64) {
	sort.Slice(data, func(i, j int) bool { return data[i] < data[j] })
}

func nsum(data ...int64) int64 {
	var res int64
	for _, n := range data {
		res += n
	}
	return res
}

func njoin(s ...int64) string {
	return strings.Trim(fmt.Sprintf("%v", s), "[]")
}

func forEach(n int64, fn func(int64)) {
	for i := int64(0); i < n; i++ {
		fn(i)
	}
}

// min, max, asub, abs
func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

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

// min for n entry
func nmin(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = min(ret, e)
	}
	return ret
}

// max for n entry
func nmax(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = max(ret, e)
	}
	return ret
}

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

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

func lowerBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

package main

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

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

func solve() {
	n, u, v := getI(), getI(), getI()
	a := getInts(n)
	movesU := u * 2
	movesV := v * 2
	movesUV := u*2 + v*2
	for i := int64(0); i < n-1; i++ {
		if a[i] != a[i+1] {
			movesU = 1
			movesV = 1
			break
		} else {
			if i-2 >= 0 || i+2 < n {
				movesV = min(movesV, 2)
			}
			movesUV = min(movesUV, 1)
		}
	}

	res := nmin(movesU*u, movesV*v, movesUV*u+movesUV*v)
	out(res)
}

func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 4096), 1e9)
	// this template is new version.
	// use getI(), getS(), getInts(), getF()
	for i := getI(); i > 0; i-- {
		solve()
	}
	out()
}

// !------- HELPERS -------!

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

func printf(f string, a ...interface{}) {
	fmt.Fprintf(wr, f, a...)
}

func getI() int64 {
	s := getS()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func getF() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int64) []int64 {
	ret := make([]int64, N)
	for i := range ret {
		ret[i] = getI()
	}
	return ret
}

func getS() string {
	if !sc.Scan() {
		panic(sc.Err())
	}
	return sc.Text()
}

func nsort(data ...int64) {
	sort.Slice(data, func(i, j int) bool { return data[i] < data[j] })
}

func nsum(data ...int64) int64 {
	var res int64
	for _, n := range data {
		res += n
	}
	return res
}

func njoin(s ...int64) string {
	return strings.Trim(fmt.Sprintf("%v", s), "[]")
}

func forEach(n int64, fn func(int64)) {
	for i := int64(0); i < n; i++ {
		fn(i)
	}
}

// min, max, asub, abs
func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

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

// min for n entry
func nmin(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = min(ret, e)
	}
	return ret
}

// max for n entry
func nmax(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = max(ret, e)
	}
	return ret
}

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

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

func lowerBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

package main

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

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

func solve() {
	n, u, v := getI(), getI(), getI()
	a := getInts(n)
	movesU := u * 2
	movesV := v * 2
	movesUV := u*2 + v*2
	for i := int64(0); i < n-1; i++ {
		if a[i] != a[i+1] {
			movesU = 1
			movesV = 1
			break
		} else {
			if i+2 < n && a[i+2] != a[i+1] {
				movesU = 1
			} else {
				movesV = min(movesU, 2)
				movesUV = min(movesUV, 1)
			}
		}
	}

	res := nmin(movesU*u, movesV*v, movesUV*u+movesUV*v)
	out(res)
}

func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 4096), 1e9)
	// this template is new version.
	// use getI(), getS(), getInts(), getF()
	for i := getI(); i > 0; i-- {
		solve()
	}
	out()
}

// !------- HELPERS -------!

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

func printf(f string, a ...interface{}) {
	fmt.Fprintf(wr, f, a...)
}

func getI() int64 {
	s := getS()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func getF() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int64) []int64 {
	ret := make([]int64, N)
	for i := range ret {
		ret[i] = getI()
	}
	return ret
}

func getS() string {
	if !sc.Scan() {
		panic(sc.Err())
	}
	return sc.Text()
}

func nsort(data ...int64) {
	sort.Slice(data, func(i, j int) bool { return data[i] < data[j] })
}

func nsum(data ...int64) int64 {
	var res int64
	for _, n := range data {
		res += n
	}
	return res
}

func njoin(s ...int64) string {
	return strings.Trim(fmt.Sprintf("%v", s), "[]")
}

func forEach(n int64, fn func(int64)) {
	for i := int64(0); i < n; i++ {
		fn(i)
	}
}

// min, max, asub, abs
func max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

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

// min for n entry
func nmin(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = min(ret, e)
	}
	return ret
}

// max for n entry
func nmax(a ...int64) int64 {
	ret := a[0]
	for _, e := range a {
		ret = max(ret, e)
	}
	return ret
}

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

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

func lowerBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int64, x int64) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

package main

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

func main() {
	var tcs int
	in := bufio.NewReader(os.Stdin)
	_, _ = fmt.Fscan(in, &tcs)

	for tc := 0; tc < tcs; tc++ {
		var n int
		var u, v int64
		_, _ = fmt.Fscan(in, &n, &u, &v)

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

		firstCheck := true
		for i := 1; i < n; i++ {
			if a[i-1] != a[i] {
				firstCheck = false
			}
		}

		ans := int64(0)

		if firstCheck {
			ans = v
			if v < u {
				ans += v
			} else {
				ans += u
			}
		} else {
			for i := 1; i < n; i++ {
				if ((a[i] - a[i-1]) <= 1) && ((a[i] - a[i-1]) >= -1) {
					if v < u {
						ans += v
					} else {
						ans += u
					}
				}
			}
		}

		fmt.Println(ans)
	}
}

package main

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

// github.com/EndlessCheng/codeforces-go
func CF1491B(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	abs := func(x int) int {
		if x < 0 {
			return -x
		}
		return x
	}
	min := func(a, b int) int {
		if a < b {
			return a
		}
		return b
	}

	var T, n, ud, lr int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n, &ud, &lr)
		a := make([]int, n)
		d := 2
		for i := range a {
			if Fscan(in, &a[i]); i > 0 {
				d = min(d, abs(a[i]-a[i-1]))
			}
		}
		if d > 1 {
			Fprintln(out, 0)
		} else if d == 1 {
			Fprintln(out, min(ud, lr))
		} else {
			Fprintln(out, lr+min(ud, lr))
		}
	}
}

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

package main

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

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

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 4096), 1e9)
}

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

func sint64() int64 {
	s := sstring()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func sint64s(n int64) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = sint64()
	}
	return a
}

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

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		u := sint64()
		v := sint64()
		a := sint64s(n)
		printf("%d\n", sol(n, u, v, a))
	}
}

func sol(n, u, v int64, a []int64) int64 {
	c := count(a)
	if c == 1 {
		return min(v+v, u+v)
	}
	if count(a) > 2 {
		return 0
	}
	return min(u, v)
}

func count(a []int64) int64 {
	set := map[int64]bool{}
	for i := range a {
		set[a[i]] = true
	}
	return int64(len(set))
}

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

package main

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

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

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 4096), 1e9)
}

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

func sint64() int64 {
	s := sstring()
	i := int64(0)
	if s[0] == '-' {
		for _, r := range s[1:] {
			i *= 10
			i -= int64(r - '0')
		}
		return i
	}
	for _, r := range s {
		i *= 10
		i += int64(r - '0')
	}
	return i
}

func sint64s(n int64) []int64 {
	a := make([]int64, n)
	for i := range a {
		a[i] = sint64()
	}
	return a
}

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

func main() {
	defer writer.Flush()
	for t := sint64(); t > 0; t-- {
		n := sint64()
		u := sint64()
		v := sint64()
		a := sint64s(n)
		printf("%d\n", sol(n, u, v, a))
	}
}

func sol(n, u, v int64, a []int64) int64 {
	if allSame(a) {
		return min(v+v, u+v)
	}
	return min(u, v)
}

func allSame(a []int64) bool {
	tmp := a[0]
	for _, i := range a {
		if i != tmp {
			return false
		}
	}
	return true
}

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


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

    var n, a, b int
    fmt.Fscan(r, &n)
    for i := 0; i < n; i++ {
        fmt.Fscan(r, &a, &b)
        fmt.Fprintln(w, a + b)
    }
}

 package main

 import (
         "fmt"
 )

 func main() {

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

        }
 }

// Problem statement can be found in
// https://codeforces.com/problemset/problem/1351/A

package main

import "fmt"

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

		fmt.Println(a+b)
	}
}

package main

import "fmt"

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

}

// https://codeforces.com/contest/1348/problem/A
package main

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

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input io.Reader

func main() {
	var (
		T int
	)

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &T)
	for i := 0; i < T; i++ {
		solver()
	}
}

func solver() {
	var a, b int
	fmt.Fscan(input, &a, &b)

	fmt.Println(a + b)
}

package main
import ."fmt"
//github.com/EndlessCheng/codeforces-go
func main(){var t,a,b int;for Scan(&t);t>0;t--{Scan(&a,&b);Println(a+b)}}

package main

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

func main() {
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			os.Stdin.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		neg := false
		for ; '0' > b || b > '9'; b = rc() {
			if b == '-' {
				neg = true
			}
		}
		for ; '0' <= b && b <= '9'; b = rc() {
			x = x*10 + int(b&15)
		}
		if neg {
			return -x
		}
		return
	}
	for t := r(); t > 0; t-- {
		Fprintln(out, r()+r())
	}
}

package main

import (
    "fmt"
)

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

package main
import "fmt"

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

package main

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

var (
	input  io.Reader
	output io.Writer
)

func init() {
	input, output = os.Stdin, os.Stdout
}

func main() {
	var no int
	fmt.Fscan(input, &no)

	for i := 0; i < no; i++ {
		var a, b int
		fmt.Fscan(input, &a, &b)

		fmt.Fprintln(output, solution(a, b))
	}
}

func solution(a, b int) int {
	return a + b
}

package main

import (
	"fmt"
)

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

	for i := 0; i < tcs; i++ {
		var a int
		fmt.Scan(&a)

		var b int
		fmt.Scan(&b)

		fmt.Println(solution(a, b))
	}
}

func solution(a, b int) int {
	return a + b
}

package main

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

func main() {
	var truncator string
	if runtime.GOOS == "windows" {
		truncator = "\r\n"
	} else {
		truncator = "\n"
	}

	reader := bufio.NewReader(os.Stdin)
	text, _ := reader.ReadString('\n')
	text = strings.TrimSuffix(text, truncator)
	testcase, _ := strconv.ParseInt(text, 10, 64)

	var i int64
	for i = 0; i < testcase; i++ {
		input := readInt(2, reader)
		fmt.Println(input[0] + input[1])
	}
}

func readInt(size int, reader *bufio.Reader) []int64 {
	text, _ := reader.ReadString('\n')
	split := strings.Fields(text)
	result := make([]int64, len(split))
	for i := range result {
		result[i], _ = strconv.ParseInt(split[i], 10, 64)
	}
	return result
}

package main
import "fmt"
func main(){
    var n int
    fmt.Scan(&n)
    for i := 0; i < n; i++ {
        var a, b int
        fmt.Scan(&a, &b)
        fmt.Println(a + b)

    }
}

package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 0
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}

	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	t := getNextInt(scanner)
	for i := 0; i < t; i++ {
		a := getNextInt(scanner)
		b := getNextInt(scanner)
		fmt.Fprintln(writer, a+b)
	}
}

// Problem statement can be found in
// https://codeforces.com/problemset/problem/1351/A

package main

import "fmt"

func main() {
	var t int

	for i:=0; i < t ; i++ {
		var a, b int
		fmt.Scan(&a, &b)

		fmt.Println(a+b)
	}
}

package main

import "fmt"

func add(x int, y int) int {
	return x + y
}

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

}

package main

import (
	"fmt"
)

func main() {
	var tcs int
	fmt.Scanf("%d", &tcs)

	for i := 0; i < tcs; i++ {
		var a, b int
		fmt.Scanf("%d %d", &a, &b)
		fmt.Println(solution(a, b))
	}
}

func solution(a, b int) int {
	return a + b
}


package main

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

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

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

func redirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

func main() {
	// defer writer.Flush()
	// redirectInputToFile(reader, "input.txt")

	T := 1
	scan(&T)
	for t := 0; t < T; t++ {
		solve()
	}
}

func solve() {
	var n int
	scan(&n)

	var (
		cnt  = 0
		used = make([]bool, n+1)
		p    = make([]int, n+1)
	)
	for i := 1; i <= n; i++ {
		if used[i] {
			continue
		}
		s := make([]int, 0)
		for {
			x := req(i)
			cnt++
			if len(s) == 0 || x != s[0] {
				s = append(s, x)
			} else {
				break
			}
		}
		j := (len(s) - (cnt % len(s))) % len(s)
		for range s {
			// printf("@@@ MY J: %v\n", j)
			// writer.Flush()
			if j == len(s)-1 {
				p[s[j]] = s[0]
			} else {
				p[s[j]] = s[j+1]
			}
			j = (j + 1) % len(s)
		}
		for _, e := range s {
			used[e] = true
		}
	}
	printf("! ")
	for i := 1; i <= n; i++ {
		printf("%v ", p[i])
	}
	printf("\n")
	writer.Flush()
}

func req(i int) (x int) {
	printf("? %v\n", i)
	writer.Flush()
	scan(&x)
	return
}

package main

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

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

	ask := func(x int) int {
		fmt.Printf("? %d\n", x+1)
		return readNum(reader) - 1
	}

	for tc > 0 {
		tc--
		n := readNum(reader)
		res := solve(n, ask)
		var buf bytes.Buffer
		buf.WriteString("!")
		for i := 0; i < n; i++ {
			buf.WriteString(fmt.Sprintf(" %d", res[i]))
		}
		buf.WriteByte('\n')
		fmt.Print(buf.String())
	}
}

func normalize(s string) string {

	for i := len(s); i > 0; i-- {
		if s[i-1] >= 'a' && s[i-1] <= 'z' {
			return s[:i]
		}
	}
	return ""
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(n int, ask func(int) int) []int {
	P := make([]int, n)
	for i := 0; i < n; i++ {
		P[i] = -1
	}
	for i := 0; i < n; i++ {
		if P[i] < 0 {
			var cycle []int
			ans := ask(i)
			x := ask(i)
			cycle = append(cycle, x)
			for x != ans {
				x = ask(i)
				cycle = append(cycle, x)
			}
			for j := 0; j < len(cycle); j++ {
				P[cycle[j]] = cycle[(j+1)%len(cycle)] + 1
			}
		}
	}
	return P
}

package main

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

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

func main() {
	defer out.Flush()

	var tc int
	fmt.Fscan(in, &tc)
	for ; tc > 0; tc-- {
		var n int
		fmt.Fscan(in, &n)

		fmt.Fprintln(out, "? 1")
		out.Flush()
		var k int
		fmt.Fscan(in, &k)

		ring := make([]int, 0, n)
		seen := make([]bool, n+1)
		perm := make([]int, n+1)
		pos := 1
		rots := 0

		ring = append(ring, 1)
		seen[1] = true

		for pos <= n {
			rots++
			fmt.Fprintln(out, "?", pos)
			out.Flush()
			fmt.Fscan(in, &k)
			if !seen[k] {
				seen[k] = true
				ring = append(ring, k)
				continue
			}
			i := (len(ring) - 1 + (rots-2)*(len(ring)-1)) % len(ring)
			for j := 0; j < len(ring); j++ {
				perm[pos] = ring[i]
				pos = ring[i]
				i = (i + 1) % len(ring)
			}
			ring = ring[0:0]
			for pos = 2; pos <= n && perm[pos] != 0; pos++ {
			}
		}
		out.WriteString("!")
		for _, p := range perm[1:] {
			fmt.Fprintf(out, " %d", p)
		}
		out.WriteString("\n")
		out.Flush()
	}
}

package main

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

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

func main() {
	defer out.Flush()

	var tc int
	fmt.Fscan(in, &tc)
	for ; tc > 0; tc-- {
		var n int
		fmt.Fscan(in, &n)

		fmt.Fprintln(out, "? 1")
		out.Flush()
		var k int
		fmt.Fscan(in, &k)

		ring := make([]int, 0, n)
		seen := make([]bool, n+1)
		perm := make([]int, n+1)
		pos := 1
		rots := 0

		for pos <= n {
			rots++
			fmt.Fprintln(out, "?", pos)
			out.Flush()
			fmt.Fscan(in, &k)
			if !seen[k] {
				seen[k] = true
				ring = append(ring, k)
				continue
			}
			i := (len(ring) - 1 + (rots-2)*(len(ring)-1)) % len(ring)
			for j := 0; j < len(ring); j++ {
				perm[pos] = ring[i]
				pos = ring[i]
				i = (i + 1) % len(ring)
			}
			ring = ring[0:0]
			for pos = 2; pos <= n && perm[pos] != 0; pos++ {
			}
		}
		out.WriteString("!")
		for _, p := range perm[1:] {
			fmt.Fprintf(out, " %d", p)
		}
		out.WriteString("\n")
		out.Flush()
	}
}

package main

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

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

func main() {
	defer out.Flush()

	var tc int
	fmt.Fscan(in, &tc)
	for ; tc > 0; tc-- {
		var n int
		fmt.Fscan(in, &n)

		fmt.Fprintln(out, "? 1")
		out.Flush()
		var k int
		fmt.Fscan(in, &k)

		ring := make([]int, 0, n)
		seen := make([]bool, n+1)
		perm := make([]int, n+1)
		pos := 1
		rots := 0

		for pos <= n {
			rots++
			fmt.Fprintln(out, "?", pos)
			out.Flush()
			fmt.Fscan(in, &k)
			if !seen[k] {
				seen[k] = true
				ring = append(ring, k)
				continue
			}
			i := (len(ring) - 1 + (rots-2)*(len(ring)-1)) % len(ring)
			for j := 0; j < len(ring); j++ {
				perm[pos] = ring[i]
				pos = ring[i]
				i = (i + 1) % len(ring)
			}
			ring = ring[0:0]
			for pos = 2; pos <= n && perm[pos] != 0; pos++ {
			}
		}
		fmt.Fprintln(out, "!", perm[1:])
		out.Flush()
	}
}

package main

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

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

	ask := func(x int) int {
		fmt.Printf("? %d\n", x+1)
		return readNum(reader) - 1
	}

	for tc > 0 {
		tc--
		n := readNum(reader)
		res := solve(n, ask)
		var buf bytes.Buffer
		buf.WriteString("!")
		for i := 0; i < n; i++ {
			buf.WriteString(fmt.Sprintf(" %d", res[i]))
		}
		buf.WriteByte('\n')
		fmt.Print(buf.String())
	}
}

func normalize(s string) string {

	for i := len(s); i > 0; i-- {
		if s[i-1] >= 'a' && s[i-1] <= 'z' {
			return s[:i]
		}
	}
	return ""
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(n int, ask func(int) int) []int {
	P := make([]int, n)
	for i := 0; i < n; i++ {
		P[i] = -1
	}
	for i := 0; i < n; i++ {
		if P[i] < 0 {
			var cycle []int
			ans := ask(i)
			x := ask(i)
			cycle = append(cycle, x)
			for x != ans {
				x = ask(i)
				cycle = append(cycle, x)
			}
			for j := 0; j < len(cycle); j++ {
				P[cycle[j]] = cycle[(j+1)%len(cycle)]
			}
		}
	}
	return P
}


package main

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

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

func main () {
	in := bufio.NewReader(os.Stdin);
	out := bufio.NewWriter(os.Stdout);
	var n int;
	var s string;

	fmt.Fscanln(in, &n);
	fmt.Fscanln(in, &s);
	var maxs [26]int;
	d := make([]int, n);
	ans := 0;
	for i := 0; i < n; i++ {
		for j := s[i] + 1; j <= 'z'; j++ {
			d[i] = Max(d[i], maxs[j - 'a'] + 1);
		}
		if (d[i] == 0) {
			d[i] = 1;
		}
		if (d[i] > ans) {
			ans = d[i];
		}
		maxs[s[i] - 'a'] = Max(maxs[s[i] - 'a'], d[i]);
	}
	fmt.Fprintln(out, ans);
	for _, x := range d {
		fmt.Fprint(out, x, " ");
	}
	out.Flush();
}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var n int
	var s string
	fmt.Scanf("%d\n%s\n", &n, &s)

	l := make([]int, 26)
	cols := make([]int, 0, n)
	req := 0
	for _, c := range s {
		m := 0
		for i := int(c-'a') + 1; i < 26; i++ {
			m = max(m, l[i])
		}
		cols = append(cols, m+1)
		l[int(c-'a')] = m + 1
		req = max(req, m+1)
	}

	fmt.Println(req)

	t := new(strings.Builder)
	for _, c := range cols {
		fmt.Fprintf(t, "%d ", c)
	}
	fmt.Println(t.String())
}

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

package main

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

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

func main () {
	in := bufio.NewReader(os.Stdin);
	out := bufio.NewWriter(os.Stdout);
	var n int;
	var s string;

	fmt.Fscanln(in, &n);
	fmt.Fscanln(in, &s);
	var maxs [26]int;
	d := make([]int, n);
	ans := 0;
	for i := 0; i < n; i++ {

		for j := s[i] + 1; j <= 'z'; j++ {
			d[i] = Max(d[i], maxs[j - 'a'] + 1);
		}
		if (d[i] > ans) {
			ans = d[i];
		}
		maxs[s[i] - 'a'] = Max(maxs[s[i] - 'a'], d[i]);
	}
	fmt.Fprintln(out, ans);
	for _, x := range d {
		fmt.Fprint(out, x, " ");
	}
	out.Flush();
}

package main

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

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

func main () {
	in := bufio.NewReader(os.Stdin);
	out := bufio.NewWriter(os.Stdout);
	var n int;
	var s string;

	fmt.Fscanln(in, &n);
	fmt.Fscanln(in, &s);
	var maxs [26]int;
	d := make([]int, n);
	ans := 0;
	for i := 0; i < n; i++ {

		for j := s[i]; j <= 'z'; j++ {
			d[i] = Max(d[i], maxs[j - 'a'] + 1);
		}
		if (d[i] > ans) {
			ans = d[i];
		}
		maxs[s[i] - 'a'] = Max(maxs[s[i] - 'a'], d[i]);
	}
	for _, x := range d {
		fmt.Fprint(out, x, " ");
	}
	out.Flush();
}

package main

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

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

func main () {
	in := bufio.NewReader(os.Stdin);
	out := bufio.NewWriter(os.Stdout);
	var n int;
	var s string;

	fmt.Fscanln(in, &n);
	fmt.Fscanln(in, &s);
	var maxs [26]int;
	d := make([]int, n);
	ans := 0;
	for i := 0; i < n; i++ {

		for j := s[i]; j <= 'z'; j++ {
			d[i] = Max(d[i], maxs[j - 'a'] + 1);
		}
		if (d[i] > ans) {
			ans = d[i];
		}
		maxs[s[i] - 'a'] = Max(maxs[s[i] - 'a'], d[i]);
	}
	fmt.Fprintln(out, ans);
	for _, x := range d {
		fmt.Fprint(out, x, " ");
	}
	out.Flush();
}


package main

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

var a [5000]int32
var b [5000]bool
var reader SReader

func main() {
	reader.Init()
	n := reader.ReadInt()
	for i := int32(0); i < n; i++ {
		a[i] = reader.ReadInt()
		b[i] = true
	}

	a2 := Slice(a[:n])
	sort.Sort(a2)

	nLeft := n
	for x := int32(1); ; x++ {
		nSize := IntMax
		for i := n - 1; i >= 0; i-- {
			if !b[i] { continue }
			if a[i] >= nSize { continue }
			nSize = a[i]
			nLeft--
			b[i] = false
		}

		if nLeft == 0 {
			fmt.Println(x)
			break
		}
	}
}

const (
	IntMax = int32(^uint32(0) >> 1)
	IntMin = ^IntMax
)

// reader
type SReader struct {
	file *os.File
	scanner *bufio.Scanner
}

func (this *SReader) Init() {
	this.file = os.Stdin
	this.scanner = bufio.NewScanner(this.file)
	this.scanner.Split(bufio.ScanWords)
}

func (this *SReader) ReadInt() int32 {
	this.scanner.Scan()
	n, err:= strconv.ParseInt(this.scanner.Text(), 10, 32)
	if err != nil {
		panic(err)
	}
	return int32(n)
}

// sort
type Slice []int32

func (a Slice) Len() int {
	return len(a)
}

func (a Slice) Swap(i, j int) {
	a[i], a[j] = a[j], a[i]
}

func (a Slice) Less(i, j int) bool {
	return a[i] < a[j]
}

package main

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

var a [5000]int64
var b [5000]bool
var reader SReader

type Int int64
type Uint uint64

func main() {
	reader.Init()
	n := reader.ReadInt()
	for i := int64(0); i < n; i++ {
		a[i] = reader.ReadInt()
		b[i] = true
	}

	a2 := Slice(a[:n])
	sort.Sort(a2)

	nLeft := n
	for x := int64(1); ; x++ {
		nSize := IntMax
		for i := n - 1; i >= 0; i-- {
			if !b[i] { continue }
			if a[i] >= nSize { continue }
			nSize = a[i]
			nLeft--
			b[i] = false
		}

		if nLeft == 0 {
			fmt.Println(x)
			break
		}
	}
}

const (
	IntMax = int64(^uint64(0) >> 1)
	IntMin = ^IntMax
)

// reader
type SReader struct {
	file *os.File
	scanner *bufio.Scanner
}

func (this *SReader) Init() {
	this.file = os.Stdin
	this.scanner = bufio.NewScanner(this.file)
	this.scanner.Split(bufio.ScanWords)
}

func (this *SReader) ReadInt() int64 {
	this.scanner.Scan()
	n, err:= strconv.ParseInt(this.scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return n
}

// sort
type Slice []int64

func (a Slice) Len() int {
	return len(a)
}

func (a Slice) Swap(i, j int) {
	a[i], a[j] = a[j], a[i]
}

func (a Slice) Less(i, j int) bool {
	return a[i] < a[j]
}

package main

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

var a [5000]int32
var b [5000]bool
var reader SReader

func main() {
	reader.Init()
	n := reader.ReadInt()
	for i := int32(0); i < n; i++ {
		a[i] = reader.ReadInt()
		b[i] = true
	}

	a2 := Slice(a[:n])
	sort.Sort(a2)

	nLeft := n
	for x := int32(1); ; x++ {
		nSize := IntMax
		for i := n - 1; i >= 0; i-- {
			if !b[i] { continue }
			if a[i] >= nSize { continue }
			nSize = a[i]
			nLeft--
			b[i] = false
		}

		if nLeft == 0 {
			fmt.Println(x)
			break
		}
	}
}

const (
	IntMax = int32(^uint32(0) >> 1)
	IntMin = ^IntMax
)

// reader
type SReader struct {
	file *os.File
	scanner *bufio.Scanner
}

func (this *SReader) Init() {
	this.file = os.Stdin
	this.scanner = bufio.NewScanner(this.file)
	this.scanner.Split(bufio.ScanWords)
}

func (this *SReader) ReadInt() int32 {
	this.scanner.Scan()
	n, err:= strconv.ParseInt(this.scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return int32(n)
}

// sort
type Slice []int32

func (a Slice) Len() int {
	return len(a)
}

func (a Slice) Swap(i, j int) {
	a[i], a[j] = a[j], a[i]
}

func (a Slice) Less(i, j int) bool {
	return a[i] < a[j]
}

//  URL: http://codeforces.com/contest/903/problem/C
//  PROBLEM RESTATEMENT
//      Given boxes of width a[1], a[2] ... a[n], a[i] ∈ [1, 10^9].
//      Box a[i] can be placed in a[j] if a[j] > a[i] and contains no other
//      boxes.
//      What is the minimum number of piles of boxes that can be formed?
//  APPROACH
//      (1) Assume there are no duplicates. The answer is 1 -> take the
//          smallest box, place it in the next smallest, and so on.
//      (2) Assume there is one duplicate. We cannot add this duplicate to the
//          existing pile, so we create a new pile.
//      (3) By induction, the # of piles is equal to the maximally occurring
//          element.

package main

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

func main() {
	reader, writer := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var n, a int
	fmt.Fscanf(reader, "%d\n", &n)
	m := make(map[int]int)
	maxCount := 0
	for i := 0; i < n; i++ {
		fmt.Fscanf(reader, "%d ", &a)
		m[a] += 1
		if m[a] > maxCount {
			maxCount = m[a]
		}
	}
	fmt.Fprintf(writer, "%d\n", maxCount)
}

package main

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

func Init() {
}

func Solve(io *FastIO) {
	N := io.NextInt()

	freq := make(map[int]int)
	most := 0
	for i := 0; i < N; i++ {
		A := io.NextInt()

		freq[A]++
		most = Max(most, freq[A])
	}
	io.Println(most)
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

package main

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

func solve() {
	n := readInt()
	m := make(map[int]int)
	max := -1
	for i := 0; i < n; i++ {
		a := readInt()
		m[a] += 1
		if m[a] > max {
			max = m[a]
		}
	}
	fmt.Println(max)
}

var scanner *bufio.Scanner

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

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

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

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

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var ans, tmp int
	cnt := make(map[int]int, 5000)
	for ; n > 0; n-- {
		fmt.Scan(&tmp)
		cnt[tmp]++
		if cnt[tmp] > ans {
			ans = cnt[tmp]
		}
	}
	fmt.Println(ans)
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var ans, tmp int
	cnt := make(map[int]int, 5000)
	for ; n >= 0; n-- {
		fmt.Scan(&tmp)
		cnt[tmp]++
		if cnt[tmp] > ans {
			ans = cnt[tmp]
		}
	}
	fmt.Println(ans)
}

package main

import (
	"fmt"
)

func main() {
	var a, b, c int
	r := make(map[int]bool, 1e5)
	fmt.Scan(&a, &b, &c)
	for i := 1; ; i++ {
		if c == a*10/b {
			fmt.Println(i)
			return
		}
		a = a * 10 % b
		if !r[a] {
			r[a] = true
		} else {
			break
		}
	}
	fmt.Println(-1)
}