hezhao@localhost assignment1 $ vi assignment1.py
package main

import (
    "fmt"
)

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

func main() {
    var a, b, x, y int
    fmt.Scanf("%d%d%d%d", &a, &b, &x, &y)
    c := a*b/gcd(a, b)
    fmt.Println(y/c-(x-1)/c)
}


package main

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

var in *bufio.Reader
var out *bufio.Writer

func printf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, x, a...)
}

func scanf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fscanf(in, x, a...)
}

func scan(a ...interface{}) (n int, err error) {
	return fmt.Fscan(in, a...)
}

var err error

func next() (n string) {
	scan(&n)
	return n
}

func nextInt() (n int) {
	scan(&n)
	return n
}

func nextLong() (n int64) {
	scan(&n)
	return n
}

func nextDouble() (n float64) {
	scan(&n)
	return n
}

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

var (
	l, r, pre, post []int
	curr            int
)

func solve() {
	n, m, q := nextInt(), nextInt(), nextInt()

	p := make([]int, n)
	for i := range p {
		p[i] = nextInt()
	}

	edges := [][3]int{}
	for i := 0; i < m; i++ {
		edges = append(edges, [3]int{nextInt() - 1, nextInt() - 1, 0})
	}

	qs := [][3]int{}
	for i := 0; i < q; i++ {
		curr := [3]int{nextInt(), nextInt() - 1, 0}
		qs = append(qs, curr)
		if curr[0] == 2 {
			edges[curr[1]][2] = i
		}
	}

	dsu := make(DSU, n)
	for i := range dsu {
		dsu[i] = -1
	}

	l, r = make([]int, n), make([]int, n)
	for i := range l {
		l[i], r[i] = -1, -1
	}
	for _, v := range edges {
		a, b := dsu.par(v[0]), dsu.par(v[1])
		if v[2] != 0 {
			continue
		}
		if a == b {
			qs[v[2]][2] = a
		} else {
			dsu[a], dsu[b] = len(dsu), len(dsu)
			l, r = append(l, a), append(r, b)
			dsu = append(dsu, -1)
		}
	}

	for i := q - 1; i >= 0; i-- {
		if qs[i][0] == 1 {
			qs[i][2] = dsu.par(qs[i][1])
		} else {
			a, b := dsu.par(edges[qs[i][1]][0]), dsu.par(edges[qs[i][1]][1])
			if a == b {
				qs[i][2] = a
			} else {
				dsu[a], dsu[b] = len(dsu), len(dsu)
				l, r = append(l, a), append(r, b)
				dsu = append(dsu, -1)
			}
		}
	}

	pre, post = make([]int, len(l)), make([]int, len(l))
	curr = 0

	for i := len(l) - 1; i >= 0; i-- {
		if pre[i] == 0 {
			dfs(i)
		}
	}

	tree := newNode(0, len(l))
	for i, v := range p {
		tree.upd(pre[i], v)
	}

	for _, v := range qs {
		if v[0] == 1 {
			a, b := tree.query(pre[v[2]], post[v[2]])
			printf("%d\n", a)
			if a != 0 {
				tree.upd(b, 0)
			}
		}
	}
}

func dfs(i int) {
	pre[i], post[i] = curr, curr+1
	curr++
	if l[i] != -1 {
		dfs(l[i])
		dfs(r[i])
		post[i] = post[r[i]]
	}
}

type Node struct {
	l, r, max, ind int
	left, right    *Node
}

func newNode(le, ri int) *Node {
	res := &Node{le, ri, 0, 0, nil, nil}
	if le != ri-1 {
		res.left = newNode(le, (le+ri)>>1)
		res.right = newNode((le+ri)>>1, ri)
	} else {
		res.ind = le
	}
	return res
}

func (n *Node) upd(ind, v int) {
	if n.left == nil {
		n.max = v
		n.ind = ind
		return
	}
	if ind < (n.l+n.r)>>1 {
		n.left.upd(ind, v)
	} else {
		n.right.upd(ind, v)
	}
	if n.left.max > n.right.max {
		n.max, n.ind = n.left.max, n.left.ind
	} else {
		n.max, n.ind = n.right.max, n.right.ind
	}
}

func (n *Node) query(le, ri int) (max, ind int) {
	if le <= n.l && ri >= n.r {
		return n.max, n.ind
	}

	if le >= n.r || ri <= n.l {
		return 0, 0
	}

	a, b := n.left.query(le, ri)
	c, d := n.right.query(le, ri)

	if a > c {
		return a, b
	} else {
		return c, d
	}
}

type DSU []int

func (d DSU) par(a int) int {
	if d[a] < 0 {
		return a
	}
	res := d.par(d[a])
	d[a] = res
	return res
}

func main() {
	in = bufio.NewReaderSize(os.Stdin, 8192)
	out = bufio.NewWriterSize(os.Stdout, 8192)
	name := "in"
	file1, err := os.Open(name + ".in")
	if err == nil {
		in = bufio.NewReaderSize(file1, 8192)
	}
	// file2, err := os.Create(name + ".out")
	// if err != nil {
	// 	log.Fatal(err)
	// }
	// out = bufio.NewWriterSize(file2, 8192)
	defer out.Flush()
	// start := time.Now()

	// for t, i := nextInt(), 1; t > 0; t, i = t-1, i+1 {
	// printf("Case #%d:\n", i)
	solve()
	// }

	// printf("%v\n", time.Now().Sub(start))
}


package main

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

var in *bufio.Reader
var out *bufio.Writer

func printf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, x, a...)
}

func scanf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fscanf(in, x, a...)
}

func scan(a ...interface{}) (n int, err error) {
	return fmt.Fscan(in, a...)
}

var err error

func next() (n string) {
	scan(&n)
	return n
}

func nextInt() (n int) {
	scan(&n)
	return n
}

func nextLong() (n int64) {
	scan(&n)
	return n
}

func nextDouble() (n float64) {
	scan(&n)
	return n
}

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

var (
	l, r, pre, post []int
	curr            int
)

func solve() {
	n, m, q := nextInt(), nextInt(), nextInt()

	p := make([]int, n)
	for i := range p {
		p[i] = nextInt()
	}

	edges := [][3]int{}
	for i := 0; i < m; i++ {
		edges = append(edges, [3]int{nextInt() - 1, nextInt() - 1, -1})
	}

	qs := [][3]int{}
	for i := 0; i < q; i++ {
		curr := [3]int{nextInt(), nextInt() - 1, 0}
		qs = append(qs, curr)
		if curr[0] == 2 {
			edges[curr[1]][2] = i
		}
	}

	dsu := make(DSU, n)
	for i := range dsu {
		dsu[i] = -1
	}

	l, r = make([]int, n), make([]int, n)
	for i := range l {
		l[i], r[i] = -1, -1
	}
	for _, v := range edges {
		a, b := dsu.par(v[0]), dsu.par(v[1])
		if v[2] != -1 {
			continue
		}
		if a == b {
			qs[v[2]][2] = a
		} else {
			dsu[a], dsu[b] = len(dsu), len(dsu)
			l, r = append(l, a), append(r, b)
			dsu = append(dsu, -1)
		}
	}

	for i := q - 1; i >= 0; i-- {
		if qs[i][0] == 1 {
			qs[i][2] = dsu.par(qs[i][1])
		} else {
			a, b := dsu.par(edges[qs[i][1]][0]), dsu.par(edges[qs[i][1]][1])
			if a == b {
				qs[i][2] = a
			} else {
				dsu[a], dsu[b] = len(dsu), len(dsu)
				l, r = append(l, a), append(r, b)
				dsu = append(dsu, -1)
			}
		}
	}

	pre, post = make([]int, len(l)), make([]int, len(l))
	curr = 0

	for i := len(l) - 1; i >= 0; i-- {
		if pre[i] == 0 {
			dfs(i)
		}
	}

	tree := newNode(0, len(l))
	for i, v := range p {
		tree.upd(pre[i], v)
	}

	for _, v := range qs {
		if v[0] == 1 {
			a, b := tree.query(pre[v[2]], post[v[2]])
			printf("%d\n", a)
			if a != 0 {
				tree.upd(b, 0)
			}
		}
	}
}

func dfs(i int) {
	pre[i], post[i] = curr, curr+1
	curr++
	if l[i] != -1 {
		dfs(l[i])
		dfs(r[i])
		post[i] = post[r[i]]
	}
}

type Node struct {
	l, r, max, ind int
	left, right    *Node
}

func newNode(le, ri int) *Node {
	res := &Node{le, ri, 0, 0, nil, nil}
	if le != ri-1 {
		res.left = newNode(le, (le+ri)>>1)
		res.right = newNode((le+ri)>>1, ri)
	} else {
		res.ind = le
	}
	return res
}

func (n *Node) upd(ind, v int) {
	if n.left == nil {
		n.max = v
		n.ind = ind
		return
	}
	if ind < (n.l+n.r)>>1 {
		n.left.upd(ind, v)
	} else {
		n.right.upd(ind, v)
	}
	if n.left.max > n.right.max {
		n.max, n.ind = n.left.max, n.left.ind
	} else {
		n.max, n.ind = n.right.max, n.right.ind
	}
}

func (n *Node) query(le, ri int) (max, ind int) {
	if le <= n.l && ri >= n.r {
		return n.max, n.ind
	}

	if le >= n.r || ri <= n.l {
		return 0, 0
	}

	a, b := n.left.query(le, ri)
	c, d := n.right.query(le, ri)

	if a > c {
		return a, b
	} else {
		return c, d
	}
}

type DSU []int

func (d DSU) par(a int) int {
	if d[a] < 0 {
		return a
	}
	res := d.par(d[a])
	d[a] = res
	return res
}

func main() {
	in = bufio.NewReaderSize(os.Stdin, 8192)
	out = bufio.NewWriterSize(os.Stdout, 8192)
	name := "in"
	file1, err := os.Open(name + ".in")
	if err == nil {
		in = bufio.NewReaderSize(file1, 8192)
	}
	// file2, err := os.Create(name + ".out")
	// if err != nil {
	// 	log.Fatal(err)
	// }
	// out = bufio.NewWriterSize(file2, 8192)
	defer out.Flush()
	// start := time.Now()

	// for t, i := nextInt(), 1; t > 0; t, i = t-1, i+1 {
	// printf("Case #%d:\n", i)
	solve()
	// }

	// printf("%v\n", time.Now().Sub(start))
}


