Manao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms: home uniform and guest uniform. When a team plays a game at home, the players put on the home uniform. When a team plays as a guest on somebody else's stadium, the players put on the guest uniform. The only exception to that rule is: when the home uniform color of the host team matches the guests' uniform, the host team puts on its guest uniform as well. For each team the color of the home and guest uniform is different.There are n teams taking part in the national championship. The championship consists of n·(n - 1) games: each team invites each other team to its stadium. At this point Manao wondered: how many times during the championship is a host team going to put on the guest uniform? Note that the order of the games does not affect this number.You know the colors of the home and guest uniform for each team. For simplicity, the colors are numbered by integers in such a way that no two distinct colors have the same number. Help Manao find the answer to his question.

NoteIn the first test case the championship consists of 6 games. The only game with the event in question is the game between teams 2 and 1 on the stadium of team 2.In the second test sample the host team will have to wear guest uniform in the games between teams: 1 and 2, 2 and 1, 2 and 3, 3 and 4, 4 and 2 (the host team is written first).

package main

import (
	"fmt"
)

func main() {
	var n, ans int
	fmt.Scan(&n)
	uni := make([][2]int, n)
	for i := range uni {
		fmt.Scan(&uni[i][0], &uni[i][1])
	}
	for home := range uni {
		for guest := range uni {
			if uni[home][0] == uni[guest][1] {
				ans++
			}
		}
	}
	fmt.Println(ans)
}

package main

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

func main() {
	var n, h, a int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &n)
	host := make(map[int]int, n)
	guest := make([]int, a)
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &h, &a)
		host[h] = host[h] + 1
		guest = append(guest, a)
	}
	ans := 0
	for _, v := range guest {
		ans += host[v]
	}
	fmt.Println(ans)
}

package main

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

func main() {
	var home = make(map[string]int)
	var host = make(map[string]int)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Scan()

	for scanner.Scan() {
		color := scanner.Text()
		if _, ok := home[color]; ok == false {
			home[color] = 1
		}else {
			home[color]++
		}
		scanner.Scan()

		color = scanner.Text()
		if _, ok := host[color]; ok == false {
			host[color] = 1
		}else {
			host[color]++
		}
	}
	var count = 0
	for key,value := range home {
		if v, ok := host[key]; ok != false {
			count += v * value
		}
	}

	fmt.Println(count)
}

package main

import(
    "fmt"
)

type teamColor struct{
    hC,gC string
}

func main(){
    var(
        n int
        res = 0
    )
    fmt.Scan(&n)
    arr := make([]teamColor,n)
    for i:=0;i<n;i++{
        fmt.Scan(&arr[i].hC,&arr[i].gC)
    }
    for i:=0;i<n;i++{
        for j:=0;j<n;j++{
            if i!=j{
                if arr[i].gC == arr[j].hC{
                    res++
                }
            }
        }
    }
    fmt.Println(res)
}

package main

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

func main() {
    defer s.Flush()

	n := s.Next()

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

	for i := 0; i < n; i++ {
		a[i], b[i] = s.Next(), s.Next()
	}

	c := 0
	for _, x := range b {
		for _, y := range a {
			if x == y {
				c++
			}
		}
	}
	s.Println(c)
}

var (
	s *InOut
)

func init() {
	s = NewInOut(os.Stdin, os.Stdout)
}

type InOut struct {
	*bufio.Reader
	*bufio.Writer
}

func NewInOut(r io.Reader, w io.Writer) *InOut {
	return &InOut{bufio.NewReader(r), bufio.NewWriter(w)}
}

// Get Next Integer
func (s *InOut) Next() (r int) {
	b, _ := s.ReadByte()
	p := 1
	for (b < '0' || '9' < b) && b != '-' {
		b, _ = s.ReadByte()
	}
	if b == '-' {
		p = -1
		b, _ = s.ReadByte()
	}
	for '0' <= b && b <= '9' {
		r = 10*r + int(b-'0')
		b, _ = s.ReadByte()
	}
	return r * p
}

func (s *InOut) NextInt64() (r int64) {
	b, _ := s.ReadByte()
	p := int64(1)
	for (b < '0' || '9' < b) && b != '-' {
		b, _ = s.ReadByte()
	}
	if b == '-' {
		p = -1
		b, _ = s.ReadByte()
	}
	for '0' <= b && b <= '9' {
		r = 10*r + int64(b-'0')
		b, _ = s.ReadByte()
	}
	return r * p
}

// Get Next Line String
func (s *InOut) NextLine() (r string) {
	b, _ := s.ReadByte()
	for b == '\n' {
		b, _ = s.ReadByte()
	}
	buf := make([]byte, 0)
	for ; b != '\n'; b, _ = s.ReadByte() {
		buf = append(buf, b)
	}
	return string(buf)
}

// Get Next String using delimiter whitespace
func (s *InOut) NextStr() (r string) {
    return string(s.NextBytes())
}

// Get Next String using delimiter whitespace
func (s *InOut) NextBytes() (r []byte) {
	b, _ := s.ReadByte()
	for b == '\n' || b == ' ' {
		b, _ = s.ReadByte()
	}
	buf := make([]byte, 0)
	for ; b != '\n' && b != ' '; b, _ = s.ReadByte() {
		buf = append(buf, b)
	}
	return buf
}

// Print Strings using the suitable way to change type
func (s *InOut) Print(os ...interface{}) {
	for _, o := range os {
		switch o.(type) {
		case byte:
			s.WriteByte(o.(byte))
		case string:
			s.WriteString(o.(string))
		case int:
			s.WriteString(strconv.Itoa(o.(int)))
		case int64:
			s.WriteString(strconv.FormatInt(o.(int64), 10))
		default:
			s.WriteString(fmt.Sprint(o))
		}
	}
}

// Print Strings using the suitable way to change type with new line
func (s *InOut) Println(os ...interface{}) {
	for _, o := range os {
		s.Print(o)
	}
	s.Print("\n")
}

// Print immediately with new line (for debug)
func (s *InOut) PrintlnNow(o interface{}) {
	fmt.Println(o)
}

package main

import "fmt"

func main() {
    var n int
    var h,a [35]int
    fmt.Scan(&n)
    for i := 0; i < n; i++ { fmt.Scan(&h[i],&a[i]) }
    ans := 0
    for i := 0; i < n; i++ {
        for j := 0; j < n; j++ {
            if (i != j) && (h[i] == a[j]) {
                ans++
            }
        }
    }
    fmt.Println(ans)
}

package main

import (
	"fmt"
)

func main() {
	result := 0
	var n, t1, t2 int
	var h, g []int
	fmt.Scanf("%d \n", &n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d %d \n", &t1, &t2)
		h = append(h, t1)
		g = append(g, t2)
		for j := i - 1; j >= 0; j-- {
			if h[i] == g[j] {
				result++
			}
			if h[j] == g[i] {
				result++
			}
		}
	}
	fmt.Print(result)
}

package main

import "fmt"

type Vertex struct {
	home, guest int
}

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

	arr := make([]Vertex, n)

	for i := 0; i < n; i++ {
		fmt.Scan(&arr[i].home, &arr[i].guest)
	}

	count := 0

	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			if arr[i].home == arr[j].guest {
				count++
			}
			if arr[j].home == arr[i].guest {
				count++
			}
		}
	}

	fmt.Println(count)
}

package main

import "fmt"

type team struct {
	homeUniform  int
	guestUniform int
}

func main() {
	var nTeams int
	fmt.Scanf("%d\n", &nTeams)
	teams := make([]team, nTeams)
	for i := 0; i < nTeams; i++ {
		fmt.Scanf("%d %d\n", &teams[i].homeUniform, &teams[i].guestUniform)
	}
	var count int
	for i := 0; i < nTeams; i++ {
		for j := 0; j < nTeams; j++ {
			if teams[i].homeUniform == teams[j].guestUniform {
				count += 1
			}
		}
	}
	// fmt.Println(teams)
	fmt.Println(count)
}

package main

import(
	"fmt"
)

func main() {
	n := 0
	fmt.Scanf("%d\n", &n)
	arr1 := []int{}
	arr2 := []int{}

	for i := 0; i < n; i++ {
		a := 0
		b := 0
		fmt.Scanf("%d %d\n", &a, &b)
		arr1 = append(arr1, a)
		arr2 = append(arr2, b)
	}

	cnt := 0

	for i := 0; i < n; i++ {
		val := arr1[i]
		for j := 0; j < n; j++ {
			if j != i && arr2[j] == val {
				cnt += 1
			}
		}
	}

	fmt.Println(cnt)
}

package main

import "fmt"

func main() {
	var n, count int
	fmt.Scan(&n)
	var home = make([]int, n)
	var away = make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scan(&home[i])
		fmt.Scan(&away[i])
	}

	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if (i != j) && (home[i] == away[j]) {
				count++
			}
		}
	}
	fmt.Println(count)
}

package main

import "fmt"

func main() {
	var n, count int
	fmt.Scan(&n)
	var home = make([]int, n)
	var away = make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scan(&home[i])
		fmt.Scan(&away[i])
	}

	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if home[i] == away[j] {
				count++
			}
		}
	}
	fmt.Println(count)
}