package main

import "fmt"

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

func main() {
    var a, b uint64
    fmt.Scan(&a, &b)

    m := min(a, b)
    var res uint64 = 1
    for i:=1; i<=m; i++ {
        res *= i
    }
    fmt.Print(res)
}


package main

import (
	"fmt"
	"sort"
)

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

func main()  {
	var n, m int
	fmt.Scanln(&n,&m)
	fmt.Println(n,m)
	a := make([]int, n)
	b := make([]int, m)
	for i := 0; i < n; i++{
		if(i < n-1){
			fmt.Scanf("%d",&a[i])
		} else {
			fmt.Scanf("%d\n",&a[i])
		}
		//fmt.Printf("%d\n",a[i])
	}
	for i := 0; i < m; i++{
		if(i < m-1){
			fmt.Scanf("%d",&b[i])
		} else {
			fmt.Scanf("%d\n",&b[i])
		}
		//fmt.Printf("%d\n",b[i])
	}
	sort.Ints(a)
	sort.Ints(b)
	var ans int = 99999999
	for i := 0; i < n; i++{
		for j := 0; j < m; j++{
			if a[i] == b[j]{
				ans = min(ans,a[i])
			}
		}
	}
	if(ans == 99999999){
		ans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])
	}
	fmt.Println(ans)
}


package main

import (
	"fmt"
	"sort"
)

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

func main()  {
	var n, m int
	fmt.Scanf("%d %d\n",&n,&m)
	a := make([]int, n)
	b := make([]int, m)
	for i := 0; i < n; i++{
		if i != n-1{
			fmt.Scanf("%d",&a[i])
		}else{
			fmt.Scanf("%d\n",&a[i])
		}
	}
	for i := 0; i < m; i++{
		if i != m-1{
			fmt.Scanf("%d",&b[i])
		}else{
			fmt.Scanf("%d\n",&b[i])
		}

	}
	sort.Ints(a)
	sort.Ints(b)
	var ans int = 99999999
	for i := 0; i < n; i++{
		for j := 0; j < m; j++{
			if a[i] == b[j]{
				ans = min(ans,a[i])
			}
		}
	}
	if(ans == 99999999){
		ans = min(a[0] * 10 + b[0], b[0] * 10 + a[0])
	}
	fmt.Println(ans)


package main

import "fmt"

func main() {
	w := 0
	fmt.Scanf("%d\n", &w)

	canDivided := "NO"

	for i := 1; i <= w/2; i++ {
		if i%2 == 0 {
			canDivided = "YES"
		}
	}

	fmt.Println(canDivided)
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var i float64
	fmt.Scan(&i)
	if math.Mod(i/2, 2) == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import (
	"fmt"
)

func main() {
	var weight int32
	_, err := fmt.Scanf("%d", &weight)
	if err != nil {
		fmt.Println(err.Error())
	}

	if weight&1 == 1 {
		fmt.Print("NO")
		return
	}
	fmt.Print("YES")
}


package main

import "fmt"

// main function
func main() {
    var int temp
    fmt.Scanln(&temp)
    if(temp%2 == 0)
    {
        if((temp/2)%2 == 0) fmt.Println("YES")
        else fmt.Println("NO")
    }
}


package main

import "fmt"

// main function
func main() {
	var temp int = 8
	fmt.Scanln(&temp)
	if temp < 4 {
		fmt.Print("NO")
		return
	} else if temp%2 == 0 {
		if (temp/2)%2 == 0 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	} else {
		fmt.Println("NO")
	}
}


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

func main() {
  reader := bufio.NewReader(os.Stdin)
  text, _ := reader.ReadString('\n')
  text = strings.Replace(text, "\n", "", -1)

  num, err := strconv.Atoi(text)
  if err != nil {
    fmt.Print("NO")
    return
  }

  if num <= 0 || num > 100 || num%2 != 0 {
    fmt.Printf("NO")
    return
  }

  fmt.Printf("YES")
}


package main

import (
  "fmt"
)

func main() {
  var num int

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

  if num <= 0 || num > 100 || num%2 != 0 {
    fmt.Printf("NO")
    return
  }

  fmt.Printf("YES")
}


package main

import (
    "bufio"
    "strconv"
)

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    for scanner.Scan() {
        i, _ := strconv.Atio(scanner.Text())
        if i % 2 == 0 {
            println(i)
        }
    }
}


package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		i, _ := strconv.Atoi(scanner.Text())
		if i%2 == 0 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}


package main

import (
	"fmt"
)

func main() {
	var ves int
	fmt.Scan(&ves)
	if ves < 1 || ves > 100 {
		fmt.Println("Таких арбузов не бывает")
	} else {
		if ves%2 == 0 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}


// test
package main

import (
	"fmt"
)

func main() {

	var a int
	fmt.Scanln(&a)
	if a%2 == 1 {
		fmt.Println("NO")
	} else if a < 2 {

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

}


package main

import "fmt"

func main() {

	var weight int

	_, _ = fmt.Scanf("%d", &weight)

	if weight/2%2 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}


package main

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

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

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

func main() {
	defer writer.Flush()
	var number int
	scanf("%d", &number)
	if number == 2 {
		printf("YES")
	} else if number%2 == 0 {
		printf("YES")
	} else {
		printf("NO")
	}

}


package main

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

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

func main()  {
	var a int
	scanf("%d\n", &a)

	if !(a % 2 == 0) && a != 2 {
		printf("%s", "NO")
	} else {
		printf("%s", "YES")
	}

	writer.Flush()
}


package main

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

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

func main()  {
	var a int
	scanf("%d\n", &a)

	if !(a % 2 == 0) || a == 2 {
		printf("%s", "NO")
		return
	}

	printf("%s", "YES")

	writer.Flush()
}


package main

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

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

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

func main() {
	defer writer.Flush()

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

	if !(a%2 == 0) || a == 2 {
		printf("NO")
	}
	printf("YES")
}


package main

import (
  "bufio"  "fmt")

func main() {
   reader := bufio.NewReader(os.Stdin)
text:= reader.ReadString('\n')
if text > 2 $ text % 2 == 0{
fmt.Println('YES')
}
else{
    fmt.Println('NO')
}
}


package main

import "fmt"

func main() {
var i int
var two = 2;
 fmt.Scanf("%d", &i);
 if i > two {
 if i% two == 0{
 fmt.Print("YES");
 }
 }else{
fmt.Print("NO");
 }
}


package main

import (
	"fmt"
)

//https://codeforces.com/problemset/problem/4/A
func main() {
	var w int
	fmt.Scanf("%d", &w)
	if w >= 1 && w <= 100 {
		if w%2 == 0 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	} else {
		fmt.Println("NO")
	}
}


package main

import (
	"fmt"
)

func isDivide(k uint8) string {
	var i uint8
	if i%2 != 0 {
		return "NO"
	}
	if i == 2 {
		return "NO"
	}
	return "YES"
}

func main() {
	var k uint8
	fmt.Scanln(&k)
	fmt.Println(isDivide(k))

}


package main

import (
	"fmt"
)

func main() {
	var k uint8
	fmt.Scanln(&k)
	if k == 2 {
		fmt.Println("NO")
	}
	if k%2 != 0 {
		fmt.Println("NO")
	}
	fmt.Println("yes")
}


package main
import (
	"fmt"
	"os"
	"bufio"
	"strconv"
	)
func main() {
    reader := bufio.NewReader(os.Stdin)
    text, _ := reader.ReadString('\n')
    number, _ := strconv.Atoi(text)
    if number > 2 && number % 2 == 0 {
        fmt.Println("YES")
    }else{
        fmt.Println("NO")
    }

}


package main
import (
	"fmt"
	"os"
	"bufio"
	"strconv"
	)
func main() {
    number := 0
    fmt.Scanf("%d\n", &number)
    if number > 2 && number % 2 == 0 {
        fmt.Println("YES")
    }else{
        fmt.Println("NO")
    }

}


package main

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

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

	var n int
	fmt.Fscanf(r, "%d\n", &n)

	var s string
	fmt.Fscanf(r, "%s\n", &s)

	count := 0

	redo := true
	for redo {
		redo = false
		mp := make(map[int]bool)
		for i := 0; i < len(s)-1; i++ {
			if s[i] == s[i+1]+1 {
				for i < len(s)-1 && s[i] == s[i+1]+1 {
					mp[i] = true
					redo = true
					count++
					i++
				}
			} else if s[i] == s[i+1]-1 {
				for i < len(s)-1 && s[i] == s[i+1]-1 {
					mp[i+1] = true
					redo = true
					count++
					i++
				}
			}
		}

		b := new(strings.Builder)
		for i := 0; i < len(s); i++ {
			if !mp[i] {
				fmt.Fprintf(b, "%c", s[i])
			}
		}

		s = b.String()
	}

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


package main

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

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

	var n int
	var s []byte
	Fscan(in, &n, &s)

	if n == 1 {
		Fprintln(out, 0)
		return
	}
	s = append([]byte{0}, s...)
	s = append(s, 0)

	ans := 0
	s2 := []byte{}
	for i := byte('z'); i >= 'a'; i-- {
		lp := 0
		for j, b := range s {
			//if j > 0 && lc == 0 {
			//	lc = s[j-1]
			//}
			if b == i && (s[j]-1 == s[lp] || s[j]-1 == s[j+1]) {
				ans++

			} else {
				s2 = append(s2, b)
				lp = j
			}
		}
		s = s2
		s2 = []byte{}
	}

	Fprintln(out, ans)

}

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


// Author: sighduck
// URL: https://codeforces.com/problemset/problem/1321/C

package main

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

func Solve(n int, s string) int {
	a := make([]int, n)
	for i, elem := range s {
		a[i] = int(elem)
	}
	for i := 122; i >= 97; i-- {
		for j := 0; j < len(a); j++ {
			if a[j] == i && ((j+1 < len(a) && a[j+1] == i-1) || (j-1 >= 0 && a[j-1] == i-1)) {
				a = append(a[:j], a[j+1:]...)
				j -= 1
			}
		}
	}
	return n - len(a)
}

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

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

	fmt.Fprintf(writer, "%d\n", Solve(n, s))
}


/*
URL:
https://codeforces.com/problemset/problem/992/B
*/

package main

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

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

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

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

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

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

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

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

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

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

var (
	l, r, x, y int64
)

func main() {
	l, r, x, y = ReadInt64_4()

	ans := 0
	for i := x; i*i <= y; i += x {
		if y%i == 0 {
			a := i
			b := y / i

			// bはxを約数に保たない
			if Gcd(b, x) != 1 {
				continue
			}
			b *= x

			if l <= a && a <= r && l <= b && b <= r && Gcd(a, b) == x && Lcm(a, b) == y {
				if a == b {
					ans++
				} else {
					ans += 2
				}
			}
		}
	}

	fmt.Println(ans)
}

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

	if a == 0 {
		return b
	}
	if b == 0 {
		return a
	}

	if a < b {
		a, b = b, a
	}

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

	return a
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	return res
}

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

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

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

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

	return string(res)
}

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

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

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

	return string(res)
}

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

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


package main

import (
	"fmt"
)

func main() {
	var sum, xor int
	fmt.Scan(&sum, &xor)

	if ((sum - xor) % 2) != 0 {
		fmt.Println(0)
		return
	}
	xorbits := 0
	sumbits := 0
	mask := 1

	for mask <= xor && mask <= sum {
		if xor&mask > 0 {
			xorbits++
		}
		if sum&mask > 0 {
			sumbits++
		}
		mask <<= 1
	}
	xorbits *= 2

	if sum&xor == sum {
		xorbits -= sumbits
	}
	fmt.Println(xorbits)
}


package main

import (
	"fmt"
)

func main() {
	fmt.Println("vim-go")

	var s string
	fmt.Scan(&s)

	p := len(s)
	for s[p-1] == '0' {
		p--
	}

	for i := 0; i < p; i++ {
		if s[i] != s[p-1-i] {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var n int

	fmt.Scanf("%d", &n)
	fmt.Println(math.Pow(2.0, float64(n)))
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var i, n int64

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

	total := 0
	for i = 1; i <= n; i++ {
		total += int64(math.Pow(2.0, float64(i)))
	}
	fmt.Println(total)
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var n float64
	fmt.Scanf("%f", &n)
	fmt.Println(int64(math.Pow(2, n+1) - 2))
}


package main

import "fmt"

func main() {
  var w int
  fmt.Scanln(&w)
  if w % 4 == 0
    fmt.Println("YES")
  else
    fmt.Println("NO")
}


package main

import "fmt"

func main() {
  var w int
  fmt.Scanln(&w)
  if w % 4 == 0 {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}


package main

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

func main() {
	input, _ := strconv.Atoi(os.Args[1])
	if input%2 == 0 {
		fmt.Print("YES")
		return
	}
	fmt.Print("NO")
}


package main

import (
	"fmt"
)

func main() {
	var input int
	fmt.Scanf("%d", &input)
	if input > 2 || input%2 == 0 {
		fmt.Print("YES")
		return
	}
	fmt.Print("NO")
}


package main

import "fmt"

func main() {
	var weight int
	fmt.Scanf("%d", &weight)
	if weight > 0 && weight%2 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


func main() {
	fmt.Println("Enter weight of the watermelon: ")
	var wt int
	// Taking input from user
	fmt.Scanln(&wt)

	if wt%2 == 0 {
		fmt.Println("YES")
	}
	fmt.Println("NO")

}


package main

import "fmt"

func main() {
	var wt int
	// Taking input from user
	fmt.Scanln(&wt)

	if wt%2 == 0 && wt != 2 {
		fmt.Println("YES")
	}
	fmt.Println("NO")

}


package main

import "fmt"

func main() {
	w := 0
	fmt.Scanf("%d", &w)
	if w%2 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

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

func main() {

	melon, _ := strconv.Atoi(os.Args[1])
	if melon % 2 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}


package main

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

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

	t, _ := reader.ReadString('\n')

	w, _ := strconv.Atoi(t)
	if w <= 100 && w >= 1 {
		if w%2 == 0 && w != 2 {
			fmt.Print("YES")
		} else {
			fmt.Print("NO")
		}

	}

}


package main
import (
	"fmt"
)

func main() {
	var a int
	fmt.Scan(&a)
	if a%2==0&&a>0&&a<101 {
		fmt.Println("YES")
	} else{
		fmt.Println("NO")
	}
}


package main

import "fmt"

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

	if w == 1 {
		fmt.Println("NO")
		return
	}
	for i := 2; i <= w/2; i++ {
		if w%i == 0 {
			fmt.Println("YES")
			return
		}
	}
	fmt.Println("NO")
}


package main

import(
"fmt"
)

func main(){
	var weight int
	_, _ = fmt.Scanf("%d", &weight)
	if weight % 2 == 0 && weight > 1{
		fmt.Println("YES")
	}else{
		fmt.Println("NO")
	}
}


package main

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

func main(){
	fmt.Print(getStatus())
}

func getInput() int{
	reader := bufio.NewReader(os.Stdin)
	s, err := reader.ReadString('\n')

	if err != nil && err != io.EOF{
		log.Fatal(err)
	}
	s = strings.TrimRight(s, "\r\n")

	w, err := strconv.Atoi(s)
	if err != nil && err != io.EOF{
		log.Fatal(err)
	}
	return w
}

func getStatus() string{
	w := getInput()

	if w%2 == 0 && w > 1{
		return "YES"
	}
	return "NO"
}


package main

import (
    "fmt"
)

func main() {
    var n int
    _, _ = fmt.Scanf("%d\n", &n)
    if n % 2 == 0 {
        return "YES"
    }
    return "NO"
}


package main

import (
	"fmt"
)

func main() {
	var n int
	_, _ = fmt.Scanf("%d\n", &n)
	if n%2 == 0 && (n/2)%2 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)
	if n%2 == 0 {
		fmt.Printf("YES")
	} else {
		fmt.Printf("NO")
	}
}


package main

import (
        "fmt"
)

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

        if(i%2==0 && (i/2)%2==0){
                fmt.Println("YES")
        } else {
                fmt.Println("NO")
        }
}


package main

import "fmt"

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

	if n%2 == 0 && n > 2 {
		println("YES")
	} else {
		println("NO")
	}
}


package main

import "fmt"

func check(weight int)  {
	if weight%2 != 0 || weight ==2 {
		fmt.Println("NO")
	}else {
		fmt.Println("YES")
	}
}


package cf

func Watermelon(n int) bool {
	return n%2 == 0
}


package main

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

var inputReader *bufio.Reader
var input string
var err error

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

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

	var T int
	Fscan(in, &T)
	if T >= 2 && T%2 == 0 {
		Fprintln(out, "YES")
	} else {
		Fprintln(out, "NO")
	}
}


import (
	"fmt"
)

func main() {
	var kilo int8
	_, _ = fmt.Scan(&kilo)
	//reader := bufio.NewReader(os.Stdin)
	//text, _ := reader.ReadString('\n')
	//integer, _ := strconv.Atoi(text)

	if (kilo/2)%2 == 0 {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var kilo float64
	_, _ = fmt.Scan(&kilo)
	//reader := bufio.NewReader(os.Stdin)
	//text, _ := reader.ReadString('\n')
	//integer, _ := strconv.Atoi(text)

	if math.Mod(kilo/2.0, 2) == 0 {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	text, _, _ := reader.ReadLine()

	att1, _ := strconv.ParseInt(text, 10, 0)
	if att1%2 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	text, _, _ := reader.ReadLine()

	str := string(text)

	att1, _ := strconv.ParseInt(str, 10, 0)
	if att1%2 == 0 || att1 != 2 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}


package main

import "fmt"
func main(){
    var w int
    fmt.Scanf("%d", &w)
     if w % 2 == 0 && w != 0 {fmt.Println("Yes")
    }else  {fmt.Println("No")}

}


package main

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	return res
}

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

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

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

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

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

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

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

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

	return res
}

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

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

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

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

	res := 0

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

	return res
}

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

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

	return res
}

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

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

	return s
}

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

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

	if e == 0 {
		return 1
	}

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

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

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

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

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

	return a
}

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

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

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

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

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

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

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

	return string(res)
}

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

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

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

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

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var n, m int

var adjMatrix [10][10]int
var dominoMatrix [10][10]int

func main() {
	n, m = ReadInt2()
	for i := 0; i < m; i++ {
		a, b := ReadInt2()
		// 常にaをbより小さくする
		if a > b {
			a, b = b, a
		}
		adjMatrix[a][b] = 1
		adjMatrix[b][a] = 1
	}

	if n <= 6 {
		fmt.Println(m)
	} else {
		fmt.Println(sub())
	}
}

func sub() int {
	res := 0

	// i, jを同じ数字とする
	for i := 1; i <= n; i++ {
		for j := i + 1; j <= n; j++ {
			// ノードにサイコロの目を割り振る
			memo := make(map[int]int)
			dice := 1
			for k := 1; k <= n; k++ {
				if k == j {
					continue
				}
				memo[k] = dice
				dice++
			}
			memo[j] = memo[i]

			tmp := 0
			initialize()
			for l := 1; l <= n; l++ {
				for m := l + 1; m <= n; m++ {
					ll, mm := memo[l], memo[m]
					if adjMatrix[l][m] == 1 && dominoMatrix[ll][mm] == 1 {
						tmp++
						dominoMatrix[ll][mm] = 0
					}
				}
			}

			ChMax(&res, tmp)
		}
	}

	return res
}

func initialize() {
	for i := 1; i <= 6; i++ {
		dominoMatrix[i][i] = 1
		for j := i + 1; j <= 6; j++ {
			dominoMatrix[i][j] = 1
		}
	}
}

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

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