package main

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

func main() {
	var n, count int
	fmt.Scan(&n)
	var home = make([]int, n)
	var away = make([]int, n)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	for i := 0; i < n; i++ {
		// fmt.Scan(&home[i])
		// fmt.Scan(&away[i])
		scanner.Scan()
		home[i] = toInt(scanner.Bytes())

		scanner.Scan()
		away[i] = toInt(scanner.Bytes())

	}

	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if (i != j) && (home[i] == away[j]) {
				count++
			}
		}
	}
	fmt.Println(count)
}

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

package main

import (
	"fmt"
)

func main() {
	var n, count int
	fmt.Scan(&n)
	var home = make(map[int]int, n)
	var away = make(map[int]int, n)
	var h, a int

	for i := 0; i < n; i++ {
		fmt.Scan(&h)
		fmt.Scan(&a)
		if _, ok := home[h]; ok {
			home[h]++
		} else {
			home[h] = 1
		}
		if _, ok := away[a]; ok {
			away[a]++
		} else {
			away[a] = 1
		}
	}

	for i := 1; i <= 100; i++ {
		if _, ok := home[i]; ok {
			if _, ok := away[i]; ok {
				count += (home[i] * away[i])
			}
		}
	}
	fmt.Println(count)
}

package main

import "fmt"

func main() {
	var colors [][2]int
	var n int
	fmt.Scan(&n)

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

	cnt := 0
	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if i == j {
				continue
			}

			if colors[i][0] == colors[j][1] {
				cnt += 1
			}
		}
	}

	fmt.Print(cnt)
}

package main

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

var reader *bufio.Reader

func init() {
	stdin := os.Stdin
	// stdin, _ = os.Open("1.in")
	reader = bufio.NewReaderSize(stdin, 1<<20)
}

// Pair Pair
type Pair struct {
	First  int
	Second int
}

var n int
var a []Pair

func main() {
	fmt.Fscan(reader, &n)
	a = make([]Pair, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(reader, &a[i].First, &a[i].Second)
	}

	ans := 0
	for i := 0; i < n; i++ {
		for j := 0; j < n; j++ {
			if i == j {
				continue
			}
			if a[i].First == a[j].Second {
				ans++
			}
		}
	}
	fmt.Println(ans)
}

package main

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

type Team struct {
    main uint8
    second  uint8
}

func main() {
	in := bufio.NewReader(os.Stdin)
	var n uint8
	var c uint16
	var s []Team

	fmt.Fscanf(in, "%d\n", &n)
	for i:= uint8(0); i < n; i++{
		var t Team
		fmt.Fscanf(in, "%d %d\n", &t.main, &t.second)
		s = append(s, t)
	}
	for i:= uint8(0); i < n; i++{
		for j:= uint8(0); j < n; j++{
			if i != j{
				if s[i].main == s[j].second{
					c++
				}
			}
		}
	}
	fmt.Println(c)

}

package main
import "fmt"
func main() {
	var n,x,y int
	var h,a [110]int
	fmt.Scan(&n)
	for ;n>0;n-- {
		fmt.Scan(&x,&y)
		h[x]++; a[y]++
	}
	r:=0
	for i:=1;i<101;i++ {
		r += a[i]*h[i]
	}
	fmt.Print(r)
}

//  URL: http://codeforces.com/problemset/problem/268/A
//  ~ Basic Implementation Problem

package main

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

func solve(colors [][2]int) int {
	away := make(map[int]int)
	for _, val := range colors {
		away[val[1]] += 1
	}
	count := 0
	for _, val := range colors {
		count += away[val[0]]
	}
	return count
}

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

package main

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

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

type Game struct  {
	home int
	away int
}

func main() {

	var T int
	scanf("%d \n", &T)

	games := []Game{}
	for i:=0; i<T; i++ {
		var a, b int
		scanf("%d %d\n", &a, &b)
		game := Game{
			home: a,
			away: b,
		}
		games = append(games, game)

	}

	result := 0

	for i, _ := range games {
		for j:=i+1; j<len(games); j++ {
				a := games[i]
				b := games[j]

				if (a.home == b.away) {
					result++
				}

				//swap
				temp := a
				a = b
				b = temp

				if (a.home == b.away ) {
					result++
				}

		}
	}

	fmt.Println(result)

}

package main

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

func main() {
	var noOfTeams, currNumber, result int
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &noOfTeams)
	homeAway := make([][2]int, noOfTeams)
	for index := 0; index < noOfTeams; index++ {
		fmt.Fscan(reader, &currNumber)
		homeAway[index][0] = currNumber
		fmt.Fscan(reader, &currNumber)
		homeAway[index][1] = currNumber
	}
	for index := 0; index < noOfTeams; index++ {
		awayWear := homeAway[index][1]
		for innerIndex := 0; innerIndex < noOfTeams; innerIndex++ {
			if index == innerIndex {
				continue
			}
			if awayWear == homeAway[innerIndex][0] {
				result++
			}

		}
	}
	fmt.Println(result)
}

package main

import "fmt"

func main() {
	var t, a, b, summ int
	var arr [][2]int
	fmt.Scanf("%d\n", &t)
	for i := 0; i < t; i++ {
		fmt.Scanf("%d %d\n", &a, &b)
		arr = append(arr, [2]int{a, b})
	}
	for i := 0; i < t; i++ {
		for j := 0; j < t; j++ {
			if i == j {
				continue
			} else {
				if arr[j][0] == arr[i][1] {
					summ++
				}
			}
		}
	}
	fmt.Println(summ)
}

package main

import "fmt"

func main() {
	var n byte
	var res uint
	fmt.Scan(&n)
	var arr = make([][2]int, n)
	for i := range arr {
		fmt.Scan(&arr[i][0], &arr[i][1])
	}
	for i := byte(0); i < n; i++ {
		for j := byte(0); j < n; j++ {
			if (arr[i][0] == arr[j][1]) && (i != j) {
				res++
			}
		}
	}
	fmt.Println(res)
}

package main

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

// https://codeforces.com/problemset/problem/268/A
// A. Games
// time limit per test
// 1 second
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// Manao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms: home uniform and guest uniform. When a team plays a game at home, the players put on the home uniform. When a team plays as a guest on somebody else's stadium, the players put on the guest uniform. The only exception to that rule is: when the home uniform color of the host team matches the guests' uniform, the host team puts on its guest uniform as well. For each team the color of the home and guest uniform is different.

// There are n teams taking part in the national championship. The championship consists of n·(n - 1) games: each team invites each other team to its stadium. At this point Manao wondered: how many times during the championship is a host team going to put on the guest uniform? Note that the order of the games does not affect this number.

// You know the colors of the home and guest uniform for each team. For simplicity, the colors are numbered by integers in such a way that no two distinct colors have the same number. Help Manao find the answer to his question.
// Input

// The first line contains an integer n (2 ≤ n ≤ 30). Each of the following n lines contains a pair of distinct space-separated integers hi, ai (1 ≤ hi, ai ≤ 100) — the colors of the i-th team's home and guest uniforms, respectively.
// Output

// In a single line print the number of games where the host team is going to play in the guest uniform.

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

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

	homeUniforms := make([]int, n)
	awayUniforms := make([]int, n)

	for i := 0; i < n; i++ {
		var hi, ai int
		_, _ = fmt.Fscan(bufStdin, &hi, &ai)
		homeUniforms[i] = hi
		awayUniforms[i] = ai
	}

	var answer int
	for i, homeUniform := range homeUniforms {
		for j, awayUniform := range awayUniforms {
			if i != j && homeUniform == awayUniform {
				answer++
			}
		}
	}

	fmt.Print(answer)
}

package main

import "fmt"

const friends = 2

type form struct {
	home int
	out  int
}

// https://codeforces.com/problemset/problem/268/A
// комментарий к решению
// решаем перебором проходя по каждой паре с проверкой,
// что домашняя форма итерируемого в данный момент совпадает
// с формой на выезде для любой другой команды
func taskSolution(a []form) (ans int) {
	for _, h := range a {
		for _, o := range a {
			if h != o && h.home == o.out {
				ans += 1
			}
		}
	}
	return ans
}

func main() {
	var n int
	if _, err := fmt.Scan(&n); err != nil {
		panic(err)
	}

	a := []form{}
	for i := 0; i < n; i += 1 {
		var h, o int
		if _, err := fmt.Scan(&h, &o); err != nil {
			panic(err)
		}
		a = append(a, form{home: h, out: o})
	}

	fmt.Println(taskSolution(a))
}

package main

import "fmt"

func main ()  {
	var noOfTeams int
	fmt.Scan(&noOfTeams)
	var homeTeamsColors []int
	var guestTeamsColors []int
	var sum = 0
	for index := 0; index < noOfTeams*2; index++ {
		var hostColor int
		fmt.Scan(&hostColor)

		if index == 0 || index %2 == 0 {
			homeTeamsColors = append(homeTeamsColors, hostColor)
		} else {
			guestTeamsColors = append(guestTeamsColors, hostColor)
		}
	}
	for index := 0; index < len(homeTeamsColors); index++ {
		for i := 0; i < len(guestTeamsColors); i++ {
			if homeTeamsColors[index] == guestTeamsColors[i] {
				sum = sum + 1
			}
		}
	}
	fmt.Println(sum)
}