package main

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

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

	var n, m int
	Fscan(in, &n, &m)
	edges := make([][]int, n+1)
	shown := map[int]int{}
	for i := 0; i < m; i++ {
		var v, w int
		Fscan(in, &v, &w)
		edges[v] = append(edges[v], w)
		edges[w] = append(edges[w], v)
		shown[v] = 1
		shown[w] = 1
	}
	if len(shown) <= 6 {
		Fprintln(out, m)
		return
	}

	minDeg := 7
	for _, e := range edges {
		if len(e) > 0 && len(e) < minDeg {
			minDeg = len(e)
		}
	}
	ans := 0
	for v, e := range edges {
		if len(e) != minDeg {
			continue
		}
		for w, e2 := range edges {
			if w == v || len(e2) == 0 {
				continue
			}
			delta := 0
			for _, ee := range e2 {
				if ee == v {
					delta = 1
					break
				}
			}
			mp := map[int]int{}
			for _, ee := range append(e, e2...) {
				if ee == v {
					ee = w
				}
				mp[ee] = 1
			}
			delta = len(e) + len(e2) - delta - len(mp)
			if newAns := m - delta; newAns > ans {
				ans = newAns
			}
		}
	}
	Fprintln(out, ans)
}

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


// Author: sighduck
// URL: https://codeforces.com/contest/1230/problem/C

package main

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

type Edge struct {
	A int
	B int
}

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

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

func Solve(n int, m int, edges []Edge) int {
	if n < 7 {
		return m
	}
	degreeCount := make([]int, n)
	for _, edge := range edges {
		degreeCount[edge.A-1] += 1
		degreeCount[edge.B-1] += 1
	}
	maxDominoes := 0
	for _, degree := range degreeCount {
		maxDominoes = max(maxDominoes, m-degree+min(degree, 1))
	}
	return min(maxDominoes, 16)
}

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

	var n, m int
	fmt.Fscanf(reader, "%d %d\n", &n, &m)
	edges := make([]Edge, m)
	for i := 0; i < m; i++ {
		fmt.Fscanf(reader, "%d %d\n", &edges[i].A, &edges[i].B)
	}

	fmt.Fprintf(writer, "%d\n", Solve(n, m, edges))
}


package main

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

var local = false
var scanner *bufio.Scanner

func main() {
	setup()
	n := readInt()

	total, a, b := 0, -1, -1
	for i := 0; i < n; i++ {
		c := readInt()
		if i >= 2 {
			isLocMin := b < a && b < c
			isLocMax := b > a && b > c
			if isLocMin || isLocMax {
				total++
			}
		}

		a, b = b, c
	}

	fmt.Println(total)
}

func setup() {
	source := os.Stdin
	if local == true {
		file, _ := os.Open("input.txt")
		source = file
	}
	scanner = bufio.NewScanner(source)
	scanner.Split(bufio.ScanWords)
}

func readInt() int {
	scanner.Scan()
	ans, _ := strconv.ParseInt(scanner.Text(), 10, 0)
	return int(ans)
}


package main

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

var n int
var s string
var res int
var m map[byte]int

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

func main() {
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &n)
	fmt.Fscan(in, &s)
	m = make(map[byte]int)

	for i:= 0; i < len(s); i++ {
		m[s[i]]++
	}

	res = min(m['U'], m['D']) + min(m['L'], m['R'])

	fmt.Printf("%d", res*2)
}


package main

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

var scanner *bufio.Scanner

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

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

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

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

	writer.WriteString(fmt.Sprintf("%d", Problem888B()))
}

func Problem888B() int {
	n := getI()
	x := 0
	y := 0
	for i:= 0; i < n ; i++ {
	    s := getS()
	    switch(s){
	        case "U":
	            y+=1
	            break
	        case "D":
	            y-=1
	            break
	        case "L":
	            x-=1
	            break
	        case "R":
	            x+=1
	            break
	        default:
	            break
	    }
	}
	return n - (x-y)
}


package main

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

var scanner *bufio.Scanner

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

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

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

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

	writer.WriteString(fmt.Sprintf("%d", Problem888B()))
}

func Problem888B() int {
	n := getI()
	x := 0
	y := 0
	s := getS()
	for _, char := range s {
		switch char {
		case 'U':
			y+=1
			break
		case 'D':
			y-=1
			break
		case 'L':
			x-=1
			break
		case 'R':
			x+=1
			break
		default:
			break
		}
	}

	return n - (x+y)
}


package main

import (
	"fmt"
)

func main(){
	var n int
	fmt.Scan(&n)
	var s string
	fmt.Scan(&s)
	max := 0
	for i := 0; i < len(s)-1; i++ {
		temp := 0
		maxTemp := 0
		x := 0
		y := 0
		for j := i; j < len(s); j++ {
			temp++
			switch s[j] {
			case'L':
				x--
			case 'R':
				x++
			case 'U':
				y++
			case 'D':
				y--
			}
			if x==0&&y==0 {
				maxTemp = temp
			}
		}
		if maxTemp > max {
			max = maxTemp
		}
	}
	fmt.Print(max)
}


// https://codeforces.com/problemset/problem/888/B
package main

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

func isAtOrigin(pos []int) bool {
	if pos[0] == 0 && pos[1] == 0 {
		return true
	}
	return false
}

func move(pos []int, move rune) {
	switch move {
	case 'U':
		pos[1]++
	case 'D':
		pos[1]--
	case 'L':
		pos[0]--
	case 'R':
		pos[0]++
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	var lastTimeAtOrigin int64 = 0
	pos := []int{0, 0}
	scanner.Scan()
	cmds := scanner.Text()
	for i, cmd := range cmds {
		move(pos, cmd)
		if isAtOrigin(pos) {
			lastTimeAtOrigin = int64(i+1)
		}
	}
	fmt.Printf("%d", lastTimeAtOrigin)

}


// https://codeforces.com/problemset/problem/888/B
package main

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

func move(pos []int, move rune) {
	switch move {
	case 'U':
		pos[1]++
	case 'D':
		pos[1]--
	case 'L':
		pos[0]--
	case 'R':
		pos[0]++
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	numCommands, _ := strconv.ParseInt(scanner.Text(), 10, 32)
	pos := []int{0, 0}
	scanner.Scan()
	cmds := scanner.Text()
	for i, cmd := range cmds {
		move(pos, cmd)
		// fmt.Printf("%d - current position - %d, %d\n", i+1, pos[0], pos[1])
	}
	fmt.Printf("%d", numCommands - int64(math.Abs(float64(pos[0]- 0))) - int64(math.Abs(float64(pos[1]-0))))
}


package main

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

var (
	in  *bufio.Reader
	out *bufio.Writer
)

func init() {
	in = bufio.NewReader(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
}

type prop struct {
	hp, atk, def int
}

func live(hp, dmg int) int {
	if dmg <= 0 {
		return 1000000000
	}
	return (hp + dmg - 1) / dmg
}

func main() {
	defer out.Flush()
	var (
		y, m prop
		h, a, d int
	)
	fmt.Fscan(in, &y.hp, &y.atk, &y.def)
	fmt.Fscan(in, &m.hp, &m.atk, &m.def)
	fmt.Fscan(in, &h, &a, &d)
	ans := 205 * h + 205 * a + 205 * d
	for bh := 0; bh <= 205; bh++ {
		for ba := 0; ba <= 205; ba++ {
			for bd := 0; bd <= 205; bd++ {
				pr := bh * h + ba * a + bd * d
				if pr >= ans {
					continue
				}
				if live(y.hp + bh, m.atk - (y.def + bd)) > live(m.hp, (y.atk + ba) - m.def) {
					ans = pr
				}
			}
		}
	}
	fmt.Fprintln(out, ans)
}


package main

import "fmt"

var s string
func main(){
    fmt.Scanf("%s", &s)
    at := false
    dot := false
    result := string(s[0])
    sz := len(s)
    for i:=1; i<sz-1; i++{
        if s[i]=='d'{
            dot = search(i+1, "ot")
            if dot{
                result += "."
                i+=2
                continue
            }
        }
        if s[i]=='a' && !at{
            at = search(i+1, "t")
            if at {
                result += "@"
                i+=1
                continue
            }
        }
        result += string(s[i])
    }
    result += string(s[sz-1])
    fmt.Println(result)
 }

 func search(i int, match string) bool{
     for j:=0; j<len(match); j++{
        if i >= len(s){
            return false
        }
        if s[i] != match[j]{
            return false
        }
        i++
     }
     return true
 }


package main

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

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

const BITS = 15

var s, x int

func main() {
	defer out.Flush()
	fmt.Fscan(in, &s, &x)

	//for i := 0; i < BITS; i++ {
	//	fmt.Fprint(out, get(i, s))
	//}
	//fmt.Fprintln(out)
	//for i := 0; i < BITS; i++ {
	//	fmt.Fprint(out, get(i, x))
	//}
	//fmt.Fprintln(out)

	ans := solve(0, 0)
	if s == x {
		ans -= 2
	}
	fmt.Fprintln(out, ans)
}

func solve(i, carry int) int64 {
	if i == BITS {
		if carry == 0 {
			return 1
		}
		return 0
	}
	key := Key{i, carry}
	if result, ok := cache[key]; ok {
		return result
	}
	result := int64(0)
	for a := 0; a <= 1; a++ {
		b := a ^ get(i, x)
		sum := a + b + carry
		if sum&1 == get(i, s) {
			//fmt.Fprintln(out, i, a, b, carry, "works", sum>>1)
			result += solve(i+1, sum>>1)
		}
	}
	//fmt.Fprintln(out, i, carry, ">", result)
	cache[key] = result
	return result
}

var cache = map[Key]int64{}

type Key struct {
	i, carry int
}

func get(i, x int) int {
	return (x >> uint(i)) & 1
}


package main
import "fmt"

func main() {
	var pp, dd, x, y, t, w, h int64
	w=1
	fmt.Scan(&pp, &dd)
	x=pp-dd
	y=pp
	for {
		t=y
		w*=10
		h=pp%w
		if h==w-1 {
			h--
		}
		y=pp-(h+1)
		if y<x {
			break
		}
	}
	fmt.Println(t)
}


package main

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

func solve() {
	n := readInt()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = readInt()
	}
	start := 0
	if a[0]%2 == 0 || a[n-1]%2 == 0 {
		fmt.Println("No")
		return
	}
	total := 0
	for i := 0; i < n; i++ {
		if a[i]%2 == 1 && (i-start+1)%2 == 1 {
			if i+1 < n && a[i+1]%2 == 1 {
				// fmt.Printf("a = %+v\n", a[start:i+1])
				start = i + 1
				total++
			}
		}
	}
	if a[n-1]%2 == 1 && (n-start)%2 == 1 {
		// fmt.Printf("a = %+v\n", a[start:n])
		total++
		if total%2 == 1 {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}

var scanner *bufio.Scanner

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

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

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

// IO

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

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

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

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

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


package main

import (
	"fmt"
)

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

	for i := n; i > 0; i-- {
		if i%2 == 0 {
			if x == 2 {
				x = 1
			} else if x == 1 {
				x = 2
			}
		} else {
			if x == 0 {
				x = 1
			} else if x == 1 {
				x = 0
			}
		}
	}

	fmt.Print(x)
}


package main

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

func main() {

	// n, _ := strconv.ParseInt(readInput(), 10, 32)

	// x, _ := strconv.ParseInt(readInput(), 10, 32)

	n := 2000000000
	//	n = n % 6
	x := 1

	fmt.Println(n, x)

	for n != 0 {

		if n%2 == 0 {
			if x == 1 {
				x = 2
			} else if x == 2 {
				x = 1
			}
		}

		if n%2 == 1 {
			if x == 1 {
				x = 0
			} else if x == 0 {
				x = 1
			}
		}

		n--
	}
	fmt.Println(x)

}

func readInput() (s string) {
	in := bufio.NewReader(os.Stdin)
	var err error
	if s, err = in.ReadString(byte('\n')); err != nil {
		log.Fatal(err)
	}
	s = s[:len(s)-1]

	return s
}


package main

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

func main() {

	n, _ := strconv.ParseInt(readInput(), 10, 32)

	x, _ := strconv.ParseInt(readInput(), 10, 32)

	// n := 2000000000
	n = n % 6
	// x := 1

	for n != 0 {

		if n%2 == 0 {
			if x == 1 {
				x = 2
			} else if x == 2 {
				x = 1
			}
		}

		if n%2 == 1 {
			if x == 1 {
				x = 0
			} else if x == 0 {
				x = 1
			}
		}

		n--
	}

	fmt.Println(x)

}

func readInput() (s string) {
	in := bufio.NewReader(os.Stdin)
	var err error
	if s, err = in.ReadString(byte('\n')); err != nil {
		log.Fatal(err)
	}
	s = s[:len(s)-1]

	return s
}


package main

import "fmt"

func main() {
	var arr [3]bool
	var testcount, a int
	fmt.Scanf("%d\n%d", &testcount, &a)
	for j := 0; j < 3; j++ {
		arr[j] = true
		for i := 1; i <= testcount; i++ {
			if i%2 == 0 {
				arr[1], arr[2] = arr[2], arr[1]
			} else {
				arr[0], arr[1] = arr[1], arr[0]
			}
		}
		if arr[a] {
			fmt.Println(j)
			break
		}
	}
}


package main

import "fmt"

func main() {
	var arr [3]bool
	var testcount, a int
	fmt.Scanf("%d\n%d", &testcount, &a)
	for j := 0; j < 3; j++ {
		arr[j] = true
		for i := 1; i <= testcount; i++ {
			if i%2 == 0 {
				arr[1], arr[2] = arr[2], arr[1]
			} else {
				arr[0], arr[1] = arr[1], arr[0]
			}
		}
		if arr[a] {
			fmt.Println(j)
			break
		} else {
			arr[0], arr[1], arr[2] = false, false, false
		}
	}
}


package main

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

func main() {
	sc := NewScanner()
	N, x := sc.NextInt(), sc.NextInt()
	n := N
	if x == 1 {
		n = N % 6
	} else {
		if x == 2 {
			if N%2 == 1 {
				N--
			} else {
				n = N % 6
			}
		} else {
			if N%2 == 0 {
				N--
			} else {
				n = N % 6
			}
		}
	}

	for i := n; i > 0; i-- {
		if i%2 == 1 {
			if x == 1 {
				x = 0
			} else if x == 0 {
				x = 1
			}
		} else {
			if x == 1 {
				x = 2
			} else if x == 2 {
				x = 1
			}
		}
	}
	fmt.Println(x)

}

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 a, ta, b, tb int
  var h, m int
  fmt.Scanf("%d %d\n",&a, &ta)
  fmt.Scanf("%d %d\n", &b, &tb)
  fmt.Scanf("%d:%d", &h, &m)

  start := 300
  end   := 60 * 24 - 1

  meets := 0

  simon_start := h * 60 + m
  simon_end := simon_start + ta
  //fmt.Println(simon_start, simon_end)
  for start <= end {
    bus_start := start
    bus_end   := start + tb

    if (bus_start < simon_end && bus_start >= simon_start) || (bus_end < simon_end && bus_end > simon_start) {
      meets++
      //fmt.Println(bus_start, bus_end)
    }
    //next bus from B
    start += b
  }

  fmt.Println(meets)
}


package main

import (
	"fmt"
)

func main() {
	var n int;
	fmt.Scanf("%d",&n)
	a := make([]int,50)
	var i int
	var tmp string
	for i = 0;i < n;i++ {
		for {
			fmt.Scanf("%s",&tmp)
			if tmp == "" {
				continue
			}
			if tmp != "\n" {
				a[i] = (int)(tmp[0])
				tmp = ""
				break;
			}
		}
	}

	var flag bool = false;
	for i  = 1;i < n;i++ {
		if(a[i] - a[i-1] >= 2 || a[i] - a[i-1] <= -2 ){
			flag = true;
			break;
		}
	}
	if flag {
		fmt.Println("NO");
	}else {
		fmt.Println("YES");
	}

}


package main

import (
	"fmt"
)

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

	var s string
	fmt.Scan(&s)

	toF := 0
	toS := 0
	for i := 1; i < n; i++ {
		if s[i] != s[i-1] {
			if s[i] == 'F' {
				toF++
			} else {
				toS++
			}
		}
	}

	if toF > toS {
		println("YES")
	} else {
		println("NO")
	}
}


package main

import (
	"fmt"
	"strings"
)
var a string
var b int

func help() {
	fmt.Scan(&a)
	fmt.Scan(&b)
    if strings.Count(a, "FS") < strings.Count(a, "SF"){
        fmt.Print("YES")
    } else{
        fmt.Print("NO")
    }
}

func main() {
	help()
}


package main
import (
	"fmt"
	"strings"
)

func main(){
	var len int
	var way string
	fmt.Scan(&len)
	fmt.Scan(&way)
	S := Count(way,"SF")
	SF := Count(way,"FS")
	if S > SF{
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}


package main

import "fmt"

func main() {
	var x string
	var lengthString int
	var countSI, countSF int

	fmt.Scan(&lengthString)
	fmt.Scan(&x)

	for i:=0; i < lengthString - 2; i++ {
		if string(x[i]) == "S" && string(x[i+1]) == "F" {
			countSI ++
		}

		if string(x[i]) == "F" && string(x[i+1]) == "S" {
			countSF ++
		}
	}

	if countSI > countSF {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import (
    "fmt"
    "strings"
)
 func main() {
    var l int
    var str string
    fmt.Scan(&l, &str)
    fs := s.Count(str, "FS")
    sf := s.Count(str, "SF")
    if sf > fs {
        fmt.Println("YES")
    } else {
        fmt.Println("NO")
    }
}


package main
import (
 "fmt"
)
func main(){
  var n,l int
  var s string
  fmt.Scan(&n,&s)
  for i:=1;i<n;i++ {
    if s[i-1] == 'S' && s[i] == 'F' {
      l++
    } else if s[i-1] == 'F' && s[i] == 'S' {
      l--
    }
  }
  O := "YES"
  if l < 0 {
    o = "NO"
  }
  fmt.Println(o)
}


package main
import (
 "fmt"
)
func main(){
  var n,l int
  var s string
  fmt.Scan(&n,&s)
  for i:=1;i<n;i++ {
    if s[i-1] == 'S' && s[i] == 'F' {
      l++
    } else if s[i-1] == 'F' && s[i] == 'S' {
      l--
    }
  }
  o := "YES"
  if l < 0 {
    o = "NO"
  }
  fmt.Println(o)
}


package main

import (
	"fmt"
)

func sol(s string) string {
	f2s := 0
	s2f := 0
	curr := s[0]
	for i := 1; i < len(s); i++ {
		if curr == 'F' && s[i] == 'S' {
			f2s++
		} else if curr == 'S' && s[i] == 'F' {
			s2f++
		}
	}
	if s2f > f2s {
		return "YES"
	}
	return "NO"
}

func main() {
	var s string
	fmt.Scanln(&s)
	fmt.Scanln(&s)
	fmt.Println(sol(s))
}


package main

import "fmt"

func main () {

	var n int64

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

	t := n
	i := 0

	for {

		if n % 2 == 0{
			n >>= 1
			i++
		} else {
			break
		}
	}

	if n == 1 {
		fmt.Println(i)
	} else {
		fmt.Println(t)
	}

}


package main

import "fmt"

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

	n++
	if n%2 == 0 {
		fmt.Println(n / 2)
	} else {
		fmt.Println(n)
	}
}


package main

import "fmt"

func Process(n int64) (int64) {
	if (n+1)%2 == 0 {
		return (n + 1) / 2
	} else {
		return n + 1
	}
}

func main() {

	var n int64

	fmt.Scanln(&n)

	fmt.Println(Process(n))
}


package main

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

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

	var n int64
	fmt.Fscan(in, &n)
	n += 1
	if n & 1 == 1 {
		fmt.Fprint(out, n)
	} else {
		fmt.Fprint(out, n/2)
	}
}


package main

import "fmt"

func main() {
	var n uint64
	fmt.Scan(&n)
	n++
	if n%2 == 0 {
		n /= 2
	}
	fmt.Println(n)
}


package main

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

type obsh struct {
	Num  int
	Self int64
	Sum  int64
}

func main() {
	var n int64
	fmt.Scanf("%d\n", &n)
	for i:=0;i<=18;i++{
		if math.Pow(2, float64(i)) == float64(n+1){
			fmt.Println((n+1)/2)
			os.Exit(0)
		}
	}
	fmt.Println(n+1)
}


package main
import (
	"fmt"
)

func main(){
	var n int
	fmt.Scanln(&n)
	n += 1

	if n % 2 == 0{
		fmt.Print(n/2)
	}else{
		fmt.Print(n)
	}
}


package main

import "fmt"

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


package main

import "os"
import "bufio"
import "strconv"
import "sort"

func main(){
	x := make([]int, 8)
	y := make([]int, 8)
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	for i:=0; i<8; i++ {
		r.Scan()
		x[i], _ = strconv.Atoi(r.Text())
		r.Scan()
		y[i], _ = strconv.Atoi(r.Text())
	}
	for j:=0; j<8; j++ {
		for k:=j+1; k<8; k++ {
			if x[j] == x[k] && y[j] == y[k] {
				w.WriteString("ugly\n")
				w.Flush()
				return
			}
		}
	}
	sort.Ints(x)
	sort.Ints(y)
	if x[1] == x[0] && x[2] == x[1] && x[4] == x[3] && x[7] == x[6] && x[5] == x[7] && x[3] > x[0] && x[6] > x[3] && y[3] > y[2] && y[5] > y[4] && y[4] == y[3] && y[0] == y[1] && y[1] == y[2] && y[6] == y[7] && y[5] == y[6] && y[3] != y[1] {
		w.WriteString("respectable\n")
	}
	w.Flush()
}


package main

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

type Scanner struct {
  r            io.Reader
  split        bufio.SplitFunc
  maxTokenSize int
  token, buf   []byte
  start, end   int
}

func NewScanner(r io.Reader) *Scanner {
  return &Scanner{
    r:            r,
    split:        bufio.ScanWords,
    maxTokenSize: 16777216,
    buf:          make([]byte, 4096),
  }
}

func (s *Scanner) advance(n int) bool {
  if n < 0 || n > s.end-s.start {
    return false
  }
  s.start += n
  return true
}

func (s *Scanner) Text() string {
  return string(s.token)
}

func (s *Scanner) Scan() bool {
  for {
    if s.end > s.start {
      advance, token, err := s.split(s.buf[s.start:s.end], false)
      if err != nil || !s.advance(advance) {
        return false
      }
      s.token = token
      if token != nil {
        return true
      }
    }
    if s.start > 0 && (s.end == len(s.buf) || s.start > len(s.buf)/2) {
      copy(s.buf, s.buf[s.start:s.end])
      s.end -= s.start
      s.start = 0
    }
    if s.end == len(s.buf) {
      if len(s.buf) >= s.maxTokenSize {
        return false
      }
      newSize := len(s.buf) * 2
      if newSize > s.maxTokenSize {
        newSize = s.maxTokenSize
      }
      newBuf := make([]byte, newSize)
      copy(newBuf, s.buf[s.start:s.end])
      s.buf = newBuf
      s.end -= s.start
      s.start = 0
      continue
    }
    for loop := 0; ; {
      n, _ := s.r.Read(s.buf[s.end:len(s.buf)])
      s.end += n
      if n > 0 {
        break
      }
      loop++
      if loop > 100 {
        break
      }
    }
  }
}

func (s *Scanner) Split(split bufio.SplitFunc) {
  s.split = split
}

var w *bufio.Writer = bufio.NewWriter(os.Stdout)
var sc *Scanner = NewScanner(os.Stdin)

func next() string { sc.Scan(); return sc.Text() }
func nc() byte     { sc.Scan(); return sc.Text()[0] }

func ni32() int {
  sc.Scan()
  n, _ := strconv.Atoi(sc.Text())
  return n
}

func ni64() int64 {
  sc.Scan()
  n, _ := strconv.ParseInt(sc.Text(), 10, 64)
  return n
}

func pri32(i ...int) {
  for _, ii := range i {
    w.WriteString(strconv.Itoa(ii))
    sp()
  }
}
func pri64(i ...int64) {
  for _, ii := range i {
    w.WriteString(strconv.FormatInt(ii, 10))
    sp()
  }
}
func sp()   { w.WriteByte(' ') }
func endl() { w.WriteByte('\n') }

func main() {
  x, y := make([]int, 8), make([]int, 8)
  for i := 0; i < 8; i++ {
    x[i], y[i] = ni32(), ni32()
  }
  // for i := 0; i < 8; i++ {
  //   for j := i + 1; j < 8; j++ {
  //     if x[j] < x[i] || (x[j] == x[i] && y[j] < y[i]) {
  //       x[i], y[i], x[j], y[j] = x[j], y[j], x[i], y[i]
  //     }
  //   }
  // }
  xx, yy := make([]int, 8), make([]int, 8)
  copy(xx, x)
  copy(yy, y)
  sort.Ints(xx)
  sort.Ints(yy)
  xs, ys := []int{xx[0]}, []int{yy[0]}
  for i := 1; i < 8; i++ {
    if xx[i] != xx[i-1] {
      xs = append(xs, xx[i])
    }
    if yy[i] != yy[i-1] {
      ys = append(ys, yy[i])
    }
  }
  sort.Ints(xs)
  sort.Ints(ys)
  // fmt.Println(xs, ys)
  if len(xs) != 3 || len(ys) != 3 || xs[1] <= xs[0] || xs[2] <= xs[1] || ys[1] <= ys[0] || ys[2] <= ys[1] {
    w.WriteString("ugly\n")
    w.Flush()
    return
  }
  for i := 0; i < 3; i++ {
    for j := 0; j < 3; j++ {
      ug := true
      for k := 0; k < 8; k++ {
        if x[k] == xs[i] && y[k] == ys[j] {
          ug = false
        }
      }
      if (i != 1 && j != 1 && ug) || (i == 1 && j == 1 && !ug) {
        w.WriteString("ugly\n")
        w.Flush()
        return
      }
    }
  }
  w.WriteString("respectable\n")
  w.Flush()
}


// 70A
package main

import (
	"fmt"
)

func main() {
	var m, n int
	e := 1
	fmt.Scan(&m)
	for j = 1; j <= m-1; j++ {
		e = (3 * e) % 1000003
	}
	fmt.Print(e)
}


package main

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

func main() {
	sc := NewScanner()
	A := sc.NextIntArray()

	fmt.Println((A[0] + A[1] + A[2]) / 3)

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

// https://codeforces.com/problemset/problem/723/A
// A. The New Year: Meeting Friends
// time limit per test
// 1 second
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// There are three friend living on the straight line Ox in Lineland. The first friend lives at the point x1, the second friend lives at the point x2, and the third friend lives at the point x3. They plan to celebrate the New Year together, so they need to meet at one point. What is the minimum total distance they have to travel in order to meet at some point and celebrate the New Year?

// It's guaranteed that the optimal answer is always integer.
// Input

// The first line of the input contains three distinct integers x1, x2 and x3 (1 ≤ x1, x2, x3 ≤ 100) — the coordinates of the houses of the first, the second and the third friends respectively.
// Output

// Print one integer — the minimum total distance the friends need to travel in order to meet together.

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

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

    // the point at which the first would like to meet is is the midpoint
    // the midpoint of 2 points on a line is (p1+p2)/2
    // similarly, the midpoint of 3 points on a line is (p1+p2+p3)/3
    // in general, the midpoint of n points on a line is (p1+p2+...+pn)/n

    var x1, x2, x3 int
    _, _ = fmt.Fscan(bufStdin, &x1, &x2, &x3)

    midPoint := (x1+x2+x3)/3

    totalDist := intAbs(x1-midPoint) + intAbs(x2-midPoint) + intAbs(x3-midPoint)

    _, _ = fmt.Print(totalDist)
}

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


package main

import "fmt"

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

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

// https://codeforces.com/problemset/problem/723/A
// комментарии к решению
// Оптимальная точка встречи - это среднее векторов (в нашем случае одномерных).
func taskSolution(a, b, c int) int {
	mid := (a + b + c) / 3
	ans := abs(mid-a) + abs(mid-b) + abs(mid-c)
	return ans
}

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

	fmt.Println(taskSolution(x1, x2, x3))
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"math"
	"os"
	"path/filepath"
	"runtime"
	"strings"
)

func main() {
	b, _ := ioutil.ReadAll(os.Stdin)
	if len(b) == 0 {
		test()
	} else {
		solve(bytes.NewReader(b), os.Stdout)
	}
}

func solve(r io.Reader, w io.Writer) {
	var n int64
	fmt.Fscanln(r, &n)
	fmt.Fprintln(w, int(math.Ceil(math.Log2(float64(n)))))
}

func test() {
	tests := []struct {
		in   string
		want string
	}{
		{in: `2`, want: `1`},
		{in: `3`, want: `2`},
		{in: `4`, want: `2`},
		{in: `5`, want: `3`},
		{in: `6`, want: `3`},
		{in: `7`, want: `3`},
		{in: `8`, want: `3`},
		{in: `9`, want: `4`},
		{in: `10`, want: `4`},
		{in: `10000000`, want: `24`},
	}
	for i, tt := range tests {
		fmt.Printf("=== TEST %d\n", i)
		buf := new(bytes.Buffer)
		solve(strings.NewReader(chomp(tt.in)), buf)
		if got, want := chomp(buf.String()), chomp(tt.want); got != want {
			fmt.Printf("%d: got %v, want %v\n", i, got, want)
		}
	}
}

func chomp(s string) string {
	return strings.Trim(s, "\n")
}

func assert(b bool) {
	if !b {
		_, file, line, ok := runtime.Caller(1)
		if ok {
			f, _ := os.Open(file)
			defer f.Close()
			s := bufio.NewScanner(f)
			lnum := 0
			for s.Scan() {
				lnum++
				if lnum == line {
					wd, _ := os.Getwd()
					fname, _ := filepath.Rel(wd, file)
					fmt.Printf("assertion fails: %s:%d: %v\n", fname, line, s.Text())
					break
				}
			}
		}
	}
}

func pow(a, b int) int {
	r := 1
	for i := 0; i < b; i++ {
		r *= a
	}
	return r
}


package main

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

func main() {
    stin := bufio.NewScanner(os.Stdin)
    stin.Scan()
    ns,_ := strconv.ParseInt(stin.Text(), 10, 32)
    n := int(ns)
    stin.Scan()
    ss := strings.Fields(stin.Text())
    var a []int
    for i := 0; i < n; i++ {
        q,_ := strconv.ParseInt(ss[i], 10, 32)
        a = append(a, int(q))
    }
    sort.Sort(sort.Reverse(sort.IntSlice(a)))

    var totalLength int64 = int64(a[0])
    for i := 1; i < n; i++ {
        if a[i] == a[i-1] {
            for j := i; j < n && a[j] == a[i-1]; j++ {
                a[j] -= 1
            }
        }
        totalLength += int64(a[i])
    }
    fmt.Printf("%v", totalLength)
}


package main

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

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

	a := make([]int, n)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; i < n && scanner.Scan(); i++ {
		_a, err := strconv.Atoi(scanner.Text())
		if err != nil {
			return
		}
		a[i] = _a
	}

	bubble_sort(a, n)

	length := int64(a[0])
	for i := 1; i < n; i++ {
		if a[i] <= 0 {
			break
		}
		if a[i] >= a[i-1] {
			a[i] = a[i-1] - 1
		}
		length += int64(a[i])
	}
	fmt.Println(length)
}