package main

import "fmt"

type team struct {
	homeUniform  int
	guestUniform int
}

func main() {
	var nTeams int
	fmt.Scan(&nTeams)
	teams := make([]team, nTeams)
	for i := 0; i < nTeams; i++ {
		fmt.Scanf("%d %d\n", &teams[i].homeUniform, &teams[i].guestUniform)
	}
	var count int
	for i := 0; i < nTeams; i++ {
		for j := 0; j < nTeams; j++ {
			if teams[i].homeUniform == teams[j].guestUniform {
				count += 1
			}
		}
	}
	// fmt.Println(teams)
	fmt.Println(count)
}

package main

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

type Team struct {
    main uint8
    second  uint8
}

func main() {
	in := bufio.NewReader(os.Stdin)
	var n,c uint8
	var s []Team

	fmt.Fscanf(in, "%d\n", &n)
	for i:= uint8(0); i < n; i++{
		var t Team
		fmt.Fscanf(in, "%d %d\n", &t.main, &t.second)
		s = append(s, t)
	}
	for i:= uint8(0); i < n; i++{
		for j:= uint8(0); j < n; j++{
			if i != j{
				if s[i].main == s[j].second{
					c++
				}
			}
		}
	}
	fmt.Println(c)

}


One day, $$$n$$$ people ($$$n$$$ is an even number) met on a plaza and made two round dances, each round dance consists of exactly $$$\frac{n}{2}$$$ people. Your task is to find the number of ways $$$n$$$ people can make two round dances if each round dance consists of exactly $$$\frac{n}{2}$$$ people. Each person should belong to exactly one of these two round dances.Round dance is a dance circle consisting of $$$1$$$ or more people. Two round dances are indistinguishable (equal) if one can be transformed to another by choosing the first participant. For example, round dances $$$[1, 3, 4, 2]$$$, $$$[4, 2, 1, 3]$$$ and $$$[2, 1, 3, 4]$$$ are indistinguishable.For example, if $$$n=2$$$ then the number of ways is $$$1$$$: one round dance consists of the first person and the second one of the second person.For example, if $$$n=4$$$ then the number of ways is $$$3$$$. Possible options:  one round dance — $$$[1,2]$$$, another — $$$[3,4]$$$;  one round dance — $$$[2,4]$$$, another — $$$[3,1]$$$;  one round dance — $$$[4,1]$$$, another — $$$[3,2]$$$. Your task is to find the number of ways $$$n$$$ people can make two round dances if each round dance consists of exactly $$$\frac{n}{2}$$$ people.

The input contains one integer $$$n$$$ ($$$2 \le n \le 20$$$), $$$n$$$ is an even number.

Print one integer — the number of ways to make two round dances. It is guaranteed that the answer fits in the $$$64$$$-bit integer data type.

package main

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

func factorial(number int64) int64 {
	var i, result int64 = 0, 1

	for i = 2; i <= number; i++ {
		result *= i
	}

	return result

}

func main() {

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n := scanner.Text()

	var number, factorialVal, denom int64
	number, _ = strconv.ParseInt(n, 10, 64)

	factorialVal = factorial(number)
	denom = (number / 2) * number

	fmt.Println(factorialVal / denom)

}

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)
	f := make([]int64, n+1)
	f[0] = 1
	for i := 1; i <= n; i++ {
		f[i] = f[i-1] * int64(i)
	}
	var ans int64
	ans = (f[n] / f[n/2] / f[n/2]) * (f[n/2-1]) * (f[n/2-1]) / 2
	_, _ = fmt.Fprintln(_w, ans)
	_ = _w.Flush()
}

package main

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

func main() {
	defer _w.Flush()
	n := ReadInt()
	println(solve(n))
}

func solve(n int) int64 {
	c := circle(n / 2)
	return partition(n) * c * c
}

func partition(n int) int64 {
	return Combination(n, n/2) / 2
}

func circle(n int) int64 {
	if n <= 2 {
		return 1
	}
	return Factorial(n - 1)
}

func Combination(n int, k int) int64 { return Permutation(n, k) / Factorial(k) }
func Factorial(n int) int64          { return Permutation(n, n-1) }
func Permutation(n_ int, r_ int) int64 {
	n, r := int64(n_), int64(r_)
	v := int64(1)
	for i := int64(0); i < r; i++ {
		v *= n - i
	}
	return v
}

var _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func print(a ...interface{})            { fmt.Fprint(_w, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(_w, f, a...) }
func println(a ...interface{})          { fmt.Fprintln(_w, a...) }
func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(_r, a...); err != nil {
		panic(err)
	}
}
func ReadString() (s string) { Scan(&s); return }
func ReadInt() (i int)       { Scan(&i); return }
func ReadInts(n int) (a []int) {
	for i := 0; i < n; i++ {
		a = append(a, ReadInt())
	}
	return
}
func ReadInt64() (i int64) { Scan(&i); return }
func ReadInt64s(n int) (a []int64) {
	for i := 0; i < n; i++ {
		a = append(a, ReadInt64())
	}
	return
}

package main

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

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

func factorial(n int64) int64 {
	if n == 1 {
		return 1;
	} else {
		return n*factorial(n-1);
	}
}

func main() {
	defer writer.Flush()

	var n int64
	scanf("%d\n", &n)

	var res int64 = (factorial(n)/((n/2)*(n/2))) / 2;

	printf("%d\n", res)
}

package main

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

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

	var n int64
	Fscan(in, &n)
	ans := new(big.Int).Binomial(n, n/2)

	f := int64(1)
	for i := int64(2); i < n/2; i++ {
		f*=i
	}
	f*=f

	ans.Mul(ans, big.NewInt(f))
	ans.Div(ans, big.NewInt(2))
	Fprintln(out, ans.Int64())
}

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

package main

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

func comb(n, r int64) int64 {
	result := int64(1)
	if r > n/2 {
		r = n - r
	}
	u := n + 1
	for i := int64(1); i <= r; i++ {
		u--
		result *= u
		result /= i
	}
	return result
}

func fact(n int64) int64 {
	result := int64(1)
	for i := int64(2); i <= n; i++ {
		result *= i
	}
	return result
}

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

func main() {
	defer writer.Flush()
	var n int64
	fmt.Fscan(reader, &n)
	f := fact(n/2 - 1)
	fmt.Fprintln(writer, comb(n, n/2)/2*f*f)
}


Vitya has just started learning Berlanese language. It is known that Berlanese uses the Latin alphabet. Vowel letters are "a", "o", "u", "i", and "e". Other letters are consonant.In Berlanese, there has to be a vowel after every consonant, but there can be any letter after any vowel. The only exception is a consonant "n"; after this letter, there can be any letter (not only a vowel) or there can be no letter at all. For example, the words "harakiri", "yupie", "man", and "nbo" are Berlanese while the words "horse", "king", "my", and "nz" are not.Help Vitya find out if a word $$$s$$$ is Berlanese.

The first line of the input contains the string $$$s$$$ consisting of $$$|s|$$$ ($$$1\leq |s|\leq 100$$$) lowercase Latin letters.

Print "YES" (without quotes) if there is a vowel after every consonant except "n", otherwise print "NO". You can print each letter in any case (upper or lower).

NoteIn the first and second samples, a vowel goes after each consonant except "n", so the word is Berlanese.In the third sample, the consonant "c" goes after the consonant "r", and the consonant "s" stands on the end, so the word is not Berlanese.

package main

import "fmt"

func isAeiou(t string) bool {
	if t=="a" || t == "e" || t=="i" || t == "o" || t == "u" {
		return true
	}
	return false
}

func main() {
	var s string
	fmt.Scan(&s)
	for i := 0; i < len(s)-1; i++ {
		if isAeiou(string(s[i])) || string(s[i])=="n" {
			continue
		}
		if !isAeiou(string(s[i+1])) {
			fmt.Println("NO")
			return
		}
	}
	if isAeiou(string(s[len(s)-1])) || string(s[len(s)-1])=="n" {
		fmt.Println("YES")
	}else {
		fmt.Println("NO")
	}
}

package main

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