func swap(a, b int, array []int) {
	array[a], array[b] = array[b], array[a]
}

func bubble_sort(array []int, length int) {
	for i := 0; i < length; i++ {
		for j := 0; j < length; j++ {
			if array[i] > array[j] {
				swap(i, j, array)
			}
		}
	}
}


package main

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

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

func main() {
	defer out.Flush()
	var n int
	fmt.Fscan(in, &n)
	a := make([]int, n)
	for i := range a {
		fmt.Fscan(in, &a[i])
	}
	sort.Ints(a)
	ans := int64(0)
	max := a[n-1] + 1
	for i := n - 1; i >= 0; i-- {
		if a[i] == max {
			max = a[i] - 1
		} else {
			max = a[i]
		}
		ans += int64(max)
	}
	fmt.Fprintln(out, ans)
}


package main

import (
	"fmt"
	"os"
)

//import "strings"

//import "math"
//import "strconv"
//import "sort"

func main() {

	str := "hello"

	d := ""

	fmt.Scan(&d)

	cur := 0

	for i := 0; i < len(d); i++ {

		if str[cur] == d[i] {
			cur++
		}
		if cur == 4 {
			fmt.Println("YES")
			os.Exit(0)
		}
	}
	fmt.Println("NO")
}


package main

import (
	"fmt"
	"strings"
)