func main() {
	vocal := map[string]bool{
		"a": true,
		"i": true,
		"u": true,
		"e": true,
		"o": true,
	}
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	word := sc.Text()
	for i := 0; i < len(word); i++ {
		// get status
		ch := string(word[i])
		isLast := (i == len(word)-1)
		isVocal := vocal[ch]
		isN := (ch == "n")
		// get next char
		nextCh := ""
		if !isLast {
			nextCh = string(word[i+1])
		}
		// infer if word is belanese
		if !isN && (!isVocal && !vocal[nextCh] || !isVocal && isLast) {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
}

package main

/*
	Basically we just need to determine whether given word is Belanese.
	A word is belanese if it follows following rule:
	- vowel after consonant except for "n"
	- anything after vowel or "n" -> including empty char

	So we could just iterate each char in word. If we found a char which:
	- consonant but not n
	- not having vowel afterwards or last char
	we could infer that the word is not Belanese. Otherwise if we don't found
	anything like that, it must be Belanese.
*/

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

func main() {
	vocal := map[string]bool{
		"a": true,
		"i": true,
		"u": true,
		"e": true,
		"o": true,
	}
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	word := sc.Text()
	for i := 0; i < len(word); i++ {
		// get status
		ch := string(word[i])
		isLast := (i == len(word)-1)
		isVocal := vocal[ch]
		isN := (ch == "n")
		// get next char
		nextCh := ""
		if !isLast {
			nextCh = string(word[i+1])
		}
		// infer if word is belanese
		if !isN && (!isVocal && !vocal[nextCh] || !isVocal && isLast) {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
}

package main

import "fmt"

func isVowel(c byte) bool {
    if c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' {
        return true
    } else {
        return false
    }
}

func main() {
    var s string
    fmt.Scanf("%s", &s)
    succ := true
    for i, c := range []byte(s) {
        cur := true
        if !isVowel(c) && c != 'n' {
            cur = (i < len(s) - 1) && isVowel(s[i+1])
        }
        if !cur {
            succ = false
        }
    }
    if succ {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

package main

import "fmt"

func isVowel(c byte) bool {
    if c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' {
        return true
    } else {
        return false
    }
}

func main() {
    var s string
    fmt.Scanf("%s", &s)
    succ := true
    for i, c := range []byte(s) {
        cur := true
        if !isVowel(c) {
            if c == 'n' {
            } else {
                cur = (i < len(s) - 1) && isVowel(s[i+1])
            }
        }
        if !cur {
            succ = false
        }
        // fmt.Println(i, c, cur)
    }
    if succ {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

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

type state func() state

func main() {
	defer Flush()

	s := readb()
	var i int
	ok := true

	var vowel, consonant state
	vowel = func() state {
		//eprintln(i, "vowel", ok)
		if i == len(s) {
			return nil
		}
		switch s[i] {
		case 'a', 'o', 'u', 'i', 'e', 'n':
			i++
			return vowel
		default:
			i++
			return consonant
		}
	}
	consonant = func() state {
		//eprintln(i, "consonant", ok)
		if i == len(s) {
			ok = false
			return nil
		}
		switch s[i] {
		case 'a', 'o', 'u', 'i', 'e':
			i++
			return vowel
		default:
			ok = false
			return nil
		}
	}
	for st := vowel; st != nil; st = st() {
	}
	if ok {
		println("YES")
	} else {
		println("NO")
	}
}

package main

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

func readLine(reader *bufio.Reader) string {
	line, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}
	return strings.TrimRight(string(line), "\r\n")
}

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

func main() {
	vowels := make(map[rune]int)
	var l rune
	for l = 'a'; l <= 'z'; l++ {
		if l == 'a' {
			vowels[l] = -1
		}
		if l == 'e' {
			vowels[l] = -1
		}
		if l == 'i' {
			vowels[l] = -1
		}
		if l == 'o' {
			vowels[l] = -1
		}
		if l == 'u' {
			vowels[l] = -1
		}
	}

	isBerlanese := true
	var word string
	fmt.Scanf("%s", &word)

	if len(word) > 1 {
		for i := 0; i < len(word)-1; i++ {
			if isBerlanese == false {
				break
			}
			letter := rune(word[i])
			nextLetter := rune(word[i+1])
			if letter == 'n' {
				continue
			}

			_, isVowel := vowels[letter]
			if isVowel == true {
				continue
			} else {
				_, nextIsVowel := vowels[nextLetter]
				if nextIsVowel == false {
					isBerlanese = false
					break
				}
			}
		}
	} else {
		letter := rune(word[0])
		if letter == 'n' {
			isBerlanese = true
		} else if _, V := vowels[letter]; V == true {
			isBerlanese = true
		} else {
			isBerlanese = false
		}
	}

	letter := rune(word[len(word)-1])
	if _, okay := vowels[letter]; !(okay == true || letter == 'n') {
		isBerlanese = false
	}
	if isBerlanese == true {
		fmt.Printf("%s\n", "YES")
	} else {
		fmt.Printf("%s\n", "NO")
	}
}

package main

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

func main() {
	sc := NewScanner()

	S := sc.NextLine()

	flag := false
	for i := 0; i < len(S); i++ {
		switch S[i] {
		case 'a', 'i', 'u', 'e', 'o':
			flag = false
		default:
			if flag {
				fmt.Println("NO")
				return
			}
			if S[i] != 'n' {
				flag = true
			}
		}
	}
	if flag {
		fmt.Println("NO")
		return
	}
	fmt.Println("YES")

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import "fmt"

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

		need_vowel, need_rune := false, false
		res := "YES"

		for _, c := range word {
			switch c {
			case 'a', 'o', 'u', 'i', 'e':
			default:
				if need_vowel {
					res = "NO"
				}
			}

			if res == "NO" {
				break
			}
			switch c {
			case 'a', 'o', 'u', 'i', 'e', 'n':
				need_vowel, need_rune = false, false
			default:
				need_vowel, need_rune = true, true
			}
		}

		if need_rune {
			res = "NO"
		}

		fmt.Println(res)
	}
}

package main

import "fmt"

func main() {
    var s string
	fmt.Scan(&s)
	t := true
	flag := false
	for  i,a := range(s){
	    f := true
	    for _,b := range([]rune{'a','o','u','i','e'}) {
    	        if a == b { f = false }
    	}
	    if  flag &&  f {
	        t = false
	        break
	    } else if flag && !f {
	        flag = false
	    } else if !flag && f && a != 'n'{
	        flag  = true
	    } else if  f && i == len(s)-1 && a != 'n'  {
	        t = false
	        break
	    }

	}
	if t && !flag {
	    fmt.Println("YES")
	} else {
	    fmt.Println("NO")
	}
}

package main

import "fmt"

func isVowel(c byte) bool {
    if c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' {
        return true
    } else {
        return false
    }
}

func main() {
    var s string
    fmt.Scanf("%s", &s)
    succ := true
    for i, c := range []byte(s) {
        cur := true
        if !isVowel(c) {
            if c == 'n' {
                cur = (i == len(s) - 1) || isVowel(s[i+1])
            } else {
                cur = (i < len(s) - 1) && isVowel(s[i+1])
            }
        }
        if !cur {
            succ = false
        }
    }
    if succ {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}

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

type state func() state

func main() {
	defer Flush()

	s := readb()
	var i int
	ok := true

	var vowel, consonant state
	vowel = func() state {
		//eprintln(i, "vowel", ok)
		if i == len(s) {
			return nil
		}
		switch s[i] {
		case 'a', 'o', 'u', 'i', 'e', 'n':
			i++
			return vowel
		default:
			i++
			return consonant
		}
	}
	consonant = func() state {
		//eprintln(i, "consonant", ok)
		if i == len(s) {
			ok = false
			return nil
		}
		switch s[i] {
		case 'a', 'o', 'u', 'i', 'e', 'n':
			i++
			return vowel
		default:
			ok = false
			return nil
		}
	}
	for st := vowel; st != nil; st = st() {
	}
	if ok {
		println("YES")
	} else {
		println("NO")
	}
}

package main

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

func readLine(reader *bufio.Reader) string {
	line, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}
	return strings.TrimRight(string(line), "\r\n")
}

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	vowels := make(map[rune]int)
	var l rune
	for l = 'a'; l <= 'z'; l++ {
		if l == 'a' {
			vowels[l] = -1
		}
		if l == 'e' {
			vowels[l] = -1
		}
		if l == 'i' {
			vowels[l] = -1
		}
		if l == 'o' {
			vowels[l] = -1
		}
		if l == 'u' {
			vowels[l] = -1
		}
	}

	isBerlanese := true
	word := readLine(reader)

	for i := 0; i < len(word)-1; i++ {
		if isBerlanese == false {
			break
		}
		letter := rune(word[i])
		nextLetter := rune(word[i+1])
		if letter == 'n' {
			continue
		}

		_, isVowel := vowels[letter]
		if isVowel == true {
			_, nextIsVowel := vowels[nextLetter]
			if nextIsVowel == true {
				isBerlanese = false
				break
			}
		} else {
			_, nextIsVowel := vowels[nextLetter]
			if nextIsVowel == false {
				isBerlanese = false
				break
			}
		}
	}

	if isBerlanese == true {
		println("YES")
	} else {
		println("NO")
	}
}

package main

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

func readLine(reader *bufio.Reader) string {
	line, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}
	return strings.TrimRight(string(line), "\r\n")
}

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

func main() {
	vowels := make(map[rune]int)
	var l rune
	for l = 'a'; l <= 'z'; l++ {
		if l == 'a' {
			vowels[l] = -1
		}
		if l == 'e' {
			vowels[l] = -1
		}
		if l == 'i' {
			vowels[l] = -1
		}
		if l == 'o' {
			vowels[l] = -1
		}
		if l == 'u' {
			vowels[l] = -1
		}
	}

	isBerlanese := true
	var word string
	fmt.Scanf("%s", &word)

	if len(word) > 1 {
		for i := 0; i < len(word)-1; i++ {
			if isBerlanese == false {
				break
			}
			letter := rune(word[i])
			nextLetter := rune(word[i+1])
			if letter == 'n' {
				continue
			}

			_, isVowel := vowels[letter]
			if isVowel == true {
				continue
			} else {
				_, nextIsVowel := vowels[nextLetter]
				if nextIsVowel == false {
					isBerlanese = false
					break
				}
			}
		}
	} else {
		letter := rune(word[0])
		if letter == 'n' {
			isBerlanese = true
		}
		if _, V := vowels[letter]; V == true {
			isBerlanese = true
		}
		isBerlanese = false
	}
	if isBerlanese == true {
		fmt.Printf("%s\n", "YES")
	} else {
		fmt.Printf("%s\n", "NO")
	}
}

package main

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

func readLine(reader *bufio.Reader) string {
	line, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}
	return strings.TrimRight(string(line), "\r\n")
}

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

func main() {
	vowels := make(map[rune]int)
	var l rune
	for l = 'a'; l <= 'z'; l++ {
		if l == 'a' {
			vowels[l] = -1
		}
		if l == 'e' {
			vowels[l] = -1
		}
		if l == 'i' {
			vowels[l] = -1
		}
		if l == 'o' {
			vowels[l] = -1
		}
		if l == 'u' {
			vowels[l] = -1
		}
	}

	isBerlanese := true
	var word string
	fmt.Scanf("%s", &word)

	for i := 0; i < len(word)-1; i++ {
		if isBerlanese == false {
			break
		}
		letter := rune(word[i])
		nextLetter := rune(word[i+1])
		if letter == 'n' {
			continue
		}

		_, isVowel := vowels[letter]
		if isVowel == true {
			_, nextIsVowel := vowels[nextLetter]
			if nextIsVowel == true {
				isBerlanese = false
				break
			}
		} else {
			_, nextIsVowel := vowels[nextLetter]
			if nextIsVowel == false {
				isBerlanese = false
				break
			}
		}
	}

	if isBerlanese == true {
		fmt.Printf("%s\n", "YES")
	} else {
		fmt.Printf("%s\n", "NO")
	}
}

package main

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

func readLine(reader *bufio.Reader) string {
	line, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}
	return strings.TrimRight(string(line), "\r\n")
}

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

func main() {
	vowels := make(map[rune]int)
	var l rune
	for l = 'a'; l <= 'z'; l++ {
		if l == 'a' {
			vowels[l] = -1
		}
		if l == 'e' {
			vowels[l] = -1
		}
		if l == 'i' {
			vowels[l] = -1
		}
		if l == 'o' {
			vowels[l] = -1
		}
		if l == 'u' {
			vowels[l] = -1
		}
	}

	isBerlanese := true
	var word string
	fmt.Scanf("%s", &word)

	for i := 0; i < len(word)-1; i++ {
		if isBerlanese == false {
			break
		}
		letter := rune(word[i])
		nextLetter := rune(word[i+1])
		if letter == 'n' {
			continue
		}

		_, isVowel := vowels[letter]
		if isVowel == true {
			continue
		} else {
			_, nextIsVowel := vowels[nextLetter]
			if nextIsVowel == false {
				isBerlanese = false
				break
			}
		}
	}

	if isBerlanese == true {
		fmt.Printf("%s\n", "YES")
	} else {
		fmt.Printf("%s\n", "NO")
	}
}

package main

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

func readLine(reader *bufio.Reader) string {
	line, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}
	return strings.TrimRight(string(line), "\r\n")
}

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

func main() {
	vowels := make(map[rune]int)
	var l rune
	for l = 'a'; l <= 'z'; l++ {
		if l == 'a' {
			vowels[l] = -1
		}
		if l == 'e' {
			vowels[l] = -1
		}
		if l == 'i' {
			vowels[l] = -1
		}
		if l == 'o' {
			vowels[l] = -1
		}
		if l == 'u' {
			vowels[l] = -1
		}
	}

	isBerlanese := true
	var word string
	fmt.Scanf("%s", &word)

	if !(len(word) == 1) {

		for i := 0; i < len(word)-1; i++ {
			if isBerlanese == false {
				break
			}
			letter := rune(word[i])
			nextLetter := rune(word[i+1])
			if letter == 'n' {
				continue
			}

			_, isVowel := vowels[letter]
			if isVowel == true {
				continue
			} else {
				_, nextIsVowel := vowels[nextLetter]
				if nextIsVowel == false {
					isBerlanese = false
					break
				}
			}
		}
	}
	if isBerlanese == true {
		fmt.Printf("%s\n", "YES")
	} else {
		fmt.Printf("%s\n", "NO")
	}
}

package main

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

func readLine(reader *bufio.Reader) string {
	line, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}
	return strings.TrimRight(string(line), "\r\n")
}

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

func main() {
	vowels := make(map[rune]int)
	var l rune
	for l = 'a'; l <= 'z'; l++ {
		if l == 'a' {
			vowels[l] = -1
		}
		if l == 'e' {
			vowels[l] = -1
		}
		if l == 'i' {
			vowels[l] = -1
		}
		if l == 'o' {
			vowels[l] = -1
		}
		if l == 'u' {
			vowels[l] = -1
		}
	}

	isBerlanese := true
	var word string
	fmt.Scanf("%s", &word)

	for i := 0; i < len(word)-1; i++ {
		if isBerlanese == false {
			break
		}
		letter := rune(word[i])
		nextLetter := rune(word[i+1])
		if len(word) == 1 && letter == 'n' {
			continue
		}
		if _, V := vowels[letter]; len(word) == 1 && V == true {
			continue
		}
		if len(word) == 1 {
			isBerlanese = false
			break
		}
		if letter == 'n' {
			continue
		}

		_, isVowel := vowels[letter]
		if isVowel == true {
			continue
		} else {
			_, nextIsVowel := vowels[nextLetter]
			if nextIsVowel == false {
				isBerlanese = false
				break
			}
		}
	}
	if isBerlanese == true {
		fmt.Printf("%s\n", "YES")
	} else {
		fmt.Printf("%s\n", "NO")
	}
}

package main

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

func readLine(reader *bufio.Reader) string {
	line, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}
	return strings.TrimRight(string(line), "\r\n")
}

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

func main() {
	vowels := make(map[rune]int)
	var l rune
	for l = 'a'; l <= 'z'; l++ {
		if l == 'a' {
			vowels[l] = -1
		}
		if l == 'e' {
			vowels[l] = -1
		}
		if l == 'i' {
			vowels[l] = -1
		}
		if l == 'o' {
			vowels[l] = -1
		}
		if l == 'u' {
			vowels[l] = -1
		}
	}

	isBerlanese := true
	var word string
	fmt.Scanf("%s", &word)

	if len(word) > 1 {
		for i := 0; i < len(word)-1; i++ {
			if isBerlanese == false {
				break
			}
			letter := rune(word[i])
			nextLetter := rune(word[i+1])
			if letter == 'n' {
				continue
			}

			_, isVowel := vowels[letter]
			if isVowel == true {
				continue
			} else {
				_, nextIsVowel := vowels[nextLetter]
				if nextIsVowel == false {
					isBerlanese = false
					break
				}
			}
		}
	} else {
		letter := rune(word[0])
		if letter == 'n' {
			isBerlanese = true
		} else if _, V := vowels[letter]; V == true {
			isBerlanese = true
		} else {
			isBerlanese = false
		}
	}
	if isBerlanese == true {
		fmt.Printf("%s\n", "YES")
	} else {
		fmt.Printf("%s\n", "NO")
	}
}

package main

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