// INPUT
// ahhellllloou -> YES
// hlelo -> NO
// helhcludoo -> YES

func main() {
	var word, wholeWord string

	fmt.Scanf("%v", &word)

	for _, char := range word {
		if wholeWord == "" || !strings.Contains(wholeWord, string(char)) && (char == 'h' || char == 'e' || char == 'l' || char == 'o') {
			wholeWord += string(char)
		}
	}

	if strings.Contains(wholeWord, "helo") {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import "fmt"
import "strings"

func foo(s string) bool {
	var i int
	if i = strings.Index(s, "h"); i == -1 {
		return false
	}
	if i = strings.Index(s, "e"); i == -1 {
		return false
	}
	if i = strings.Index(s, "l"); i == -1 {
		return false
	}
	if i = strings.Index(s, "l"); i == -1 {
		return false
	}
	if i = strings.Index(s, "o"); i == -1 {
		return false
	}
	return true
}

func main() {
	var s string
	fmt.Scan(&s)
	if foo(s) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	s, _ := reader.ReadString('\n')
	goal := "hello"
	state := 0
	good := false
	for i := 0; i < len(s); i++ {
		if state == len(goal)-1 {
			good = true
			break
		}

		if s[i] == goal[state] {
			state++
		}
	}

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

	}
}


package main

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

func main() {
	var scanner *bufio.Scanner

	scanner = bufio.NewScanner(os.Stdin)

	scanner.Scan()
	if err := scanner.Err(); err == nil {
		if regexp.MustCompile("\\w*[h ]+[e ]+[l ]+[l ]+[o ]+\\w*").MatchString(scanner.Text()) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}


package main

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

type input struct {
	a string
}

func (c *input) Read(scanner *bufio.Scanner) {
	for scanner.Scan() {
		c.a = scanner.Text()
		return
	}

}

func main() {
	var inp input
	sc := bufio.NewScanner(os.Stdin)
	inp.Read(sc)

	var h, e, l, l2 bool

	for _, b := range inp.a {
		s := string(b)
		if s ==  "h" {
			h = true
		}
		if h && s == "e" {
			e = true
		}
		if h && e && s == "l" {
			l = true
		}
		if h && e && l && s=="l" {
			l2 = true
		}
		if h && e && l && l2 && s == "o" {
			fmt.Println("YES")
			return
		}
	}
	fmt.Println("NO")
}


/*
Chat room
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word "hello". For example, if Vasya types the word "ahhellllloou", it will be considered that he said hello, and if he types "hlelo", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.

Input
The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.

Output
If Vasya managed to say hello, print "YES", otherwise print "NO".

Sample test(s)
input
ahhellllloou
output
YES
input
hlelo
output
NO
*/
package main

import (
	"fmt"
)

func main() {
	var (
		S string
		hello = []rune("hello")
	)
	fmt.Scanf("%s", &S)
	s := []rune(S)
	lens := len(s)
	lenHello := len(hello)
	if lens < lenHello {
		println("NO")
		return
	}
	var i, j int
	for ; i < lenHello; {
		for ; j < lens; j++ {
			if s[j] == hello[i] {
				i++
				j++
				break
			}
		}
		if j >= lens {
			break
		}
	}
	if i == lenHello {
		println("YES")
	} else {
		println("NO")
	}
}


package main

import "fmt"

func main() {
	var word string
	fmt.Scan(&word)

	c := []byte{'h', 'e', 'l', 'o'}
	cont := []int{1, 1, 2, 1}
	flag := 0
	hitNum := 0

	for i := 0; i < len(word); i++ {
		if word[i] == c[flag] {
			hitNum += 1
		} else {
			if hitNum < cont[flag] {
				flag = 0
			} else {
				flag += 1
				i--
			}
			hitNum = 0
		}

		if flag >= len(c) {
			fmt.Print("YES")
			return
		}
	}

	fmt.Print("NO")
}


package main

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

func print( a ...interface{}) { fmt.Fprint(w, a...) }
func scan( a ...interface{})  { fmt.Fscan(r, a...) }

func main() {
	var a string
	fmt.Scan(&a)

	var h = "hello"
	var index = 0
	for i := 0; i < len(a) && index < 5; i++{
		if h[index] == a[i]  {
			index++
		}
	}
	if index >= 5 {
		print("YES")
	}else {
		print("NO")
	}
}


package main

import (
	"fmt"
)

func main() {
	var line string
	fmt.Scan(&line)

	count := 0
	for _, c := range line {
		switch c {
		case 'h':
			count++
		case 'e':
			if count == 1 {
				count++
			}
		case 'l':
			if count == 2 || count == 3 {
				count++
			}
		case 'o':
			if count == 4 {
				count++
			}
		}
	}

	if count == 5 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import (
	"fmt"
)

// ahhellllloou

func solve(s string) string {
	i := 0
	for i < len(s) {
		if s[i] == 'h' {
			i++
			for s[i] == 'h' {
				i++
			}
			if s[i] == 'e' {
				i++
				for s[i] == 'e' {
					i++
				}
				if s[i] == 'l' {
					i++
					for s[i] == 'l' {
						i++
					}
					if s[i] == 'o' {
						i++
						for s[i] == 'o' {
							return "YES"
							i++
						}
					} else {
						i++
					}
				}
			} else {
				i++
			}
		} else {
			i++
		}
	}
	return "NO"
}

func main() {
	var s string
	fmt.Scanln(&s)
	sol := solve(s)
	fmt.Println(sol)
}


package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)
	hi := "hello"
	ans := false
	j := 0
	for i := 0; i < len(s); i++ {
		if s[i] == hi[j] {
			j += 1
		}
		if j == len(hi) {
			ans = true
			break
		}
	}
	fmt.Println(ans)
}


package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanRunes)
	expected := []rune{'h', 'e', 'l', 'l', 'o'}
	for scanner.Scan() {
		b := scanner.Text()
		br := rune(b[0])
		if br == expected[0] {
			if len(expected) == 1 {
				expected = expected[:]
				break
			}
			expected = expected[1:]
		}
	}
	if len(expected) == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println(("NO"))
	}
}


package main

import "fmt"

func main() {
	var s, s2 string
	var tmp int
	var flag bool
	fmt.Scanf("%s", &s)
	for i := range s {
		if tmp == 0 {
			if s[i] == 'h' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 1 {
			if s[i] == 'e' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 2 {
			if s[i] == 'l' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 3 {
			if s[i] == 'l' {
				s2 = s2 + string(s[i])
				tmp++
			}
		} else if tmp == 4 {
			if s[i] == 'l' {
				s2 = s2 + string(s[i])
				tmp++
			}
		}
		if tmp == 5 {
			flag = true
			break
		}
	}
	if flag {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

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

//========== Implement Algorithm =======================
func solution(str string) bool {
	if len(str) < 6 {
		return false
	}
	h := false
	e := false
	l := false
	o := false
	lcount := 0
	for x := 0; x < len(str); x++ {
		if h && e && l && o {
			return true
		}

		if string(str[x]) == "h" {
			h = true
		} else if string(str[x]) == "e" && h {
			e = true
		} else if string(str[x]) == "l" && h && e {
			lcount++
			if lcount == 2 {
				l = true
			}

		} else if string(str[x]) == "o" && h && e && l {
			o = true
		}
	}

	return h && e && l && o
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str string
	var ret bool
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	str = scanner.Text()
	//======================================================
	ret = solution(str)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

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

//========== Implement Algorithm =======================
func solution(str string) bool {
	if len(str) < 6 {
		return false
	}
	h := false
	e := false
	l := false
	o := false
	lcount := 0
	for x := 0; x <= len(str); x++ {
		if h && e && l && o {
			return true
		}
		if string(str[x]) == "h" {
			h = true
		} else if string(str[x]) == "e" && h {
			e = true
		} else if string(str[x]) == "l" && h && e {
			lcount++
			if lcount == 2 {
				l = true
			}

		} else if string(str[x]) == "o" && h && e && l {
			o = true
		}
	}

	return false
}

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	//================== Variables used ====================
	var str string
	var ret bool
	//======================================================

	//============== Get return value from File ============
	if len(os.Args) >= 2 {

		file, err := os.Open(os.Args[1])
		if err != nil {
			log.Fatalf("failed opening file: %s", err)
		}
		scanner = bufio.NewScanner(file)
		defer file.Close()

	}
	scanner.Split(bufio.ScanWords)
	//======================= I/O ==========================
	scanner.Scan()
	str = scanner.Text()
	//======================================================
	ret = solution(str)
	//==================== OUTPUT ==========================
	if ret {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import ("fmt")

func main(){
	var line string
	b := "hello"
	scan(&line)
	p := 0
	for i := 0; i < len(line); i++{
		if line[i] == b[p] && p < 4 {p++}
	}
	if p == 4 {
		sout("YES")
	}else{
		sout("NO")
	}
}

func scan(in ... interface{}){
	for _,k := range in{
		fmt.Scan(k)
	}
}

func sout(obj ... interface{}){
	for _, k := range obj{
		fmt.Print(k)
	}
	//fmt.Println()
}


package main

import (
  "fmt"
)

func main() {
  var s string
  word := "hello"
  var count, l int
  l = 4
  fmt.Scanf("%s", &s)

  for i:=0; i < len(s); i++ {
    if (s[i] == word[count]) {
      count++
    }
    if(count > l) {
      break
    }
  }

  if(count >= l) {
    fmt.Println("YES")
  } else {
    fmt.Println("NO")
  }
}


package main

import "fmt"

func main() {
	var s []byte
	fmt.Scan(&s)
	i, h, ello := 0, byte('h'), []byte{'e', 'l', 'l', 'o'}
	for _, b := range s {
		if h == b {
			if i == 3 {
				fmt.Print("YES")
				return
			}
			h = ello[i]
			i++
		}
	}
	fmt.Print("NO")
}


package main

import "fmt"
import "bytes"
import "io/ioutil"
import "os"

func task_solution(line []byte) string {
	substr := []byte{'h', 'e', 'l', 'l', 'o'}
	pos := 0
	for _, c := range substr {
		for pos < len(line) && line[pos] != c {
			pos += 1
		}
		// found char
		if pos < len(line) {
			pos += 1
		}
	}
	if pos <= len(line) {
		return "YES"
	}
	return "NO"
}

func main() {
	in_raw, err := ioutil.ReadAll(os.Stdin)
	if err != nil {
		panic(err)
	}

	fmt.Println(task_solution(bytes.TrimSpace(in_raw)))
}


package main

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

/* solution */

func solve() {

	x, n := readInt64(), readInt64()
	primes := getPrimes(x)

	ans := int64(1)

	for i := 0; i < len(primes); i++ {
		prim := primes[i]
		p := primes[i]
		cnt := int64(0)
		for p <= n {
			cnt += n / p
			if p > n/prim {
				p = n + 1
			} else {
				p *= prim
			}
		}
		ans = fastPower(ans, prim, cnt)
	}

	printInt64(ans)

}

func fastPower(ans, p, cnt int64) int64 {
	for cnt > 0 {
		if cnt%2 == 1 {
			ans = (ans * p) % 1000000007
			cnt--
		} else {
			cnt /= 2
			p = (p * p) % 1000000007
		}
	}
	return ans
}

func getPrimes(x int64) []int64 {

	ret := make([]int64, 0)
	ret = append(ret, 2)
	ans := make([]int64, 0)
	if x%2 == 0 {
		ans = append(ans, 2)
	}
	for i := int64(3); i <= x; i += 2 {
		ok := true
		for j := 1; j < len(ret); j++ {
			if i%ret[j] == 0 {
				ok = false
				break
			}
		}
		if !ok {
			continue
		}
		ret = append(ret, i)
		if x%i == 0 {
			ans = append(ans, i)
		}
		for x%i == 0 {
			x /= i
		}
		if x == 1 {
			break
		}
	}

	return ans

}

/* stubs */

func main() {

	var f *os.File
	if runtime.GOROOT() == "C:\\Soft\\Go" {
		f, _ = os.Open("input.txt")
		defer f.Close()
	} else {
		f = os.Stdin
	}

	writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	reader = bufio.NewScanner(f)

	const maxCapacity = 1024 * 1024
	buf := make([]byte, maxCapacity)
	reader.Buffer(buf, maxCapacity)

	reader.Split(bufio.ScanWords)

	solve()

}

var reader *bufio.Scanner
var writer *bufio.Writer

func read() string {
	reader.Scan()
	return reader.Text()
}

func readInt() int {
	reader.Scan()
	ret, _ := strconv.Atoi(reader.Text())
	return ret
}

func print(s string) {
	writer.WriteString(s)
	writer.WriteString("\n")
}

func printInt(i int) {
	print(strconv.Itoa(i))
}

func printInt64(i int64) {
	print(strconv.FormatInt(i, 10))
}

func readInt64() int64 {
	reader.Scan()
	ret, _ := strconv.ParseInt(reader.Text(), 10, 64)
	return ret
}


package main

import (
	"bufio"
	"math"
	"os"
	"runtime"
	"strconv"
)

/* solution */

func solve() {

	x, n := readInt64(), readInt64()
	primes := getPrimes(x)

	ans := int64(1)

	for i := 0; i < len(primes); i++ {
		prim := primes[i]
		p := primes[i]
		cnt := int64(0)
		for p <= n {
			cnt += n / p
			if p > n/prim {
				p = n + 1
			} else {
				p *= prim
			}
		}
		ans = fastPower(ans, prim, cnt)
	}

	printInt64(ans)

}

func fastPower(ans, p, cnt int64) int64 {
	for cnt > 0 {
		if cnt%2 == 1 {
			ans = (ans * p) % 1000000007
			cnt--
		} else {
			cnt /= 2
			p = (p * p) % 1000000007
		}
	}
	return ans
}

func getPrimes(x int64) []int64 {

	ret := make([]int64, 0)
	ret = append(ret, 2)
	ans := make([]int64, 0)
	if x%2 == 0 {
		ans = append(ans, 2)
	}
	limit := int64(math.Sqrt(float64(x))) + 1
	for i := int64(3); i <= limit; i += 2 {
		ok := true
		for j := 1; j < len(ret); j++ {
			if i%ret[j] == 0 {
				ok = false
				break
			}
		}
		if !ok {
			continue
		}
		ret = append(ret, i)
		if x%i == 0 {
			ans = append(ans, i)
		}
	}

	ok := true

	for j := 0; j < len(ret); j++ {
		if x%ret[j] == 0 {
			ok = false
			break
		}
	}

	if ok {
		ans = append(ans, x)
	}

	return ans

}

/* stubs */

func main() {

	var f *os.File
	if runtime.GOROOT() == "C:\\Soft\\Go" {
		f, _ = os.Open("input.txt")
		defer f.Close()
	} else {
		f = os.Stdin
	}

	writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	reader = bufio.NewScanner(f)

	const maxCapacity = 1024 * 1024
	buf := make([]byte, maxCapacity)
	reader.Buffer(buf, maxCapacity)

	reader.Split(bufio.ScanWords)

	solve()

}

var reader *bufio.Scanner
var writer *bufio.Writer

func read() string {
	reader.Scan()
	return reader.Text()
}

func readInt() int {
	reader.Scan()
	ret, _ := strconv.Atoi(reader.Text())
	return ret
}

func print(s string) {
	writer.WriteString(s)
	writer.WriteString("\n")
}

func printInt(i int) {
	print(strconv.Itoa(i))
}

func printInt64(i int64) {
	print(strconv.FormatInt(i, 10))
}

func readInt64() int64 {
	reader.Scan()
	ret, _ := strconv.ParseInt(reader.Text(), 10, 64)
	return ret
}


package main

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	return res
}

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

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

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

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

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

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

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

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

	return res
}

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

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

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

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

	res := 0

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

	return res
}

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

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

	return res
}

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

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

	return s
}

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

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

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

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

	return a
}

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

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

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

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

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

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

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

	return string(res)
}

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

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

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

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

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var x, n int64

func main() {
	x, n = ReadInt64_2()

	memo := TrialDivision(int(x))

	ans := int64(1)
	for k := range memo {
		kk := int64(k)
		// num := int64(0)
		d := int64(1)
		for {
			d *= kk
			if n < d {
				break
			}
			num := int64(n / d)

			tmp := modpow(kk, num, MOD)
			ans *= tmp
			ans %= MOD
		}

		// tmp := modpow(int64(k), num, MOD)
		// ans *= tmp
		// ans %= int64(MOD)
	}

	fmt.Println(ans % MOD)
}

// // ModInv returns $a^{-1} mod m$ by Fermat's little theorem.
// // O(1), but C is nearly equal to 30 (when m is 1000000000+7).
// func ModInv(a, m int) int {
// 	return modpow(a, m-2, m)
// }

func modpow(a, e, m int64) int64 {
	if e == 0 {
		return 1
	}

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

	return a * modpow(a, e-1, m) % m
}

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

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

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

	return p
}

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

	if e == 0 {
		return 1
	}

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

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

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

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


package main

import (
	"fmt"
	"math"
)

func main() {
	var r, x, y, xp, yp, steps int

	fmt.Scan(&r, &x, &y, &xp, &yp)

	distanceSquare := (xp-x)*(xp-x) + (yp-y)*(yp-y)

	if distanceSquare%((2*r)*(2*r)) == 0 {
		steps = int(math.Sqrt(float64(distanceSquare))) / (2 * r)
	} else {
		steps = (int(math.Sqrt(float64(distanceSquare))) + 2*r) / (2 * r)
	}

	fmt.Println(steps)
}


package main

import "fmt"

func gao(n int64) int64 {
	switch n {
	case 2:
		return 1
	case 3:
	case 4:
		return 2
	}
	return 1 + gao(n/2+n%2)
}

func main() {
	var n int64
	fmt.Scan(&n)
	fmt.Println(gao(n))
}