func main() {
	sc := NewScanner()

	S := sc.NextLine()

	flag := false
	for i := 0; i < len(S); i++ {
		switch S[i] {
		case 'a', 'i', 'u', 'e', 'o', 'n':
			flag = false
		default:
			if flag {
				fmt.Println("NO")
				return
			}
			flag = true
		}
	}
	if flag {
		fmt.Println("NO")
		return
	}
	fmt.Println("YES")

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

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

func main() {
	sc := NewScanner()

	S := sc.NextLine()

	flag := false
	for i := 0; i < len(S); i++ {
		switch S[i] {
		case 'a', 'i', 'u', 'e', 'o':
			flag = false
		case 'n':
		default:
			if flag {
				fmt.Println("NO")
				return
			}
			flag = true
		}
	}
	if flag {
		fmt.Println("NO")
		return
	}
	fmt.Println("YES")

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import "fmt"

func main() {
    var s string
	fmt.Scan(&s)
	t := true
	flag := false
	for  i,a := range(s){
	    f := true
	    if a != 'n' {
    	    for _,b := range([]rune{'a','o','u','i','e'}) {
    	        if a == b { f = false }
    	    }

	    if  flag && f {
	        t = false
	        break
	    }
	    if flag && !f {
	        flag = false
	    }
	    if !flag && f {
	        flag  = true
	    }
	    if  f && i == len(s)-1   {
	        t = false
	        break
	    }
	    }
	}
	if t {
	    fmt.Println("YES")
	} else {
	    fmt.Println("NO")
	}
}

package main

import "fmt"

func main() {
    var s string
	fmt.Scan(&s)
	t := true
	flag := false
	for  i,a := range(s){
	    f := true
	    for _,b := range([]rune{'a','o','u','i','e'}) {
    	        if a == b { f = false }
    	}
	    if  flag &&  f {
	        t = false
	        break
	    } else if flag && !f {
	        flag = false
	    } else if !flag && f && a != 'n'{
	        flag  = true
	    } else if  f && i == len(s)-1 && a != 'n'  {
	        t = false
	        break
	    }

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

package main

import "fmt"

func main() {
    var s string
	fmt.Scan(&s)
	t := true
	flag := false
	for  i,a := range(s){
	    f := true
	    for _,b := range([]rune{'a','o','u','i','e'}) {
    	        if a == b { f = false }
    	}
	    if  flag &&  f && a!='n' {
	        t = false
	        break
	    } else if flag && !f {
	        flag = false
	    } else if !flag && f && a != 'n'{
	        flag  = true
	    } else if  f && i == len(s)-1 && a != 'n'  {
	        t = false
	        break
	    }

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


Overlooking the captivating blend of myriads of vernal hues, Arkady the painter lays out a long, long canvas.Arkady has a sufficiently large amount of paint of three colours: cyan, magenta, and yellow. On the one-dimensional canvas split into n consecutive segments, each segment needs to be painted in one of the colours.Arkady has already painted some (possibly none or all) segments and passes the paintbrush to you. You are to determine whether there are at least two ways of colouring all the unpainted segments so that no two adjacent segments are of the same colour. Two ways are considered different if and only if a segment is painted in different colours in them.

The first line contains a single positive integer n (1 ≤ n ≤ 100) — the length of the canvas. The second line contains a string s of n characters, the i-th of which is either 'C' (denoting a segment painted in cyan), 'M' (denoting one painted in magenta), 'Y' (one painted in yellow), or '?' (an unpainted one).

If there are at least two different ways of painting, output "Yes"; otherwise output "No" (both without quotes). You can print each character in any case (upper or lower).

NoteFor the first example, there are exactly two different ways of colouring: CYCMY and CYMCY.For the second example, there are also exactly two different ways of colouring: CMCMY and CYCMY.For the third example, there are four ways of colouring: MCYCM, MCYCY, YCYCM, and YCYCY.For the fourth example, no matter how the unpainted segments are coloured, the existing magenta segments will prevent the painting from satisfying the requirements. The similar is true for the fifth example.

package main

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

var cs map[int]int = make(map[int]int)

func Init() {}
func Solve(io *FastIO) {
	n := io.NextInt()
	s := io.NextString()
	if n == 1 {
		if s[0] == '?' {
			io.Println("Yes")
		} else {
			io.Println("No")
		}
		return
	}
	s += string(s[n-2])
	l := s[1]
	o := false
	var j byte
	for i := 0; i < n; i++ {
		j = s[i]
		if j != '?' {
			if l == j {
				o = false
				break
			}
		} else {
			if s[i+1] == '?' || s[i+1] == l {
				o = true
			}
		}
		l = j
	}
	if o {
		io.Println("Yes")
	} else {
		io.Println("No")
	}
}

type FastIO struct {
	//by megaspazz
	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 res * sgn
}
func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = int64(-1)
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = res*10 + int64(c-'0')
		c = io.NextChar()
	}
	return res * sgn
}
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() + 1
	}
	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"
)

func solve() bool {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	scanner.Scan()
	maj := scanner.Text()
	for i := 0; i < len(maj)-1; i++ {
		if maj[i] == maj[i+1] && maj[i] != '?' {
			return false
		}
	}
	// A?A -> Yes
	// A?B -> No
	for i := range maj {
		if maj[i] == '?' {
			if i == 0 || i == len(maj)-1 {
				return true
			}
			if maj[i-1] == '?' || maj[i+1] == '?' {
				return true
			}
			if maj[i-1] == maj[i+1] {
				return true
			}
		}
	}
	return false
}

func main() {
	if solve() {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var s string
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s\n", &s)
	for i:=1;i<n;i++{
		if s[i]==s[i-1] && !(s[i]=='?' || s[i-1]=='?'){
			fmt.Println("No")
			os.Exit(0)
		}
	}
	if s[0] == '?' || s[n-1] == '?'{
		fmt.Println("Yes")
		os.Exit(0)
	}
	for i:=1;i<n-1;i++{
		if s[i] == '?'{
			if s[i-1] == '?' || s[i-1]==s[i+1]{
				fmt.Println("Yes")
				os.Exit(0)
			}
		}
	}
	fmt.Println("No")
}

package main
import (
	"fmt"
	"strings"
)
func main(){
	var(
		n int
		s string
	)
	fmt.Scan(&n,&s)
	if strings.Count(s,"MM")>0||strings.Count(s,"CC")>0||strings.Count(s,"YY")>0{
		fmt.Println("No")
		return
	}
	if s[0]=='?'||s[n-1]=='?'||strings.Count(s,"??")>0||strings.Count(s,"M?M")>0||strings.Count(s,"C?C")>0||strings.Count(s,"Y?Y")>0{
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}

package main
import "fmt"
func main(){
	var(
		n int
		s string
	)
	fmt.Scan(&n,&s)
	for i:=0;i<n-1;i++{
		if s[i]!='?'&&s[i]==s[i+1]{
			fmt.Println("No")
			return
		}
	}
	for i:=0;i<n;i++{
		if s[i]=='?'&&(i==0||i==n-1||s[i+1]=='?'||s[i-1]=='?'||s[i-1]==s[i+1]){
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}

package main

import (
	"fmt"
)

func main() {
	var n int
	var s string
	fmt.Scan(&n, &s)
	for i := 1; i < n; i++ {
		if s[i - 1] == s[i] && s[i] != '?' {
			fmt.Print("No")
			return
		}
	}
	if s[0] == '?' || s[n - 1] == '?' {
		fmt.Print("Yes")
		return
	}
	for i := 1; i < n; i++ {
		if s[i - 1] == '?' && s[i] == '?' {
			fmt.Print("Yes")
			return
		}
	}
	for i := 1; i < n - 1; i++ {
		if s[i] == '?' && s[i - 1] == s[i + 1] {
			fmt.Print("Yes")
			return
		}
	}
	fmt.Print("No")
	return
}

package main

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

var cs map[int]int = make(map[int]int)

func Init() {}
func Solve(io *FastIO) {
	_ = io.NextInt()
	s := io.NextString()
	if check(0, rune('K'), s) > 1 {
		io.Println("Yes")
	} else {
		io.Println("No")
	}
}
func check(sti int, l rune, s string) int {
	c := 0
	chs := "CMY"
	s = s[sti:]
	//fmt.Println(l, s)
	for i, j := range s {
		if j != '?' {
			if j == l {
				return 0
			} else {
				l = j
			}
		} else if i+1 < len(s) {
			for _, k := range chs {
				if k != l {
					c += check(i+1, k, s)
				}
				if c > 1 {
					return c
				}
			}
		}
	}
	return 1
}

type FastIO struct {
	//by megaspazz
	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 res * sgn
}
func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = int64(-1)
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = res*10 + int64(c-'0')
		c = io.NextChar()
	}
	return res * sgn
}
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() + 1
	}
	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"
	"bytes"
	"fmt"
	"os"
)

var cs map[int]int = make(map[int]int)

func Init() {}
func Solve(io *FastIO) {
	n := io.NextInt()
	s := io.NextString()
	if n == 1 {
		io.Println("Yes")
		return
	}
	s += string(s[n-2])
	l := s[1]
	o := false
	var j byte
	for i := 0; i < n; i++ {
		j = s[i]
		if j != '?' {
			if l == j {
				o = false
				break
			}
		} else {
			if s[i+1] == '?' || s[i+1] == l {
				o = true
			}
		}
		l = j
	}
	if o {
		io.Println("Yes")
	} else {
		io.Println("No")
	}
}

type FastIO struct {
	//by megaspazz
	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 res * sgn
}
func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = int64(-1)
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = res*10 + int64(c-'0')
		c = io.NextChar()
	}
	return res * sgn
}
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() + 1
	}
	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"
	"bytes"
	"fmt"
	"os"
)

var cs map[int]int = make(map[int]int)

func Init() {}
func Solve(io *FastIO) {
	n := io.NextInt()
	s := io.NextString() + "K"
	l := byte('K')
	o := false
	var j byte
	for i := 0; i < n; i++ {
		j = s[i]
		if j != '?' {
			if l == j {
				o = false
				break
			}
		} else {
			if s[i+1] == '?' || s[i+1] == l {
				o = true
			}
		}
		l = j
	}
	if o {
		io.Println("Yes")
	} else {
		io.Println("No")
	}
}

type FastIO struct {
	//by megaspazz
	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 res * sgn
}
func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = int64(-1)
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = res*10 + int64(c-'0')
		c = io.NextChar()
	}
	return res * sgn
}
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() + 1
	}
	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"
)

func solve() bool {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	scanner.Scan()
	maj := scanner.Text()
	for i := 0; i < len(maj)-1; i++ {
		if maj[i] == maj[i+1] && maj[i] != '?' {
			fmt.Println("FIRST")
			return false
		}
	}
	// A?A -> Yes
	// A?B -> No
	for i := range maj {
		if maj[i] == '?' {
			if i == 0 || i == len(maj)-1 {
				return true
			}
			if maj[i-1] == '?' || maj[i+1] == '?' {
				return true
			}
			if maj[i-1] == maj[i+1] {
				return true
			}
		}
	}
	return false
}

func main() {
	if solve() {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var s string
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s\n", &s)
	for i:=1;i<n;i++{
		if s[i]==s[i-1]{
			fmt.Println("No")
			os.Exit(0)
		}
	}
	if s[0] == '?' || s[n-1] == '?'{
		fmt.Println("Yes")
		os.Exit(0)
	}
	for i:=1;i<n-1;i++{
		if s[i] == '?'{
			if s[i-1] == '?' || s[i-1]==s[i+1]{
				fmt.Println("Yes")
				os.Exit(0)
			}
		}
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var s string
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s\n", &s)
	for i:=1;i<n;i++{
		if s[i]==s[i-1] && !(s[i]=='?' || s[i-1]=='?'){
			fmt.Println("No")
			os.Exit(0)
		}
	}
	if s[0] == '?' || s[n-1] == '?'{
		fmt.Println("Yes")
		os.Exit(0)
	}
	for i:=1;i<n-1;i++{
		if s[i] == '?'{
			if s[i-1] == '?' || s[i-1]==s[i+1]{
				fmt.Println("Yes")
				os.Exit(0)
			}
		}
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var s string
	var flag bool
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s\n", &s)
	if s[0] == '?' || s[n-1] == '?'{
		fmt.Println("Yes")
		os.Exit(0)
	}
	for i:=1;i<n-1;i++{
		if s[i] == '?'{
			flag = true
			if s[i-1] == '?' || s[i-1]==s[i+1]{
				fmt.Println("Yes")
				os.Exit(0)
			}
		}
	}
	for i:=1;i<n;i++{
		if s[i]==s[i-1] && flag == false{
			fmt.Println("No")
			os.Exit(0)
		}
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	var s string
	fmt.Scan(&n, &s)
	for i := 1; i < n; i++ {
		if s[i - 1] == s[i] && s[i] != '?' {
			fmt.Print("No")
			return
		}
	}
	if s[0] == '?' || s[n - 1] == '?' {
		fmt.Print("Yes")
		return
	}
	for i := 1; i < n; i++ {
		if s[i - 1] == '?' && s[i] == '?' {
			fmt.Print("Yes")
			return
		}
	}
	fmt.Print("No")
}


Modern text editors usually show some information regarding the document being edited. For example, the number of words, the number of pages, or the number of characters.In this problem you should implement the similar functionality.You are given a string which only consists of:  uppercase and lowercase English letters,  underscore symbols (they are used as separators),  parentheses (both opening and closing). It is guaranteed that each opening parenthesis has a succeeding closing parenthesis. Similarly, each closing parentheses has a preceding opening parentheses matching it. For each pair of matching parentheses there are no other parenthesis between them. In other words, each parenthesis in the string belongs to a matching "opening-closing" pair, and such pairs can't be nested.For example, the following string is valid: "_Hello_Vasya(and_Petya)__bye_(and_OK)".Word is a maximal sequence of consecutive letters, i.e. such sequence that the first character to the left and the first character to the right of it is an underscore, a parenthesis, or it just does not exist. For example, the string above consists of seven words: "Hello", "Vasya", "and", "Petya", "bye", "and" and "OK". Write a program that finds:  the length of the longest word outside the parentheses (print 0, if there is no word outside the parentheses),  the number of words inside the parentheses (print 0, if there is no word inside the parentheses).

The first line of the input contains a single integer n (1 ≤ n ≤ 255) — the length of the given string. The second line contains the string consisting of only lowercase and uppercase English letters, parentheses and underscore symbols.

Print two space-separated integers:   the length of the longest word outside the parentheses (print 0, if there is no word outside the parentheses),  the number of words inside the parentheses (print 0, if there is no word inside the parentheses).

NoteIn the first sample, the words "Hello", "Vasya" and "bye" are outside any of the parentheses, and the words "and", "Petya", "and" and "OK" are inside. Note, that the word "and" is given twice and you should count it twice in the answer.

package main

import (
        "fmt"
        "regexp"
        "strconv"
        "strings"
)

func O(o interface{}, n bool) {
        if n {
                fmt.Println(o)
        } else {
                fmt.Printf("%v ", o)
        }
}

func Int(s string) int64 {
        t, _ := strconv.ParseInt(s, 10, 64)
        return t
}

func I(n bool) string {
        var t string
        if n {
                fmt.Scanln(&t)
        } else {
                fmt.Scan(&t)
        }
        return t
}

func main() {
        n := Int(I(true))
        s := I(true)
        n = n

        re := regexp.MustCompile(`\([^\(\)]*\)`)
        ss := re.FindAllString(s, -1)

        ooo := re.ReplaceAllString(s, "_")

        rrr := regexp.MustCompile(`([_])*`)
        ooo = rrr.ReplaceAllString(ooo, "$1")
        qqq := strings.Split(ooo, "_")
        mmm := 0
        for _, q := range qqq {
                if len(q) > mmm {
                        mmm = len(q)
                }
        }

        O(mmm, false)

        num := 0
        for i := range ss {
                sss := strings.Split(ss[i], "_")
                for j := range sss {
                        r := regexp.MustCompile(`[_\(\)]`)
                        sss[j] = r.ReplaceAllString(sss[j], "")
                        if len(sss[j]) > 0 {
                                num++
                        }
                }
        }
        O(num, true)
}

package main

import "fmt"
import "bufio"
import "os"

var bufin *bufio.Reader
var bufout *bufio.Writer

func main() {
	bufin = bufio.NewReader(os.Stdin)
	bufout = bufio.NewWriter(os.Stdout)
	defer bufout.Flush()

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

	inside := false
	l := 0

	longestOutside := 0
	countInside := 0

	s = "_" + s + "_"
	n = len(s)

	for i := 0; i < n; i++ {
		c := s[i]
		if (c == '_') || (c == '(') || (c == ')') {
			if l > 0 {
				if inside {
					countInside++
				} else {
					if longestOutside < l {
						longestOutside = l
					}
				}
				l = 0
			}
		} else {
			l++
		}
		if c == '(' {
			inside = true
		} else if c == ')' {
			inside = false
		}
	}

	fmt.Fprintf(bufout, "%d %d\n", longestOutside, countInside)
}

package main

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

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

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

	_ = nextInt()
	s := next()
	var outsideWords []string

	for i := strings.Index(s, "("); i >= 0; i = strings.Index(s, "(") {
		j := strings.Index(s, ")")
		outsideWords = append(outsideWords, splitWords(s[i+1:j], '_')...)
		s = s[:i] + "_" + s[j+1:]
	}

	println(maxLength(splitWords(s, '_')), len(outsideWords))

}

func splitWords(s string, c rune) []string {
	return strings.FieldsFunc(s, func(c rune) bool { return c == '_' })
}

func maxLength(s []string) int {
	l := 0

	for i := range s {
		if len(s[i]) > l {
			l = len(s[i])
		}
	}

	return l
}

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

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

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

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

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

package main

import (
	"fmt"
)

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

func main() {
	var  (
		n int
		str string
	)

	fmt.Scanln(&n)
	fmt.Scanln(&str)

	i := 0;
	s_words := 0
	s_len := 0
	w_len := 0
	w_max := 0
	for i < n {
		if str[i] == '(' {
			i++

			for  i < n && str[i] != ')' {
				if str[i] != '_' {
					s_len++
				} else {
					if s_len > 0 {
						s_words++
					}
					s_len = 0
				}
				i++

			}
			i++
			if s_len > 0 {
				s_words++
			}
			s_len = 0
			continue
		}

		for i < n && str[i] != '(' {
				if str[i] != '_' {
					w_len++
				} else {
					if w_len > 0 {
						w_max = max(w_max, w_len)
					}
					w_len = 0
				}
				i++
			}

		if w_len > 0 {
			w_max = max(w_max, w_len)
		}
		w_len = 0
	}

	fmt.Println(w_max, s_words)
}

package main

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

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

	var longest int = 0
	var words_inside int = 0

	reader := bufio.NewReader(os.Stdin)
	if s, err := reader.ReadString('\n'); err != nil {
		if err != io.EOF {
			return
		}
	} else {
		inside := false
		word_length := 0
		for i := 0; i < n; i++ {
			if (s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z') {
				word_length++
			} else {
				if !inside && word_length > longest {
					longest = word_length
				}
				if inside && word_length > 0 {
					words_inside++
				}
				if s[i] == '(' {
					inside = true
				} else if s[i] == ')' {
					inside = false
				}
				word_length = 0
			}
		}
		if word_length > longest {
			longest = word_length
		}
	}

	fmt.Printf("%d %d\n", longest, words_inside)
}

package main

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

var bufin *bufio.Reader
var bufout *bufio.Writer

type res struct {
	ind int
	wrd string
}

func inside_parthesis(S string, x *res) bool {
	l, r := false, false
	for i := x.ind; i >= 0; i-- {
		if S[i] == '(' {
			l = true
			break
		} else if S[i] == ')' {
			break
		}
	}
	for i := x.ind; i < len(S); i++ {
		if S[i] == ')' {
			r = true
			break
		} else if S[i] == '(' {
			break
		}
	}
	return l && r
}
func mysplit(S string) []res {
	var cur string
	var start int
	var ret []res

	for i, c := range S {
		if c != '_' && c != '(' && c != ')' {
			if cur == "" {
				start = i
			}
			cur += string(c)
		} else if cur != "" {
			ret = append(ret, res{start, cur})
			cur = ""
		}
	}
	if cur != "" {
		ret = append(ret, res{start, cur})
	}
	return ret
}

func main() {
	bufin = bufio.NewReader(os.Stdin)
	bufout = bufio.NewWriter(os.Stdout)
	defer bufout.Flush()
	var N int
	fmt.Fscanf(bufin, "%d\n", &N)
	var S string
	fmt.Fscanf(bufin, "%s\n", &S)
	words := mysplit(S)
	cnt := 0
	maxlen := 0
	for _, x := range words {
		if inside_parthesis(S, &x) {
			cnt += 1
		} else {
			if maxlen < len(x.wrd) {
				maxlen = len(x.wrd)
			}
		}
	}
	fmt.Fprintf(bufout, "%d %d\n", maxlen, cnt)

}

package main;

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

func mysplit(line string) []string {
    from := 0
    output := make([]string, 0, 10)
    for i, c := range line {
        if c=='(' || c==')' {
            output = append(output, line[from:i])
            from = i+1
        }
    }
    if from<len(line) {
        output = append(output, line[from:len(line)])
    }

    return output
}

func groups(line string) ([]string, []string) {
    outside, inside := make([]string, 0, 10), make([]string, 0, 10)
    parts := mysplit(line)
    out := true //line[0]!='('
    for _, p := range parts {
        if out {
            outside = append(outside, strings.Split(p, "_") ...)
        } else {
            inside = append(inside, strings.Split(p, "_") ...)
        }
        out = !out
    }

    return outside, inside

}

func main() {
    inp := bufio.NewReader(os.Stdin)
    scanner := bufio.NewScanner(inp)

    scanner.Scan() // number
    scanner.Scan()
    outside, inside := groups(scanner.Text())

    fmt.Fprintf(os.Stderr, "%v - %v \n", outside, inside)

    longestOutside := 0
    for _, w := range outside {
        if len(w) > longestOutside {
            longestOutside = len(w)
        }
    }

    inParenthesis := 0
    for _, w := range inside {
        if len(w) > 0 {
            inParenthesis++
        }
    }

    fmt.Println(longestOutside, inParenthesis)
}

package main

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

func main() {
	fsc := NewFastScanner()
	n := fsc.NextInt()
	text := fsc.Next()
	var flag, maxLength, inLength, outLength, count int
	for i := 0; i <= n; i++ {
		if i == n {
			if maxLength < outLength {
				maxLength = outLength
			}
			break
		}
		if text[i] == '(' {
			if maxLength < outLength {
				maxLength = outLength
			}
			outLength = 0
			flag = 1
		} else if text[i] == ')' {
			if inLength != 0 {
				count++
			}
			inLength = 0
			flag = 0
		} else if text[i] == '_' {
			if inLength != 0 {
				count++
			}
			inLength = 0
			if outLength != 0 {
				if maxLength < outLength {
					maxLength = outLength
				}
			}
			outLength = 0
		} else if flag == 0 {
			outLength++
		} else if flag == 1 {
			inLength++
		}
	}

	fmt.Println(maxLength, count)
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 2028)
	return &FastScanner{r: rdr}
}

func (s *FastScanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}

func (s *FastScanner) NextInt() int {
	val, err := strconv.Atoi(s.Next())
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) NextInt64() int64 {
	val, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}

func (s *FastScanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, err := s.r.ReadLine()
		if err != nil {
			panic(err.Error())
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

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

type TupleInt struct {
	first  int
	second int
	third  int
}

func main() {
	in := NewScanner()
	_ = in.NextInt()
	S := in.NextLine()
	inside := false
	mx := 0
	count := 0
	comma := false
	ln := 0
	for _, s := range S {
		if s == '(' {
			inside = true
			comma = true
		} else if s == ')' {
			inside = false
			comma = true

		} else if s == '_' {
			comma = true
		} else {
			if !inside {
				ln++
				mx = max(mx, ln)
			}

			if comma {
				if inside {
					count++
				}
				comma = false
			}
		}
		if comma {
			ln = 0
		}

	}
	fmt.Println(mx, count)
}
func max(a int, b int) int {
	if a < b {
		return b
	}
	return a
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r:rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}

func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}

func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	result = append(result, v)

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
	result = append(result, v)

	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

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

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

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

	_ = nextInt()
	s := next()
	var outsideWords []string

	for i := strings.Index(s, "("); i >= 0; i = strings.Index(s, "(") {
		j := strings.Index(s, ")")
		outsideWords = append(outsideWords, splitWords(s[i+1:j], '_')...)
		s = s[:i] + s[j+1:]
	}

	println(maxLength(splitWords(s, '_')), len(outsideWords))

}

func splitWords(s string, c rune) []string {
	return strings.FieldsFunc(s, func(c rune) bool { return c == '_' })
}

func maxLength(s []string) int {
	l := 0

	for i := range s {
		if len(s[i]) > l {
			l = len(s[i])
		}
	}

	return l
}

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

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

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

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

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

package main;

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

func groups(line string) ([]string, []string) {
    outside, inside := make([]string, 0, 10), make([]string, 0, 10)
    parts := strings.FieldsFunc(line, func(c rune) bool {
        return c=='(' || c==')'
    })
    out := line[0]!='('
    for _, p := range parts {
        if out {
            outside = append(outside, strings.Split(p, "_") ...)
        } else {
            inside = append(inside, strings.Split(p, "_") ...)
        }
        out = !out
    }

    return outside, inside

}

func main() {
    inp := bufio.NewReader(os.Stdin)
    scanner := bufio.NewScanner(inp)

    scanner.Scan() // number
    scanner.Scan()
    outside, inside := groups(scanner.Text())

    fmt.Fprintf(os.Stderr, "%v - %v \n", outside, inside)

    longestOutside := 0
    for _, w := range outside {
        if len(w) > longestOutside {
            longestOutside = len(w)
        }
    }

    inParenthesis := 0
    for _, w := range inside {
        if len(w) > 0 {
            inParenthesis++
        }
    }

    fmt.Println(longestOutside, inParenthesis)
}

package main

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

func main() {
	fsc := NewFastScanner()
	n := fsc.NextInt()
	text := fsc.Next()
	var flag, maxLength, inLength, outLength, count int
	for i := 0; i < n; i++ {
		if text[i] == '(' {
			if maxLength < outLength {
				maxLength = outLength
			}
			outLength = 0
			flag = 1
		} else if text[i] == ')' {
			if inLength != 0 {
				count++
			}
			inLength = 0
			flag = 0
		} else if text[i] == '_' {
			if inLength != 0 {
				count++
			}
			inLength = 0
			if outLength != 0 {
				if maxLength < outLength {
					maxLength = outLength
				}
			}
			outLength = 0
		} else if flag == 0 {
			outLength++
		} else if flag == 1 {
			inLength++
		}
	}

	fmt.Println(maxLength, count)
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 2028)
	return &FastScanner{r: rdr}
}

func (s *FastScanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}

func (s *FastScanner) NextInt() int {
	val, err := strconv.Atoi(s.Next())
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) NextInt64() int64 {
	val, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return val
}
func (s *FastScanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}

func (s *FastScanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, err := s.r.ReadLine()
		if err != nil {
			panic(err.Error())
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

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

type TupleInt struct {
	first  int
	second int
	third  int
}

func main() {
	in := NewScanner()
	_ = in.NextInt()
	S := in.NextLine()
	inside := false
	last := 0
	mx := 0
	count := 0
	comma := false

	for i, s := range S {
		if s == '(' {
			inside = true
			comma = true
		} else if s == ')' {
			inside = false
			comma = true
			last = i + 1

		} else if s == '_' {
			comma = true
		} else {
			if comma {
				if inside {
					count++
				}
				comma = false
			}
		}
		if comma {
			if !inside {
				mx = max(mx, i - last)
			}
			last = i + 1
		}

	}
	fmt.Println(mx, count)
}
func max(a int, b int) int {
	if a < b {
		return b
	}
	return a
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r:rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}

func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}

func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	result = append(result, v)

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
	result = append(result, v)

	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}