package main

import (
	"fmt"
	"log"
)

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

func main() {
	var d1, d2, d3 int
	_, err := fmt.Scanf("%d %d %d", &d1, &d2, &d3)
	if err != nil {
		log.Fatal(err)
	}
	if d1+d3 < d2 {
		fmt.Println(2 * (d1 + d3))
		return
	} else if d2+d3 < d1 {
		fmt.Println(2 * (d2 + d3))
		return
	}
	fmt.Println(min(2*d1+2*d2, d1+d2+d3))
}


package main

import (
	"fmt"
	"math"
	"sort"
)

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

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

	sort.Ints(arr)
	minm := 1e9
	for i := n - 1; i < m; i++ {
		minm = (math.Min(float64(minm), float64(arr[i] - arr[i - (n - 1)])))
	}
	fmt.Println(minm)
}


package main

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

func solve() {
	n := readInt()
	x := readInt()
	a := make([]bool, 101)
	for i := 0; i < n; i++ {
		a[readInt()] = true
	}
	s := 0
	for i := 0; i < x; i++ {
		if !a[i] {
			s++
		}
	}
	if a[x] {
		s++
	}
	fmt.Println(s)
}

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
}


//  URL: http://codeforces.com/problemset/problem/486/A
//  f(n) = -1 + 2 - 3 + ... + (-1) ^ n * n
//  APPROACH
//      Consider even terms:
//          f(0) = 0, f(2) = 1, f(4) = 2, f(6) = 3
//      Consider odd terms:
//          f(1) = -1, f(3) = -2, f(5) = -3
//  NOTE
//      Be careful of bounds -> use int64 when necessary.

package main

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

func solve(n int64) int64 {
	if n % 2 == 0 {
		return n / 2
	}
	return (-n - 1)/2
}

func main() {
	reader, writer := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var n int64
	fmt.Fscanf(reader, "%d\n", &n)
	fmt.Fprintf(writer, "%d\n", solve(n))
}


package main

import (
	"fmt"
	"math"
	"strconv"
)

func main() {
	var number int

	fmt.Scanln(&number)
	if almostLucky(number) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func almostLucky(number int) bool {
	var divs []int

	divs = divisors(number)

	for _, div := range divs {
		if lucky(div) {
			return true
		}
	}
	return false
}

func lucky(number int) bool {
	var str string

	str = strconv.Itoa(number)

	for _, letter := range str {
		if letter != '4' && letter != '7' {
			return false
		}
	}

	return true
}

func divisors(number int) []int {
	var divs []int
	var sqrt int

	divs = []int{1, number}
	sqrt = int(math.Sqrt(float64(number)))

	for i := 2; i <= sqrt; i++ {
		if number%i == 0 {
			divs = append(divs, i)
			if number/i != i {
				divs = append(divs, number/i)
			}
		}
	}
	return divs
}


package main

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

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

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

	n, k := nextInt(), nextInt()
	log.SetOutput(os.Stderr)
	log.Println(n, k)
	if n < k {
		println(k)
	} else {
		println((n/k + 1) * k)
	}
}

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

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

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

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

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


package main

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

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

	fingers := 0

	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
		}
		fingers += a
	}

	ways := 0
	for i := 1; i <= 5; i++ {
		if (fingers+i)%(n+1) != 1 {
			ways++
		}
	}

	fmt.Println(ways)
}


package main

import (
)
import "fmt"

func main() {
	var n, prev, now int64
	fmt.Scan(&n)
	prev = 1
	now = 2
	ans := 0
	for now <= n {
		prev, now = now, prev + now
		ans += 1;
	}
	fmt.Println(ans)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d", &n)
	n -= 10
	if n <= 0 {
		fmt.Println(0)
	} else if n < 10 || n == 11 {
		fmt.Println(4)
	} else if n == 10 {
		fmt.Println(15)
	} else {
		fmt.Println(0)
	}

}


// 245B-mic_rizal
package main

import (
    "fmt"
)

func main() {
    var s string
    var i, f, d int
    fmt.Scan(&s)
    //cin>>s;
    //int i,flag=0,dash=0;
    if s[0] == 'h' {
        fmt.Print("http://")
        i = 4
    } else {
        fmt.Print("ftp://")
        i = 3
    }

    for ; i < len(s); i++ {
        if s[i] == 'r' && f != -1 && d != 0 {
            if (s[i+1] == 'u') && (i+1) < len(s) {
                fmt.Print(".ru")
                f = -1
                i++
            } else {
                fmt.Print(string(s[i]))
            }
        } else if f == -1 && i <= len(s)-1 {
            fmt.Print("/")
            for ; i < len(s); i++ {
                fmt.Print(string(s[i]))
            }
            break
        } else {
            fmt.Print(string(s[i]))
            d++
        }
    }
    fmt.Println()
}


package main
import (
"fmt"
"os"
)
func main(){
 //var a,b,c,d,e int
 var n int
 var iRow,iCol int
 for i:=1;i<=5;i++ {
   //fmt.Scan(&a,&b,&c,&d,&e)
   for j:=1;j<=5;j++ {
      fmt.Scan(&n)
      if n == 1 {
          iRow = i
          iCol = j
   }
 }
}
iCount := 0
for i:=1;i<=5;i++ {
  if iCol != 3 {
      if iCol > 3 {
          iCol--
          iCount++
      }else {
          iCol++
          iCount++
      }
  }
  if iRow != 3 {
      if iRow > 3 {
          iRow--
          iCount++
      }else {
          iRow++
          iCount++
      }
  }
}
fmt.Fprintf(os.Stdout,"%d",iCount)
}


package main

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

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

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

	a, b := nextInt(), nextInt()

	if a > b {
		println(b, (a-b)/2)
	} else {
		println(a, (b-a)/2)
	}
}

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

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

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

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

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

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


package main

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

func main(){
	var n string
	var m string
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n = r.Text()
	r.Scan()
	m = r.Text()
	a := make([]int, len(n))
	b := make([]int, len(n))
	cz := 0
	if string(n) == "0" && string(m) == "0" {
		w.WriteString("OK\n")
		w.Flush()
		return
	} else if string(n) == "0" && string(m) == "7" {
		w.WriteString("WRONG_ANSWER\n")
		w.Flush()
		return
	}
	if len(n) == len(m) {
		for i:=0; i<len(n); i++ {
			a[i], _ = strconv.Atoi(string(n[i]))
			b[i], _ = strconv.Atoi(string(m[i]))
			if a[i] == 0 {
				cz += 1
			}
		}
		sort.Ints(a)
		tr := 0
		if b[0] == a[cz] {
			a[0], a[cz] = a[cz], a[0]
			for i:=1; i<len(n); i++ {
				if b[i] == a[i] {
					tr += 1
				}
			}
			if tr == len(n)-1 {
				w.WriteString("OK\n")
			} else {
				w.WriteString("WRONG_ANSWER\n")
			}
		} else {
			w.WriteString("WRONG_ANSWER\n")
		}
		w.Flush()
	} else {
		w.WriteString("WRONG_ANSWER\n")
		w.Flush()
	}
}


package main

import (
	"fmt"
)

func pow(a, b int64) int64 {
	if b <= 0 {
		return 1
	}
	if b <= 1 {
		return a
	}
	return pow((a*a)%100, b/2)
}

func main() {
	var b int64
	fmt.Scan(&b)
	fmt.Println(pow(5, b))
}


//1.6.2 | RexTester.Com & 1.11 | CodeForces.Com
package main
import "fmt"
func Max(x, y int) int {
    if x > y {
        return x
    } else {
        return y
    }
}

func main() {
    var grown_ups, children, max int
    fmt.Scan(&grown_ups, &children)

    if grown_ups < 1 && children > 0 {
        fmt.Print("Impossible")
        return
    }

    if children > 0 {
        max = grown_ups + children - 1
    } else {
        max = grown_ups
    }

    fmt.Print(Max(grown_ups, children), " ", max)
}


package main

import "fmt"

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


package main

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

type Team struct {
    main uint8
    second  uint8
}

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

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

}


//https://codeforces.com/problemset/problem/476/B
//http://bigocoder.com/courses/ORANGE03/ORANGE03_LEC03/ORANGE_L03P05/statement
package main

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

func solve(c int, n int) float64 {
	total := math.Pow(2, float64(n))
	p := permutation(c, n)

	return p / total
}

func permutation(c int, n int) float64 {
	return factorial(n) / (factorial(n-c) * factorial(c))
}

func factorial(n int) float64 {
	res := 1
	for i := 1; i <= n; i++ {
		res *= i
	}

	return float64(res)
}

func main() {
	r := bufio.NewReader(os.Stdin)
	var command, received string
	var count int
	flag := true
	fmt.Fscanf(r, "%s\n", &command)
	fmt.Fscanf(r, "%s\n", &received)
	cache := map[byte]int{}

	for i := range command {
		cache[command[i]]++
	}

	for i := range received {
		if received[i] == '?' {
			count++
		} else {
			cache[received[i]]--
		}
	}

	for _, v := range cache {
		if v < 0 || v != 0 && count == 0 {
			flag = false
		}
	}

	if flag {
		if count > 0 {
			fmt.Fprintf(os.Stdout, "%.10f\n", solve(cache['+'], count))

		} else {
			fmt.Fprintf(os.Stdout, "%.10f\n", float64(1))
		}
	} else {
		fmt.Fprintf(os.Stdout, "%.10f\n", float64(0))
	}

}


package main

import "fmt"

func Process(a []int64) (int64, []int64) {
	var m = map[int64]bool{}
	var r = make([]int64, 0)

	for i := len(a) - 1; i >= 0; i-- {
		if _, exist := m[a[i]]; !exist {
			r = append([]int64{a[i]}, r...)
		}

		m[a[i]] = true
	}

	return int64(len(r)), r
}

func main() {
	var n int64

	fmt.Scanln(&n)

	var a, _ = ScanN(n)

	var r1, r2 = Process(a)

	fmt.Println(r1)

	PrintSlice(r2)
}

func ScanN(n int64) ([]int64, error) {
	in := make([]int64, n)
	for i := range in {
		_, err := fmt.Scan(&in[i])
		if err != nil {
			return in[:i], err
		}
	}
	return in, nil
}

func PrintSlice(a []int64) {
	for i := 0; i < len(a); i++ {
		if i == len(a)-1 {
			fmt.Print(a[i])
		} else {
			fmt.Print(a[i], " ")
		}
	}
}


//Sri VatapatraSayi's Grace

package main

import "fmt"

func main() {

	var receive int
	fmt.Scanln(&receive)
	answer := 0
	answer += (receive) / 5
	if receive%5 != 0 {
		answer++
	}
	fmt.Println(answer)
}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF1701A(in io.Reader, out io.Writer) {
	var T, v int
	for Fscan(in, &T); T > 0; T-- {
		c := 0
		for i := 0; i < 4; i++ {
			Fscan(in, &v)
			c += v
		}
		if c == 0 {
			Fprintln(out, 0)
		} else if c < 4 {
			Fprintln(out, 1)
		} else {
			Fprintln(out, 2)
		}
	}
}

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


package main

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

var in *bufio.Scanner
var out *bufio.Writer

func main() {
	in = bufio.NewScanner(os.Stdin)
	out = bufio.NewWriter(os.Stdout)

	in.Split(bufio.ScanWords)
	defer out.Flush()

	in.Scan()
	pos := in.Text()

	row := int(pos[0]-'a') + 1
	col := int(pos[1] - '0')

	dr := []int{-1, -1, -1, 0, 1, 1, 1, 0}
	dc := []int{-1, 0, 1, 1, 1, 0, -1, -1}

	res := 0
	for i := 0; i < 8; i++ {
		r := row + dr[i]
		c := col + dc[i]
		if (1 <= r) && (r <= 8) && (1 <= c && c <= 8) {
			res++
		}
	}

	out.WriteString(strconv.Itoa(res))
}


package main

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

func solve() {
	l := readInt64()
	r := readInt64()
	x := readInt64()
	y := readInt64()
	k := readInt64()
	for j := x; j <= y; j++ {
		t := j * k
		if t > r {
			break
		}
		if t >= l && t <= r {
			fmt.Println("YES")
			return
		}
	}
	// for i := l; i <= r; i++ {
	// 	for j := x; j <= y; j++ {
	// 		if i%j == 0 && i/j == k {
	// 			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 (
	"bufio"
	"fmt"
	"math"
	"os"
)

func main() {
	var read = bufio.NewReader(os.Stdin)
	var n, k int64
	fmt.Fscan(read, &n, &k)
	var d = int64(math.Sqrt(float64(9 + 8*(k+n))))
	var r = n - (d-3)/2
	fmt.Print(r)
}


package main

/*
	To solve this problem basically we just need to generate login
	string which alphabetically earliest than any other string login string.

	The rules to generate login string are following:
	- must concatenate prefix of user's first name & last name
	- each prefix must not be empty
	- any prefix can be full name

	A string is said alphabetically earlier than other string if:
	- string is prefix of other string (ab >< abc, ab is earlier)
	- string is coincide up to some point with another
	  string then string has char which alphabetically earlier than
	  corresponding letter in another string (a >< ab >< ac => a < ab < ac)

	Notice that the minimum string we can generate is first[0] + last[0], yet
	with only this we already got decent enough early string. But can we make
	this string much earlier?

	Yes! If all char in first[1:] is alphabetically earlier than last[0]. So yeah,
	basically we just need to get all chars in first name which earlier than last[0],
	then combine them into a string.
*/

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

func main() {
	var first, second string
	stdio := bufio.NewReader(os.Stdin)
	fmt.Fscanf(stdio, "%s %s", &first, &second)
	idx := 1
	for i := 1; i < len(first); i++ {
		if first[i] < second[0] {
			idx++
		} else {
			break
		}
	}
	fmt.Println(first[:idx] + "" + second[:1])
}


package main

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

func solve() {
	c := readInt()
	v0 := readInt()
	v1 := readInt()
	a := readInt()
	l := readInt()
	res := 0
	done := 0
	for c > 0 {
		res++
		cnt := v0 + (res-1)*a
		rep := 0
		if res > 1 {
			if l > done {
				rep = done
			} else {
				rep = l
			}
		}
		if cnt > v1 {
			cnt = v1
		}
		cnt -= rep
		c -= cnt
		done += cnt
	}
	fmt.Println(res)
}

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 max3(x, y, z int) (int, bool){
	if (x >= y) && (x >= z) && ((x - y - z) <= 0){
		return x - y - z, true
	}else if (y >= x) && (y >= z) && ((y - x - z) <= 0){
		return y - x - z, true
	}else if (z>=y)&&(z >= x)&&((z-y-x) <= 0){
		return z-y-x, true
	}else{
		return 0, false
	}
}

func main() {
	sticks := make([]int, 4)
	fmt.Scan(&sticks[0], &sticks[1], &sticks[2], &sticks[3])
	ans := "IMPOSSIBLE"
	for i := 0; i < 4; i++{
		if c, ok:= max3(sticks[i%4], sticks[(i+1)%4], sticks[(i+2)%4]); (c < 0) && ok {
			ans = "TRIANGLE"
			break
		}else if (c == 0) && ok{
			ans = "SEGMENT"
		}
	}

	fmt.Print(ans)
}


package main

import (
	"fmt"
	"log"
)

var (
	hi = []string{"h", "e", "l", "l", "o"}
)

func main() {
	var (
		s       string
		counter int
		length  = len(hi)
	)
	if _, err := fmt.Scanf("%s\n", &s); err != nil {
		log.Fatal(err)
	}

	for i := range s {
		if s[i:i+1] == hi[counter] {
			counter++
			if counter == length {
				fmt.Println("YES")
				return
			}
		}
	}
	fmt.Println("NO")
}


package main
import (
	"fmt"
	"math"
)

func main() {
	var aa, xx, yy, k, l, s int
	fmt.Scan(&aa, &xx, &yy)
	if yy==0 {
		fmt.Println("-1")
		return
	}
	if yy<aa {
		if float64(aa)<2*math.Abs(float64(xx)) {
			fmt.Println("-1")
			return
		} else if float64(aa)==2*math.Abs(float64(xx)) {
			fmt.Println("-1")
			return
		} else if xx==0 && yy==0 {
			fmt.Println("-1")
		} else if xx==0 && yy>0 {
			fmt.Println("1")
		} else {
			fmt.Println("1")
		}
	} else if yy>=aa {
		k=yy-aa
		if k%aa==0 {
			fmt.Println("-1")
			return
		} else {
			s=0
			l=k/aa
			if l%2==0 {
				s=1+3*(l/2)
				if float64(aa)>2*math.Abs(float64(xx)) {
					s+=1
					fmt.Println(s)
					return
				} else {
					fmt.Println("-1")
					return
				}
			} else {
				if l>1 {
					s=2+3*(l-1)/2
				} else {
					s=2
				}
				if float64(aa)<=math.Abs(float64(xx)) {
					fmt.Println("-1")
					return
				} else {
					if xx==0 {
						fmt.Println("-1")
					} else if xx<0 {
						s+=1
						fmt.Println(s)
					} else if xx>0 {
						s+=2
						fmt.Println(s)
					}
				}
			}
		}
	}
}


package main

import (
    "fmt"
    s "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 isPalindrome(tt int) bool {
	return tt%60%10 == tt/60/10 && tt%60/10 == tt/60%10
}

func main() {
	var hh, mm int
	for {
		exitCode, err := fmt.Scanf("%d:%d", &hh, &mm)
		if exitCode == -1 || err != nil {
			break
		}
		tt := hh*60 + mm
		for i := 0; ; i++ {
			if isPalindrome(tt) {
				fmt.Printf("%d\n", i)
				break
			}
			tt = (tt + 1) % (24 * 60)
		}
	}
}


package main

import (
	"fmt"
)

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

	lane := (k-1)/(2*m) + 1
	lane_start := (lane-1)*2*m + 1
	desk := (k-lane_start)/2 + 1
	var place string
	if (k-lane_start)%2 == 0 {
		place = "L"
	} else {
		place = "R"
	}

	fmt.Println(lane, desk, place)
}


package main

import "fmt"

func main() {
	var length uint8
	var line string

	fmt.Scanln(&length)
	fmt.Scanln(&line)

	var min uint8 = 0
	var i uint8
	for i = 0; i < (length - 1); i++ {
		if line[i] == line[i+1] {
			min++
		}
	}

	fmt.Println(min)
}


package main

import(
	"fmt"
)

func main(){
	var k, n, w int64
	fmt.Scan(&k, &n, &w)
	needed := ((w*(w + 1)) >> 1)*k
	needed -= n
	if needed < 0{needed = 0}
	fmt.Print(needed)
}


package main

import "fmt"

func main() {
	var s string
	var count int
	fmt.Scanf("%s", &s)
	for i := range s {
		if s[i] == '7' || s[i] == '4' {
			count++
		}
	}
	if count == 7 || count == 4 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

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

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

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

	_, ta, b, tb := nextInt(), nextInt(), nextInt(), nextInt()
	times := strings.Split(next(), ":")
	h, _ := strconv.Atoi(times[0])
	m, _ := strconv.Atoi(times[1])
	begin := 60*h + m
	ret := 0
	for i := 300; i < 24*60; i += b {
		// println(i, i+tb)
		if i+tb > begin && i < begin+ta {
			ret++
		}
	}

	println(ret)
	// println(begin, begin+ta)
}

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

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

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

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

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


package main

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

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

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

	n, d := nextInt(), nextInt()
	// t := make([]int, n)
	count := 0

	// for i:=0; i<n; i++ {
	// 	t[i] = nextInt()
	// }

	for i:=0; i<n-1; i++ {
		d -= nextInt()

		d -= 10
		count += 2

		if d < 0 {
			println(-1)
			return
		}
		// println(i, d)
	}

	d -= nextInt()

	if d < 0 {
		println(-1)
		return
	}

	count += d / 5

	println(count)
}

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

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

func nextFloat() float64 {
	n, err := strconv.ParseFloat(next(), 64)
	if err != nil {
		panic(err)
	}
	return n
}

func println(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func print(a ...interface{}) {
	fmt.Fprint(writer, a...)
}

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


package main

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

// github.com/EndlessCheng/codeforces-go
func CF1183A(_r io.Reader, _w io.Writer) {
	var n int
	for Fscan(_r, &n); ; n++ {
		s := 0
		for x := n; x > 0; x /= 10 {
			s += x % 10
		}
		if s%4 == 0 {
			Fprint(_w, n)
			return
		}
	}
}

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


package main

import "fmt"

func main() {
	var n int
	var cipher string
	fmt.Scan(&n, &cipher)
	var cur int = 0
	for i := 1; cur < len(cipher); i++ {
		fmt.Printf("%c", cipher[cur])
		cur += i
	}
}


package main

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

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

// IO helper functions

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// IO functions

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

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

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

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

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

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

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

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

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

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

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

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

// Simple math functions

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

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

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

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

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

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

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

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

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

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

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

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

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

func main() {
	defer Flush()

	A := readll()
	B := readll()
	x := readll()
	y := readll()
	z := readll()

	a := 2 * x
	a += y
	b := y
	b += 3 * z
	println(maxll(a-A, 0) + maxll(b-B, 0))
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	i := 1
	for n >= 0 {
		x := i * (i + 1) / 2
		if n < x {
			i--
			break
		}
		i++
		n -= x
	}
	fmt.Println(i)
}


package main

import "fmt"

func  main() {
	var (
		a int16 = 0
		b int16 = 0
		c int16 = 0
	)
	fmt.Scanf("%d", &a)
	fmt.Scanf("%d", &b)
	for b >= a {
		b *= 2;
		a *= 3;
		c++;
	}
	fmt.Println(c)
}


package main

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

func main(){
	var input_string string
	_, er := fmt.Scan(&input_string)
	if er != nil{
		os.Exit(1)
	}
	input_string = strings.ToLower(input_string)
	for _,char := range input_string{
		item := string(char)
		if !strings.Contains("aeioyu", item){
			fmt.Print(".")
			fmt.Print(item)
		}
	}
}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF678D(in io.Reader, out io.Writer) {
	const p int64 = 1e9 + 7
	pow := func(x, n int64) int64 {
		res := int64(1)
		for ; n > 0; n >>= 1 {
			if n&1 == 1 {
				res = res * x % p
			}
			x = x * x % p
		}
		return res
	}

	var a, b, n, x int64
	Fscan(in, &a, &b, &n, &x)
	if an := pow(a, n); a == 1 {
		Fprint(out, (an*x+n%p*b)%p)
	} else {
		Fprint(out, (an*x+(an-1)%p*pow(a-1, p-2)%p*b)%p)
	}
}

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


package main

import "fmt"

var (
	n, k, ans int
	s string
	mp map[int]int
)

func main() {
	fmt.Scanln(&n, &k)
	fmt.Scanln(&s)

	mp = make(map[int]int)
	for i := 97; i < 123; i++ {
		mp[i] = 0
	}

	for _, value := range s {
		mp[int(value)]++
	}

	for {
		if k == 0 {
			break
		}

		for i := 97; i < 123; i++ {
			if i == 122 {
				if mp[i] == 0 {
					// 此题无解
					k = 0
					ans = -1
					break
				} else {
					// 最后一次机会
					ans += i - 96
					mp[i] = 0
					k--
					break
				}
			}
			if (mp[i] != 0) {
				ans += i - 96
				mp[i] = 0
				mp[i + 1] = 0
				k--
				break
			}
		}
	}

	fmt.Println(ans)
}


package main

import "fmt"

func main() {
	var s, t string
	fmt.Scan(&s, &t)
	i := 0
	for j := range t {
		if s[i] == t[j] {
			i += 1
		}
	}
	fmt.Println(i + 1)
}


package main
import ("fmt"
		"os"
		)
func main(){
	var l,x,s,n2,n3 int64
	fmt.Fscan(os.Stdin, &l)
	for l > 0 {
		fmt.Fscan(os.Stdin, &x)
		n2=1
		n3=1
		s=0
		for ( n2*n2 <= x || n3*n3*n3 <= x) {
		    if n2*n2 == n3*n3*n3 {
		        n2++
		        n3++
		    } else if n2*n2 < n3*n3*n3 {
		        n2++
		    } else {
		        n3++
		    }
		    s++
		}
		fmt.Println(s)
		l--
	}
}


package main

import (
    "fmt"
)

type i64 int64

func main(){
    var(
        n,k i64
    )
    fmt.Scan(&n,&k)
    for k>0{
        if temp:=n%10;temp !=0 {
            n = n-1
        }else{
            n = n/10
        }
        k--
    }
    fmt.Println(n)
}


package main

import "fmt"

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

// Petya studies in a school and he adores Maths. His class has been studying arithmetic expressions. On the last class the teacher wrote three positive integers a, b, c on the blackboard. The task was to insert signs of operations '+' and '*', and probably brackets between the numbers so that the value of the resulting expression is as large as possible. Let's consider an example: assume that the teacher wrote numbers 1, 2 and 3 on the blackboard. Here are some ways of placing signs and brackets:

//     1+2*3=7
//     1*(2+3)=5
//     1*2*3=6
//     (1+2)*3=9

// Note that you can insert operation signs only between a and b, and between b and c, that is, you cannot swap integers. For instance, in the given sample you cannot get expression (1+3)*2.

// It's easy to see that the maximum value that you can obtain is 9.

// Your task is: given a, b and c print the maximum value that you can get.
// Input

// The input contains three integers a, b and c, each on a single line (1 ≤ a, b, c ≤ 10).
// Output

// Print the maximum value of the expression that you can obtain.

func main() {
	var a, b, c int
	_, _ = fmt.Scan(&a, &b, &c)

	_, _ = fmt.Print(intMax(a*b*c, a+b+c, (a+b)*c, a*b+c, a+b*c, a*(b+c)))

}

func intMax(vs ...int) int {
	m := vs[0]
	for i := 1; i < len(vs); i++ {
		if vs[i] > m {
			m = vs[i]
		}
	}

	return m
}


package main

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

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

	var lastUp = N
	var firstDown = -1

	for i := 0; i < N-1; i++ {
		if A[i+1]-A[i] <= 0 {
			lastUp = i
			break
		}
	}

	for i := N - 1; i >= 1; i-- {
		if A[i]-A[i-1] >= 0 {
			firstDown = i
			break
		}
	}

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

}

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

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

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

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

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

	return mp
}

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


package main

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

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

	array := 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
		}
		array[i] = a
	}

	has_inequality := true
	for has_inequality {
		has_inequality = false
		for i := 0; i < n; i++ {
			for j := i + 1; j < n; j++ {
				if array[i] != array[j] {
					has_inequality = true
					c := sub_algorithm(array[i], array[j])
					array[i] = c
					array[j] = c
				}
			}
		}
	}

	sum := 0
	for i := 0; i < n; i++ {
		sum += array[i]
	}
	fmt.Println(sum)
}

func sub_algorithm(a, b int) int {
	if a == b {
		return a
	} else if b > a {
		a, b = b, a
	}
	return sub_algorithm(a-b, b)
}


package main

import "fmt"

func pwer (a, p int64) int64 {
    var m int64 = 1
    for ; p > 0; p -- {
        m = m * a
    }
    return m
}

func main() {
    var l, r int64
    fmt.Scan(&l, &r)
    var answer, a, b int64 = 0, 0, 0
    for a = 0; a < 39; a ++ {
		for b = 0; b < 39; b ++ {
		    var c int64 = pwer(2, a) * pwer(3, b)
		    if ((l <= c) && (c <= r)) {
		        answer ++
		    }
		}
	}
    fmt.Println(answer)
}


package main

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

func main() {
    reader := bufio.NewReader(os.Stdin)
    result := 0
    for i := 0; i < 8; i++ {
        line, _, _:= reader.ReadLine()
        for k := 0; k < len(line); k++ {
            switch line[k] {
                case 'Q' : result += 9
                case 'q' : result -= 9

                case 'R' : result += 5
                case 'r' : result -= 5

                case 'B' : result += 3
                case 'b' : result -= 3

                case 'N' : result += 3
                case 'n' : result -= 3

                case 'P' : result += 1
                case 'p' : result -= 1
            }
        }
    }

    switch {
        case result == 0 : fmt.Println("Draw")
        case result < 0 : fmt.Println("Black")
        case result > 0 : fmt.Println("White")
    }
}


package main

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

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func main() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
	defer w.Flush()
	var id string
	for I(&id, "\n") == nil {
		if solve(id) {
			O("YES", "\n")
		} else {
			O("NO", "\n")
		}
	}
}
func solve(id string) bool {
	pattern := "^[a-zA-Z0-9_]{1,16}@([a-zA-Z0-9_]{1,16}\\.?)*(\\/[a-zA-Z0-9_]{1,16})?$"
	if regexp.MustCompile(pattern).MatchString(id) {
		o := strings.Split(id, "@")
		if strings.Contains(o[1], "/") {
			o = append([]string{o[0]}, strings.Split(o[1], "/")...)
		}
		if len(o[1]) >= 1 && len(o[1]) <= 32 && o[1][len(o[1])-1] != '.' {
			return true
		}
	}
	return false
}


package main
import "fmt"

func main() {
       var n,k,i,w,v,s uint64

       fmt.Scan(&n, &k)
       s=k
       v=400

       for i=1;i<=n;i++ {
                 fmt.Scan(&w)
       if ( w==0 && i<=k) {
       fmt.Println(i-1);
       return
       }
           if ( i==k ) { v = w }
           if ( i!=k && v==w )  { s++; }
       }
       fmt.Println(s)

}


package main

import "fmt"

func main() {
	var x, y, z, a, b, c int
	fmt.Scan(&x, &y, &z, &a, &b, &c)
	if a >= x && a+b >= x+y && a+b+c >= x+y+z {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

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

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

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

	n := nextInt64()
	var sum, i int64 = 0, 0

	for sum+i+1 <= n {
		sum += i
		i++
	}
	// println(sum)
	println(n - sum)
}

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

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

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

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

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


//http://codeforces.com/problemset/problem/378/A
//A. Playing with Dice

package main

import (
	"fmt"
)

func main() {
	var (
		i, a, b, wa, d, wb int32
	)

	abs := func(x int32) int32 {
		if x < 0 {
			return -x
		}
		return x
	}

	fmt.Scan(&a)
	fmt.Scan(&b)
	for i = 1; i <= 6; i++ {
		if abs(a-i) < abs(b-i) {
			wa++
			continue
		}
		if abs(a-i) > abs(b-i) {
			wb++
			continue
		}
		d++
	}
	fmt.Println(wa, d, wb)

}


package main

import (
	. "fmt"
	"math/bits"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	var s, x, ans int64
	Scan(&s, &x)
	if d := s - x; d >= 0 && d&1 == 0 && d/2|x == d/2+x {
		ans = int64(1) << bits.OnesCount64(uint64(x))
		if d == 0 {
			ans -= 2
		}
	}
	Print(ans)
}


package main

import (
	"fmt"
)

func main() {
	var n, c int

	fmt.Scan(&n, &c)

	xi := make([]int, n)

	for i := range xi {
		fmt.Scan(&xi[i])
	}

	max, dif := 0, 0

	for i:=0; i<n-1; i++ {
		dif = xi[i] - xi[i+1]
		if dif > max {
			max = dif
		}
	}

	if max == 0 || max <= c {
		fmt.Println(0)
	} else {
		fmt.Println(max - c)
	}
}


package main

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

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

	var n int64
	fmt.Fscanf(buf, "%d\n", &n)

	mat := make([]int64, 20)
	len := 0
	for n > 0 {
		mat[len] = n % int64(10)
		n /= 10
		len++
	}
	//for i := len - 1; i >= 0; i-- {
	//	if mat[i] == 0 {
	//		for j := i + 1; j < len; j++ {
	//			mat[j]--
	//			if mat[j] > 0 || (mat[j] == 0 && j == len-1) {
	//				for k := j - 1; k >= 0; k-- {
	//					mat[k] = 9
	//				}
	//				break
	//			}
	//		}
	//		break
	//	}
	//}
	//for i := len; i >= 0; i-- {
	//	if mat[i] > 0 {
	//		len = i + 1
	//		break
	//	}
	//}
	var le int64 = 1
	var ans int64 = 1
	var tmp int64 = 1
	for i := 0; i < len; i++ {
		ans *= mat[i]
		le *= 9
	}
	//fmt.Printf("-%d len=%d %v\n",ans,len,mat)

	for i := len - 1; i >= 0; i-- {
		le /= 9
		if mat[i] > 1 {
			if tmp*(mat[i]-1)*le > ans {
				ans = tmp * (mat[i] - 1) * le
			}
		} else if i == len-1 {
			if le > ans {
				ans = le
			}
		}else {
			break
		}
		tmp *= mat[i]
	}
	fmt.Printf("%d\n", ans)
}


package main

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

func main() {
	sc := NewScanner()
	A := sc.NextIntArray()
	sort.Ints(A)
	c := A[1]
	ans := abs(A[0] - c) + abs(A[2] - c)
	fmt.Println(ans)
}
func min(a int, b int) int {
	if a < b {
		return a
	}
	return b
}
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

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

func main() {
	b := make([][]rune, 3)
	for i := 0; i < 3; i++ {
		b[i] = []rune(nextWord())
	}
	xc, oc, xw, ow := 0, 0, 0, 0
	for i := 0; i < 3; i++ {
		if b[i][0] == b[i][1] && b[i][1] == b[i][2] {
			if b[i][0] == 'X' {
				xw++
			} else if b[i][0] == '0' {
				ow++
			}
		}
		if b[0][i] == b[1][i] && b[1][i] == b[2][i] {
			if b[0][i] == 'X' {
				xw++
			} else if b[0][i] == '0' {
				ow++
			}
		}
	}
	if b[0][0] == b[1][1] && b[1][1] == b[2][2] {
		if b[0][0] == 'X' {
			xw++
		} else if b[0][0] == '0' {
			ow++
		}
	}
	if b[0][2] == b[1][1] && b[1][1] == b[2][0] {
		if b[0][2] == 'X' {
			xw++
		} else if b[0][2] == '0' {
			ow++
		}
	}
	for y := 0; y < 3; y++ {
		for x := 0; x < 3; x++ {
			if b[y][x] == 'X' {
				xc++
			} else if b[y][x] == '0' {
				oc++
			}
		}
	}
	if xc != oc && xc != oc + 1 {
		printf("illegal\n")
	} else if xw > 0 && ow > 0 {
		printf("illegal\n")
	} else if xw > 0 {
		if xc == oc {
			printf("illegal\n")
		} else {
			printf("the first player won\n")
		}
	} else if ow > 0 {
		if xc == oc + 1 {
			printf("illegal\n")
		} else {
			printf("the second player won\n")
		}
	} else if xc + oc == 9 {
		printf("draw\n")
	} else if oc == xc {
		printf("first\n")
	} else {
		printf("second\n")
	}
}

var lineScanner *bufio.Scanner
var wordScanner *bufio.Scanner

func init() {
	lineScanner = bufio.NewScanner(os.Stdin)
	wordScanner = bufio.NewScanner(strings.NewReader(""))
	wordScanner.Split(bufio.ScanWords)
}
func printf(format string, a ...interface{}) {
	fmt.Printf(format, a...)
}
func nextLine() (string, error) {
	if !lineScanner.Scan() {
		if err := lineScanner.Err(); err != nil {
			panic(err)
		}
		return "", errors.New("nextLine: EOF reached")
	}
	return lineScanner.Text(), nil
}

func nextWord() string {
	for !wordScanner.Scan() {
		if err := wordScanner.Err(); err != nil {
			panic(err)
		}
		line, err := nextLine()
		if err != nil {
			return ""
		}
		wordScanner = bufio.NewScanner(strings.NewReader(line))
		wordScanner.Split(bufio.ScanWords)
	}
	return wordScanner.Text()
}

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

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

func nextFloat64() float64 {
	res, err := strconv.ParseFloat(nextWord(), 64)
	if err != nil {
		panic(err)
	}
	return res
}


// https://codeforces.com/problemset/problem/731/A
package main

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

func diff(x int, y int) int {
	z := x - y
	if z >= 0 {
		return z
	}

	return z * (-1)
}

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

	var m, mRev map[rune]int
	m = make(map[rune]int)
	mRev = make(map[rune]int)
	char := 'a'
	for i := 1; i <= 26; i++ {
		m[rune(char)] = i
		char++
	}
	charRev := 'z'
	for i := 26; i >= 1; i-- {
		mRev[rune(charRev)] = i
		charRev--
	}

	var s string
	var ans int
	fmt.Fscanf(in, "%s\n", &s)
	for i := 0; i < len(s); i++ {
		var a, b int
		if i == 0 {
			a = diff(m[rune(s[i])], m['a'])
			b = diff(a, 26)
		} else {
			a = diff(m[rune(s[i])], m[rune(s[i-1])])
			b = diff(a, 26)
		}
		if a < b {
			ans += a
		} else {
			ans += b
		}
	}

	fmt.Fprintln(out, ans)
}


package main

import "fmt"

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

	if n<=1 {
	    fmt.Println("Ehab")

	    return
	}

	if n%2==0 {
	    fmt.Println("Mahmoud")

	    return
	}

	fmt.Println("Ehab")

}


package main

import "fmt"

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

func main() {
	var y, b, r int
	fmt.Scan(&y, &b, &r)
	ans_r := min(y + 2, min(b + 1, r))
	fmt.Println((ans_r - 1) * 3)
}


package main

import "fmt"

func round(n float64) int64 {
	if  n-float64(int(n)) >= 0.000000000001 {
		return int64(n) + 1
	} else {
		return int64(n)
	}
}
func main() {
	var n, m, a int
	fmt.Scanf("%d %d %d", &n, &m, &a)
        //m =1000000000 ;n=1000000000 ;a=192;
	fmt.Println(round(float64(n)/float64(a)) * round(float64(m)/float64(a)))
}


package main

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

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

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

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

type pair struct {
	first int
	second int
}

type pairs []pair

func (a pairs) Len() int {return len(a)}
func (a pairs) Swap(i,j int) {a[i], a[j] = a[j], a[i]}
func (a pairs) Less(i,j int) bool {
	return a[i].first < a[j].first
	if a[i].first > a[j].first {
		return false
	}
	return a[i].second <= a[j].second
}

func main() {
	in := bufio.NewReader(os.Stdin)
	//in, _ := os.Open("a.txt")
	var n int64
	var allNines = true
	fmt.Fscanf(in, "%d", &n)
	if n < 5 {
		fmt.Println(n * (n - 1) / 2)
		os.Exit(0)
	}
	sum := n + n - 1
	cnt := 0
	for ; sum > 0; sum /= 10 {
		x := sum % 10
		if x != 9 {
			allNines = false
		}
		cnt++
	}
	if allNines {
		fmt.Println(1)
		os.Exit(0)
	}
	numOfNines := cnt - 1
	var deg int64 = 1
	for i := 1;i <= numOfNines; i++ {
		deg = deg * 10
	}
	md := n % deg
	right := md
	mid := deg / 2 - 1
	less := n / deg
	more := less + 1
	if  right == 0 {
		fmt.Println(less * less * (mid + 1))
		os.Exit(0)
	}
	var ans int64
	if right != deg - 1 {
		ans = less * less
	} else {
		ans = less * more
	}
	if right <= mid {
		ans += right * more * less
		ans += (mid - right) * less * less
	} else {
		extra := right - mid
		if right == deg - 1 {
			extra--
		}
		ans += extra * more * more
		ans += (mid - extra) * more * less
	}
	fmt.Println(ans)
}


package main

import "fmt"

func main() {
	var k, l, m, n, d int
	fmt.Scan(&k, &l, &m, &n, &d)

	var suffocated int
	for i := 1; i <= d; i++ {
		if i%k == 0 || i%l == 0 || i%m == 0 || i%n == 0 {
			suffocated++
		}
	}
	fmt.Print(suffocated)
}


package main

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

func main() {
	input := bufio.NewReader(os.Stdin)
	var (
		n    int
		l    int
		r    int
		iMax int
		iMin int
	)
	_, _ = fmt.Fscan(input, &n, &l, &r)

	var c uint

	c = 0
	for i := 0; i < l; i += 1 {
		iMin += 1 << c
		c += 1
	}
	iMin += n - l

	if n < r {
		r = n
	}
	c = 0
	for i := 0; i < r; i += 1 {
		iMax += 1 << c
		c += 1
	}
	iMax += (n - r) * (1 << (c - 1))
	fmt.Printf("%d %d\n", iMin, iMax)
}


package main

import (
    "fmt"
    )

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

    if n%4==0 || n%4==3 {
        fmt.Println("0")
    } else {
        fmt.Println("1")
    }
}


package main

import (
	"fmt"
)

func main() {
	var name string
	chars := make(map[rune]bool)
	fmt.Scan(&name)
	for _, c := range name {
		chars[c] = true
	}
	if len(chars)%2 == 0 {
		fmt.Println("CHAT WITH HER!")
	} else {
		fmt.Println("IGNORE HIM!")
	}
}


package main

import "os"
import "bufio"

func main(){
	var s string
	r := bufio.NewScanner(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	var a [4]int
	var x, y int
	var min int = 1000
	var max int
	var maxl, minl int
	for i:=0; i<4; i++ {
		r.Scan()
		s = r.Text()
		a[i] = len(s)
		a[i] -= 2
		if a[i] > max {
			max = a[i]
			maxl = i
		}
		if a[i] < min {
			min = a[i]
			minl = i
		}
	}
	min *= 2
	max /= 2
	for j:=0; j<4; j++ {
		if j != minl && min > a[j] {
			x = 1
			break
		}
	}
	for k:=0; k<4; k++ {
		if k != maxl && max < a[k] {
			y = 1
			break
		}
	}
	if (x == 1 && y == 1) || (x == 0 && y == 0) {
		w.WriteString("C")
	} else if x == 0 && y == 1 {
		if minl == 0 {
			w.WriteString("A")
		} else if minl == 1 {
			w.WriteString("B")
		} else if minl == 2 {
			w.WriteString("C")
		} else if minl == 3 {
			w.WriteString("D")
		}
	} else {
		if maxl == 0 {
			w.WriteString("A")
		} else if maxl == 1 {
			w.WriteString("B")
		} else if maxl == 2 {
			w.WriteString("C")
		} else if maxl == 3 {
			w.WriteString("D")
		}
	}
	w.WriteString("\n")
	w.Flush()
}


package main

import (
	"fmt"
)

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

	// Special case for zero
	if a == 0 || b == 0 {
		return a + b
	}

	// Calculate GCD using Euclidean algorithm
	result := 1

	for {
		remain := b % a

		if remain == 0 {
			result *= a
			break
		} else {
			b = a
			a = remain
		}
	}
	return result
}

func main() {
	var simon, antisimon, stones int

	fmt.Scanf("%d %d %d", &simon, &antisimon, &stones)

	for {
		// Simon plays
		var simonQuota = gcd(simon, stones)

		if simonQuota <= stones {
			stones -= simonQuota
		} else {
			fmt.Println(1)
			return
		}

		// Antisimon plays
		var antiQuota = gcd(antisimon, stones)

		if antiQuota <= stones {
			stones -= antiQuota
		} else {
			fmt.Println(0)
			return
		}

		// fmt.Println(simon, antisimon, stones, simonQuota, antiQuota)
	}
}


package main

import "fmt"

func abs(x int32) int32  {
	if x<0 {
		return -x
	}else{
		return x
	}
}

func main()  {
	var total int32 = 0
	var a []int32
	var n int32
	fmt.Scanln(&n)
	a = make([]int32,n,n)
	for i:=0;i<len(a);i++{
		fmt.Scan(&a[i])
	}
	for i:=0;i<len(a);i++{
		total += abs(a[i])
	}
	fmt.Print(total)
}


package main

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

var f0 = "What are you doing at the end of the world? Are you busy? Will you save us?"
var a = "What are you doing while sending \""
var b = "\"? Are you busy? Will you send \""
var c = "\"?"

var cnt []int64

func recv(n, k int64) byte {
	if n == 0 {
		if k < int64(len(f0)) {
			return f0[k]
		}
		return '.'
	}
	if k < int64(len(a)) {
		return a[k]
	}
	k -= int64(len(a))

	if k < cnt[n-1] {
		return recv(n-1, k)
	}
	k -= int64(cnt[n-1])

	if k < int64(len(b)) {
		return b[k]
	}

	k -= int64(len(b))

	if k < cnt[n-1] {
		return recv(n-1, k)
	}
	k -= int64(cnt[n-1])

	if k < int64(len(c)) {
		return c[k]
	}
	return '.'

}

func main() {
	cnt = make([]int64, 100001)
	cnt[0] = int64(len(f0))
	for i := 1; i < len(cnt); i++ {
		cnt[i] = int64(len(a)) + cnt[i-1] + int64(len(b)) + cnt[i-1] + int64(len(c))
		if cnt[i] > 1e18 {
			cnt[i] = 1e18
		}
	}
	sc := NewScanner()
	q := sc.NextInt()
	for i := 0; i < q; i++ {
		a, b := sc.NextInt64(), sc.NextInt64()
		fmt.Print(string(recv(a, b-1)))
	}
}

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 n, s int
	fmt.Scan(&n, &s)
	fmt.Println((s + n - 1) / n)
}


package main

import "fmt"

func main() {
	var n, k int
	b := [5]int{100, 20, 10, 5, 1}
	fmt.Scan(&n)
	for i := 0; i < 5; i++ {
		if n >= b[i] {
			k += n / b[i]
			n = n % b[i]
		}
	}
	fmt.Print(k)
}


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 min_int(a int, b int) int {
	if a < b {
		return a
	} else {
		return b
	}
}

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

func max_int(a int, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}
func max_int64(a int64, b int64) int64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func binary_search(a *[]int64, pos int64) (bool, int64, int64) {
	var left int64 = 0
	var right int64 = int64(len(*a))
	var n_low int64 = 0
	var n_high int64 = 0
	for left < right {
		var middle int64 = (left + right) / 2
		if (*a)[middle] <= pos {
			left = middle + 1

			if pos != middle {
				n_low++
			}
		} else {
			right = middle
			n_high++
		}
	}

	if left > 0 && (*a)[left-1] == pos {
		return true, n_low, n_high
	} else {
		return false, n_low, n_high
	}
}

func extended_gcd(a int64, b int64) {
	var o_r int64 = a
	var r int64 = b
	var o_s int64 = 1
	var s int64 = 0
	var o_t int64 = 0
	var t int64 = 1

	for r != 0 {
		var q int64 = o_r / r
		o_r, r = r, o_r-q*r
		o_s, s = s, o_s-q*s
		o_t, t = t, o_t-q*t
	}

	printf("Bezout coefs: %d %d\n", o_s, o_t)
	printf("GCD: %d\n", o_r)
}

func modular_inverse(a int64, m int64) int64 {

	var m_init int64 = m
	var y int64 = 0
	var x int64 = 1

	if m == 1 {
		return 0
	}

	for a > 1 {
		var q int64 = a / m
		var t int64 = m

		m = a % m
		a = t
		t = y

		y = x - q*y
		x = t
	}

	if x < 0 {
		x += m_init
	}

	return x
}

func combination(n int64, k int64, factorial *[]int64, mod_inv *[]int64, mod_by int64) int64 {

	if k > n {
		return 0
	} else {
		var r int64 = ((*mod_inv)[n-k] * (*mod_inv)[k]) % mod_by
		r = (r * (*factorial)[n]) % mod_by
		return r
	}

}

func main() {
	defer writer.Flush()

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

	var n_smaller_numbers int64 = x - 1
	var n_bigger_numbers int64 = n - x

	var mod_by int64 = 1000000000 + 7

	factorial := make([]int64, n+1)
	mod_inv := make([]int64, n+1)

	factorial[0] = 1
	mod_inv[0] = 1

	for i := int64(1); i <= n; i++ {
		// Formaly it should be ( (factorial[i-1] % mod_by) * (i % mod_by) ) % mod_by
		// but since n does not exceed 1000 in the problem constraints then the below suffices.
		factorial[i] = (factorial[i-1] * i) % mod_by
		mod_inv[i] = modular_inverse(factorial[i], mod_by) % mod_by
	}

	// for i := range factorial {
	// 	printf("%d ", factorial[i])
	// }
	// printf("\n")

	// for i := range mod_inv {
	// 	printf("%d ", mod_inv[i])
	// }
	// printf("\n")

	numbers := make([]int64, n)
	for i := int64(0); i < int64(len(numbers)); i++ {
		numbers[i] = i
	}

	var n_less, n_greater int64
	_, n_less, n_greater = binary_search(&numbers, pos)

	// printf("n_less: %d n_greater: %d\n", n_less, n_greater)

	var c1 int64 = (combination(n_smaller_numbers, n_less, &factorial, &mod_inv, mod_by) * factorial[n_less]) % mod_by
	var c2 int64 = (combination(n_bigger_numbers, n_greater, &factorial, &mod_inv, mod_by) * factorial[n_greater]) % mod_by

	// printf("c1: %d c2: %d\n", c1, c2)

	var res int64 = (c1 * c2) % mod_by
	res = (res * factorial[n-n_less-n_greater-1]) % mod_by

	printf("%d\n", res)

	// extended_gcd(240, 46)
	// printf("modular inverse: %d\n", modular_inverse(42, mod_by))

}


package main

import "fmt"

var x int

func main() {
	fmt.Scanf("%d", &x)
	fmt.Println(x/2 + 1)
}


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

var n int

func main() {
        fmt.Scan(&n)
        sqt := math.Sqrt(float64(n))
        hight := int(sqt)
        width := 0
        if hight*hight == n {
                width = hight
        } else {
                width = hight + 1
                if hight*width < n {
                        hight += 1
                }
        }
        fmt.Println(hight*2 + width*2)
}


package main

import (
	"fmt"
	"strconv"
)

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

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

func reverse(s string) (result string) {
	for _, v := range s {
		result = string(v) + result
	}
	return
}

func getMin(m, s int) string {
	first := max(1, s-9*(m-1))
	next := getMax(m-1, s-first)
	return strconv.Itoa(first) + reverse(next)
}

func getMax(m, s int) string {
	r := ""
	for i := 0; i < m; i++ {
		next := min(9, s)
		s -= next
		r += strconv.Itoa(next)
	}
	return r
}

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

	if m == 1 && s <= 9 {
		fmt.Print(s, s)
		return
	}

	if s == 0 || s > m*9 {
		fmt.Print(-1, -1)
		return
	}

	fmt.Print(getMin(m, s) + " " + getMax(m, s))
}


package main

import (
	"fmt"
)

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	var x, y, z int
	fmt.Scan(&x, &y, &z)
	var addA = a - x
	var addB = b - y
	var addC = c - z
	var add int
	var minus int
	if addA > 0 {
		add += addA / 2
	} else {
		minus += addA
	}
	if addB > 0 {
		add += addB / 2
	} else {
		minus += addB
	}
	if addC > 0 {
		add += addC / 2
	} else {
		minus += addC
	}
	if add+minus >= 0 {
		fmt.Print("Yes")
	} else {
		fmt.Print("No")
	}
}


package main

import (
	"fmt"
)

func main() {
	var total int
	var current int
	var left, right, max, min int
	var totalMoves int
	fmt.Scanln(&total, &current)
	left = current - 1
	right = total - current
	min, max = minMax(left, right)
	totalMoves = min * 2 + max + total *2 + 1
	fmt.Println(totalMoves)
}

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


package main

import "fmt"

func main() {
    var s string
    ans := true
    for i := 0; i < 8; i++ {
        fmt.Scan(&s)
        if ans {
            for i := 0; i < 8; i++ {
                if s[i] == s[(i+1)%8] { ans = false; break }
            }
        }
    }
    if ans { fmt.Println("YES") } else { fmt.Println("NO") }
}


package main

import (
	"fmt"
)

func main() {

	var n, x, y int
	a, b, c := 0, 0, 0
	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&x, &y)
		a += x
		b += y
		if x%2 != y%2 {
			c++
		}
	}
	if a%2 == 0 && b%2 == 0 {
		fmt.Print("0")
	} else if c%2 == 0 && c > 0 {
		fmt.Print("1")
	} else {
		fmt.Print("-1")
	}
}


package main

import (
	"fmt"
)

func main() {
	s:=""
	fmt.Scanln(&s)
	c:=[]byte(s)
	a:=len(c)
	e:=0
	for i:=0;i<a ;i++{
		if c[i]<95{
			e++
		}else{
			e--
		}
	}
	if e>0 {
		for i:=0;i<a ;i++  {
			if c[i]>95 {
				c[i]-=32
			}
		}
	}else {
		for i:=0;i<a ;i++  {
			if c[i]<95 {
				c[i]+=32
			}
		}
	}
	fmt.Println(string(c[:]))
}
//


package main

import (
	"fmt"
)

func solve(t, s, x int) bool {
	//if x <= t {
	//return t == x
	//}
	if x < t {
		return false
	}

	delta := x - t
	return (delta%s) == 0 || (delta/s >= 1 && delta%s == 1)
	return true
}

func main() {
	var t, s, x int
	fmt.Scan(&t, &s, &x)
	if solve(t, s, x) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import (
	"strings"
	"fmt"
)

func main() {
	var s, t string
	fmt.Scan(&s)
	fmt.Scan(&t)

	sSpl := strings.Split(s, "")
	tSpl := strings.Split(t, "")

	if len(sSpl) != len(tSpl) {
		fmt.Println("NO")
		return
	}

	fin := len(tSpl) - 1
	for i := range sSpl {
		if sSpl[i] != tSpl[fin - i] {
			fmt.Println("NO")
			return
		}
	}

	fmt.Println("YES")
}


package main

import "fmt"

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

	grid := make([][]bool, n)
	for i := 0; i < n; i++ {
		grid[i] = make([]bool, m)
	}

	var ret bool = false

	for {
		var found bool = false

		for i := 0; i < n && !found; i++ {
			for j := 0; j < m && !found; j++ {
				if !grid[i][j] {
					for k := 0; k < n; k++ {
						grid[k][j] = true
					}
					for k := 0; k < m; k++ {
						grid[i][k] = true
					}
					found = true
					break
				}
			}
		}

		if !found {
			break
		}

		ret = !ret
	}

	if !ret {
		fmt.Println("Malvika")
	} else {
		fmt.Println("Akshat")
	}
}


package main

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

var res []int

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	k, _ := strconv.Atoi(scanner.Text())

	solve(n, k)
	if len(res) == 0 || len(res) != k {
		fmt.Println(-1)
		os.Exit(0)
	}
	check := 1
	for _, el := range res {
		check *= el
	}
	if check != n {
		fmt.Println(-1)
		os.Exit(0)
	}
	for i, el := range res {
		if i == len(res)-1 {
			fmt.Printf("%d\n", el)
			continue
		}
		fmt.Printf("%d ", el)
	}
}

func solve(n, k int) {
	if n == 1 {
		return
	}
	if k == 1 {
		res = append(res, n)
		return
	}
	for i := 2; i <= int(math.Sqrt(float64(n)))+1; i++ {
		if n%i == 0 {
			res = append(res, i)
			solve(n/i, k-1)
			return
		}
	}
}


package main

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

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int) {
	var k, l, c, d, p, nl, np int
	I(&k, " ")
	I(&l, " ")
	I(&c, " ")
	I(&d, " ")
	I(&p, " ")
	I(&nl, " ")
	I(&np, "\n")
	ans := int(((l * k) / nl) / n)
	cd := c * d
	npp := int(p / np)
	for n*ans > cd || n*ans > npp {
		ans--
	}
	O(ans, "\n")
}


package main
import (
	"fmt"
	"unicode/utf8"
	"unicode"
)

func main() {
	var kata1,kata2 string
	fmt.Scanf("%s\n", &kata1)
	fmt.Scanf("%s\n", &kata2)
	len := utf8.RuneCountInString(kata1)
	a := []rune(kata1)
	b := []rune(kata2)
	for i:=0; i<len; i++{
	a[i] = unicode.ToUpper(a[i])
	b[i] = unicode.ToUpper(b[i])
	kata1 = string(a)
	kata2 = string(b)
	}
	if kata1 > kata2 {
		fmt.Println("1")
	}
	if kata1 == kata2 {
		fmt.Println("0")
	}
	if kata1 < kata2 {
		fmt.Println("-1")
	}

}


package main

import "fmt"

func main() {
	var a, b, c, s int
	fmt.Scanln(&a, &b, &c)
	b = -b
	s = a + b
	if s > 0 {
		if s > c {
			fmt.Println("+")
		} else {
			fmt.Println("?")
		}
	} else if s == 0 {
		if c == 0 {
			fmt.Println("0")
		} else {
			fmt.Println("?")
		}
	} else {
		if s+c < 0 {
			fmt.Println("-")
		} else {
			fmt.Println("?")
		}
	}
}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF1292B(_r io.Reader, _w io.Writer) {
	type point struct{ x, y int64 }
	abs := func(x int64) int64 {
		if x < 0 {
			return -x
		}
		return x
	}
	dis := func(a, b point) int64 { return abs(a.x-b.x) + abs(a.y-b.y) }

	var ax, ay, bx, by, tt int64
	var p, st point
	Fscan(_r, &p.x, &p.y, &ax, &ay, &bx, &by, &st.x, &st.y, &tt)
	ps := []point{}
	for ; p.x < 9e16 && p.y < 9e16; p.x, p.y = ax*p.x+bx, ay*p.y+by {
		ps = append(ps, p)
	}

	ans := 0
	for i, p := range ps {
		t := tt
		if d := dis(st, p); d <= t {
			t -= d
			c := 1
			for j := i; j > 0; j-- {
				if d := dis(ps[j], ps[j-1]); d <= t {
					t -= d
					c++
				} else {
					break
				}
			}
			if i+1 < len(ps) {
				if d := dis(ps[0], ps[i+1]); d <= t {
					t -= d
					c++
					for j := i + 2; j < len(ps); j++ {
						if d := dis(ps[j], ps[j-1]); d <= t {
							t -= d
							c++
						} else {
							break
						}
					}
				}
			}
			if c > ans {
				ans = c
			}
		}
	}
	Fprint(_w, ans)
}

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


package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)
	for i := 0; i < len(s); i++ {
		if s[i] == 'H' || s[i] == '9' || s[i] == 'Q' {
			fmt.Print("YES")
			return
		}
	}
	fmt.Print("NO")
}


package main

import "fmt"

func main() {
	var a, b string
	fmt.Scan(&a)
	for i := 0; i < 5; i++ {
		fmt.Scan(&b)
		if a[0] == b[0] || a[1] == b[1] {
			fmt.Println("YES")
			return
		}
	}
	fmt.Println("NO")
}


// Author: sighduck
// URL: https://codeforces.com/contest/1191/problem/B

package main

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

type Tile struct {
	Suit   string
	Number int
}

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

func createTileCountMap(tiles []Tile) map[Tile]int {
	tileCountMap := make(map[Tile]int)
	for _, tile := range tiles {
		tileCountMap[tile] += 1
	}
	return tileCountMap
}

func minKoutsu(tiles []Tile) int {
	tileCountMap := createTileCountMap(tiles)
	minTiles := 3
	for _, tileCount := range tileCountMap {
		minTiles = min(minTiles, 3-tileCount)
	}
	return minTiles
}

func minShuntsu(tiles []Tile) int {
	tileCountMap := createTileCountMap(tiles)
	minTiles := 3
	for _, suit := range "mps" {
		for i := 1; i <= 7; i++ {
			neededNumbers := []int{i, i + 1, i + 2}
			count := 0
			for _, n := range neededNumbers {
				if tileCountMap[Tile{Number: n, Suit: string(suit)}] > 0 {
					count += 1
				}
			}
			minTiles = min(minTiles, 3-count)
		}
	}
	return minTiles
}

func Solve(tiles []Tile) int {
	return min(minKoutsu(tiles), minShuntsu(tiles))
}

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

	tiles := make([]Tile, 3)
	for i := 0; i < 3; i++ {
		fmt.Fscanf(reader, "%d%s ", &tiles[i].Number, &tiles[i].Suit)
	}

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


package main

import (
	"fmt"
)

var (
	n      int
	m      int
	result int
)

func in() {
	fmt.Scanf("%d %d\n", &n, &m)
}

func out() {
	fmt.Println(result)
}

func run() {
	var remain int = n
	var d int = 1
	for ; remain > 0; d++ {
		if d%m != 0 {
			remain--
		}
	}
	result = d - 1
}

func main() {
	in()
	run()
	out()
}


package main

import (
	"fmt"
)

func main() {
	var n, m, a, b int
	_, _ = fmt.Scanf("%d %d %d %d\n", &n, &m, &a, &b)
	ticketPrice := float32(b) / float32(m)
	var cost = 0
	if ticketPrice < float32(a) {
		cost += (n / m) * b
		n -= (n / m) * m
		if n * a < b {
			cost += n * a
		} else {
			cost += b
		}
	} else {
		cost += n * a
	}
	fmt.Printf("%d\n", cost)
}

/*
%t: для вывода значений типа boolean (true или false)
%b: для вывода целых чисел в двоичной системе
%c: для вывода символов, представленных числовым кодом
%d: для вывода целых чисел в десятичной системе
%o: для вывода целых чисел в восьмеричной системе
%q: для вывода символов в одинарных кавычках
%x: для вывода целых чисел в шестнадцатиричной системе, буквенные символы числа имеют нижний регистр a-f
%X: для вывода целых чисел в шестнадцатиричной системе, буквенные символы числа имеют верхний регистр A-F
%U: для вывода символов в формате кодов Unicode, например, U+1234
%e: для вывода чисел с плавающей точкой в экспоненциальном представлении, например, -1.234456e+78
%E: для вывода чисел с плавающей точкой в экспоненциальном представлении, например, -1.234456E+78
%f: для вывода чисел с плавающей точкой, например, 123.456
%F: то же самое, что и %f
%g: для длинных чисел с плаващей точкой используется %e, для других - %f
%G: для длинных чисел с плаващей точкой используется %E, для других - %F
%s: для вывода строки
%p: для вывода значения указателя - адреса в шестнадцатеричном представлении
*/


package main

import "fmt"

func main() {
    var s string
    fmt.Scan(&s)
    ans, in := true, 0
    for in < len(s) {
        if s[in] == '1' {
            in++
            if in < len(s) {
                if s[in] == '4' { in++ }
                if in < len(s) {
                    if s[in] == '4' { in++ }
                }
            }
        } else {
            ans = false
            break
        }
    }
    if ans { fmt.Println("YES") } else { fmt.Println("NO") }
}


package main

import (
	"fmt"
	"strings"
)

func main() {
	var str string
	fmt.Scanln(&str)

	chars := strings.Split(str, "")
	var l int
	l = len(chars)

	total := 0;
	for i := 0; i < l; i++ {
		for j := i + 1; j < l; j++ {
			for k := j + 1; k < l; k++ {
				if (chars[i] + chars[j] + chars[k]) == "QAQ" {
					total++
				}
			}
		}
	}

	fmt.Print(total)
}


package main

import "fmt"

func main() {
    var x,t,a,b,da,db int
    fmt.Scan(&x,&t,&a,&b,&da,&db)
    m := make(map[int]bool)
    m[0] = true
    for i := 0; i < t; i++ {
        m[a-(da*i)] = true
    }
    ans := false
    for i := 0; i <= t; i++ {
        if i == t {
            if m[x] {
                ans = true
                break
            }
        } else if m[x-(b-(db*i))] {
            ans = true
            break
        }
    }
    if ans { fmt.Println("YES") } else { fmt.Println("NO") }
}


package main

import "fmt"

func main() {
	var n, x, a, b int
	fmt.Scan(&n)
	for x = n / 2; x > 0; x-- {
		for a, b = n-x, x; b != 0; {
			a, b = b, a%b
		}
		if a == 1 {
			break
		}
	}
	fmt.Println(x, n-x)
}


package main

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

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

func ReadInt() int {
	scanner.Scan()
	ans, _ := strconv.Atoi(scanner.Text())
	return ans
}

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

	w, h := ReadInt(), ReadInt()

	u1,d1 := ReadInt(), ReadInt()
	u2,d2 := ReadInt(), ReadInt()

	for ; h > 0; h-- {
		w += h
		if d1 == h {
			w -= u1
		}
		if d2 == h {
			w -= u2
		}
		if w < 0 {
			w = 0
		}
	}

    writer.WriteString(strconv.Itoa(w))
}


package main

import (
	"fmt"
)

func main() {

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

	count := 0
	for i := 1; i <= n/2; i += 1 {
		if (n - i) % i ==0 {
			count+=1
		}
	}
	fmt.Print(count)
}


package main

import ("fmt";"math")

func main(){
	var n, x, ans int64
	scan(&n, &x)
	for i := int64(1); i <= int64(math.Min(float64(n), float64(x))); i++{
		if x % i == 0 && x / i <= n{
			ans++
		}
	}
	sout(ans)
}

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

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


// Codeforces 560 B  Gerald is into Art, train
package main

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

var in *bufio.Reader

func readFive() (int, int, int, int, int) {
	var a [5]int
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("first read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for i := 0; i < len(ss); i++ {
		a[i], err = strconv.Atoi(ss[i])
		if err != nil {
			fmt.Println("n atoi failure", err)
			panic(err)
		}
	}
	return a[0], a[1], a[2], a[3], a[4]
}

func readLineNumbs(n int) []int {
	a := make([]int, n)
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for j := 0; j < n; j++ {
		aa, err := strconv.Atoi(ss[j])
		if err != nil {
			fmt.Println("aa conv failed", err)
			panic(err)
		}
		a[j] = aa
	}
	return a
}

var a1,b1,a2,b2,a3,b3 int
var canPlace bool

// readData read data for out problem.
func readData() {
	in = bufio.NewReader(os.Stdin)
	// reading a.. b...
	a1,b1,_, _, _ = readFive()
	a2,b2,_, _, _ = readFive()
	a3,b3,_, _, _ = readFive()
}

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

/** can we place a2 b2 in a1 b1 */
func canPlace2(a1,b1,a2,b2 int) bool {
	a1,b1 = toHoriz(a1,b1)
	a2,b2 = toHoriz(a2,b2)
	can := (a2<=a1) && (b2<=b1)
	//fmt.Printf("canPlace2(ab1 %d %d ab2 %d %d) returned %t\n", a1,b1,a2,b2,can)
	return can
}

func solve() {
	a1,b1 = toHoriz(a1,b1)
	a2,b2 = toHoriz(a2,b2)
	a3,b3 = toHoriz(a3,b3)
	canPlace = false
	if !canPlace2(a1, b1, a2, b2) {
		return
	}
	if !canPlace2(a1, b1, a3, b3) {
		return
	}
	// try normal position a2b2
	if canPlace2(a1, b1-b2, a3, b3) {
		canPlace = true
		return
	}
	if canPlace2(a1-a2, b1, a3, b3) {
		canPlace = true
		return
	}
	// try turned a2b2
	if b2>a1 {
		return
	}
	a1,b1 = b1,a1
	if canPlace2(a1, b1-b2, a3, b3) {
		canPlace = true
		return
	}
	if canPlace2(a1-a2, b1, a3, b3) {
		canPlace = true
		return
	}
}

// printRes print problem solution in expected format.
func printRes() {
	if canPlace {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func main() {
	readData()
	solve()
	printRes()
}


/*
Double Cola
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons go to the end of the queue. Then the next in the queue (Leonard) buys a can, drinks it and gets to the end of the queue as two Leonards, and so on. This process continues ad infinitum.

For example, Penny drinks the third can of cola and the queue will look like this: Rajesh, Howard, Sheldon, Sheldon, Leonard, Leonard, Penny, Penny.

Write a program that will print the name of a man who will drink the n-th can.

Note that in the very beginning the queue looks like that: Sheldon, Leonard, Penny, Rajesh, Howard. The first person is Sheldon.

Input
The input data consist of a single integer n (1 ≤ n ≤ 10^9).

It is guaranteed that the pretests check the spelling of all the five names, that is, that they contain all the five possible answers.

Output
Print the single line — the name of the person who drinks the n-th can of cola. The cans are numbered starting from 1. Please note that you should spell the names like this: "Sheldon", "Leonard", "Penny", "Rajesh", "Howard" (without the quotes). In that order precisely the friends are in the queue initially.

Sample test(s)
input
1
output
Sheldon
input
6
output
Sheldon
input
1802
output
Penny
*/
package main

import (
	"fmt"
	"math"
)

func main() {
	names := []string{"Sheldon", "Leonard", "Penny", "Rajesh", "Howard"}
	var n int64
	fmt.Scanf("%d\n", &n)
	if n < 6 {
		fmt.Println(names[n-1])
		return
	}
	round := int64(math.Log2(float64((n-1)/5+1)))
	preSum := int64(math.Pow(2, float64(round))) - 1
	left := n - preSum*5-1
	thisRound := int64(math.Pow(2, float64(round)))
	fmt.Println(names[left/thisRound])
}


package main

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

func main(){
	var a, c int64
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	a, _ = strconv.ParseInt(r.Text(), 0, 64)
	r.Scan()
	c, _ = strconv.ParseInt(r.Text(), 0, 64)
	var b int64
	i := 0
	var x [105]int64
	var y [105]int64
	for i=1; a+c>0; i++ {
		x[i] = a%3
		a /= 3
		y[i] = c%3
		c /= 3
	}
	for i > 1 {
		i -= 1
		b = b*3 + ((y[i]-x[i]+3)%3)
	}
	w.WriteString(strconv.FormatInt(b, 10)+"\n")
	w.Flush()
}


//  URL: http://codeforces.com/contest/4/problem/A
//  PROBLEM RESTATEMENT
//      x ∈ [1, 100]
//      a, b ∈ [0, 100]
//      Find a and b s.t 3a + 7b = x.
//  WORK
//      If x % 3 == 1, we can remove the remainder using a 7 (7 = 3 + 3 + 1).
//      By the same logic, if x % 3 == 2, we can remove the remainder using 2
//      7s (14 = 7 + 7).
//	APPROACH
//      (1) If x is divisible by 7 or 3, return yes.
//      (2) If x >= 10 and x % 3 == 1 and x / 7 >= 1, return yes.
//      (3) If x >= 10 and x % 3 == 2 and x / 7 >= 2, return yes.
//      (4) Otherwise, return no.
//  NOTE
//      When x >= 12, result is yes. Result is no for 1, 2, 4, 5, 8, 11.

package main

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

func solve(x int) string {
	if x%7 == 0 || x%3 == 0 {
		return "YES"
	} else if x>=10 && x%3 == 1 && x/7 >= 1 {
		return "YES"
	} else if x>=10 && x%3 == 2 && x/7 >= 2 {
		return "YES"
	} else {
		return "NO"
	}
}

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


package main

import "fmt"

func Max(x, y int) int {
    result := x
    if y > x {
        result = y
    }

    return result
}

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

    a := make([]int, n)
    diff := make([][]int, n)
    count := make([]int, n + 1)

    count[0] = 0
    for i := 0; i < n; i++ {
        var next int
        fmt.Scanf("%d", &next)
        a[i] = next
        diff[i] = make([]int, n)

        count[i + 1] = count[i] + next

    /*    var val int = 1
        if next == 1 {
            val = -1
        }
        diff[i + 1] = diff[i] + val
        count[i + 1] = count[i] + next*/
    }

    diff[0][0] = (1 - a[0])
    var max int = diff[0][0]
    for i := 1; i < n; i++ {
        for j := 0; j < i; j++ {
            diff[j][i] = (i - j + 1) - (count[i + 1] - count[j])
            max = Max(max, diff[j][i] + count[j + 1] + count[n] - count[i + 1])
        }
    }

    fmt.Println(max)
}


// 12A
package main

import (
	"fmt"
)

func main() {
	var a, b, c string
	fmt.Scanln(&a)
	fmt.Scanln(&b)
	fmt.Scanln(&c)
	if (a[0] == c[2]) && (a[1] == c[1]) && (a[2] == c[0]) && (b[0] == b[2]) {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}


package main

import "fmt"

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

	if sum%5 != 0 || sum == 0 {
		fmt.Print(-1)
	} else {
		fmt.Print(sum / 5)
	}
}


package main

import (
	"fmt"
)

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

	nBurned := nCandles
	nHours := nCandles

	for {
		nSolid := nBurned / parts
		nBurned = nBurned % parts

		if nSolid == 0 {
			break
		}

		nHours += nSolid
		nBurned += nSolid
	}

	fmt.Println(nHours)
}


package main

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

const MAX = 1e6

func solve() {
	a := readInt()
	b := readInt()
	f := readInt()
	k := readInt()
	gas := b
	res := 0
	for i := 0; i < k; i++ {
		if i%2 == 0 {
			gas -= f
			if gas < 0 {
				fmt.Println(-1)
				return
			}
			if i == k-1 {
				if gas < (a - f) {
					res++
					gas = b
				}
			} else {
				if gas < (a-f)*2 {
					res++
					gas = b
				}
			}
			gas -= (a - f)
			if gas < 0 {
				fmt.Println(-1)
				return
			}
		} else {
			gas -= a - f
			if gas < 0 {
				fmt.Println(-1)
				return
			}
			if i == k-1 {
				if gas < f {
					res++
					gas = b
				}
			} else {
				if gas < f*2 {
					res++
					gas = b
				}
			}
			gas -= f
			if gas < 0 {
				fmt.Println(-1)
				return
			}
		}
	}
	fmt.Println(res)
}

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

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

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

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


package main

import "fmt"

// https://codeforces.com/problemset/problem/271/A
// A. Beautiful Year
// time limit per test
// 2 seconds
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// It seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after the old 1987 with only distinct digits.

// Now you are suggested to solve the following problem: given a year number, find the minimum year number which is strictly larger than the given one and has only distinct digits.
// Input

// The single line contains integer y (1000 ≤ y ≤ 9000) — the year number.
// Output

// Print a single integer — the minimum year number that is strictly larger than y and all it's digits are distinct. It is guaranteed that the answer exists.

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

	fmt.Print(nextLuckyYear(y))
}

func nextLuckyYear(y int) int {
	for candidateY := y + 1; ; candidateY++ {
		if isBeautifulYear(candidateY) {
			return candidateY
		}
	}
}

func isBeautifulYear(y int) bool {
	var seenDigit [10]bool

	for ; y > 0; y /= 10 {
		digit := y % 10
		if seenDigit[digit] {
			return false
		}
		seenDigit[digit] = true
	}
	return true
}


package main

import "fmt"

func main() {
	var n, k, result int64
	fmt.Scanf("%d %d", &n, &k)
	if k > n {
		fmt.Println(-1)
		return
	}
	if n %2 == 0 {
		if k <= n / 2 {
			result = 2 * k - 1
		}else {
			result = 2 * (k - n / 2 )
		}
	}else {
		if k <= (n / 2) + 1 {
			result = 2 * k - 1
		}else {
			result = 2 * (k - (n / 2) - 1)
		}
	}

	fmt.Println(result)
}


package main

import (
	"fmt"
	"strings"
)

func propusk(k string) string {
	f := strings.ReplaceAll(k, "BG", "GB")
	return f
}

func main() {
	var n, t int
	var st string
	fmt.Scan(&n, &t)
	fmt.Scan(&st)
	for i := 0; i < t; i++ {
		st = propusk(st)
	}
	fmt.Println(st)
}


package main

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

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int
	for I(&n, " ") == nil {
		solve(n)
	}
}

func solve(n int) {
	var b, bb, m, X, Y int64
	I(&b, "\n")
	x := int64(1)
	for i := 0; i < n; i++ {
		x *= b
	}
	for i := int64(0); i < int64(n); i++ {
		var t int64
		o := " "
		if i == int64(n-1) {
			o = "\n"
		}
		I(&t, o)
		x /= b
		X += x * t
	}
	I(&m, " ")
	I(&bb, "\n")
	y := int64(1)
	for i := int64(0); i < m; i++ {
		y *= bb
	}
	for i := int64(0); i < m; i++ {
		var t int64
		o := " "
		if i == m-1 {
			o = "\n"
		}
		I(&t, o)
		y /= bb
		Y += y * t
	}
	if Y > X {
		O("<", "\n")
	} else if Y < X {
		O(">", "\n")
	} else {
		O("=", "\n")
	}
}


package main

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

import "strings"

func main() {
	reader := bufio.NewReader(os.Stdin)
	text, _ := reader.ReadString('\n')
	text = strings.TrimRight(text, "\r\n")
	s := strings.Split(text, " ")

	l1, _ := strconv.ParseInt(s[0], 10, 64)
	r1, _ := strconv.ParseInt(s[1], 10, 64)
	l2, _ := strconv.ParseInt(s[2], 10, 64)
	r2, _ := strconv.ParseInt(s[3], 10, 64)
	k, _ := strconv.ParseInt(s[4], 10, 64)

	st := l1
	if l2 > st {
		st = l2
	}

	e := r1
	if r2 < e {
		e = r2
	}

	t := e - st + 1
	if k >= st && k <= e {
		t -= 1
	}
	if t < 0 {
		t = 0
	}
	fmt.Println(t)
}


package main
import "fmt"

func main() {
	var x, x1 int
	var ts string
	var t string
	var t1 string
	fmt.Scan(&ts)
	fmt.Scan(&t, &t1)

	if string(t[0])=="T" {
		x=11
	} else if string(t[0])=="A" {
		x=15
	} else if string(t[0])=="K" {
		x=14
	} else if string(t[0])=="Q" {
		x=13
	} else if string(t[0])=="J" {
		x=12
	} else if string(t[0])=="9" {
		x=9
	} else if string(t[0])=="8" {
		x=8
	} else if string(t[0])=="7" {
		x=7
	} else if string(t[0])=="6" {
		x=6
	}
	if string(t1[0])=="T" {
		x1=11
	} else if string(t1[0])=="A" {
		x1=15
	} else if string(t1[0])=="K" {
		x1=14
	} else if string(t1[0])=="Q" {
		x1=13
	} else if string(t1[0])=="J" {
		x1=12
	} else if string(t1[0])=="9" {
		x1=9
	} else if string(t1[0])=="8" {
		x1=8
	} else if string(t1[0])=="7" {
		x1=7
	} else if string(t1[0])=="6" {
		x1=6
	}

	if string(t[1]) == string(ts) && string(t1[1])!=string(ts) {
		fmt.Println("YES")
	} else if string(t[1])!=string(ts) && string(t1[1])==string(ts) {
		fmt.Println("NO")
	} else if string(t[1])!=string(ts) && string(t1[1])!=string(ts) {
		if string(t[1])!=string(t1[1]) {
			fmt.Println("NO")
		} else {
			if x<=x1 {
				fmt.Println("NO")
			} else {
				fmt.Println("YES")
			}
		}
	} else if string(t[1])==string(ts) && string(t1[1])==string(ts) {
		if x<=x1 {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}


package main

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

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

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

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

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

func pri(n int)    { w.WriteString(strconv.Itoa(n)) }
func prll(n int64) { w.WriteString(strconv.FormatInt(n, 10)) }
func sp()          { w.WriteByte(' ') }
func endl()        { w.WriteByte('\n') }
func Max(i, j int) int {
  if i < j {
    return j
  }
  return i
}
func Min(i, j int) int {
  if i >= j {
    return j
  }
  return i
}

func main() {
  sc.Split(bufio.ScanWords)
  r, g, b := ni(), ni(), ni()
  cnt := Min(r, Min(g, b))
  ans := r/3 + g/3 + b/3
  if cnt >= 1 {
    ans = Max(ans, (r-1)/3+(g-1)/3+(b-1)/3+1)
  }
  if cnt >= 2 {
    ans = Max(ans, (r-2)/3+(g-2)/3+(b-2)/3+2)
  }
  pri(ans)
  endl()
  w.Flush()
}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF87C(in io.Reader, out io.Writer) {
	type pair struct{ a0, len int }
	const mx = 1e5
	ps := [mx + 1][]pair{}
	for l := 2; l*(l+1)/2 <= mx; l++ {
		for a0 := 1; ; a0++ {
			s := (2*a0 + l - 1) * l / 2
			if s > mx {
				break
			}
			ps[s] = append(ps[s], pair{a0, l})
		}
	}
	sg := [mx]int{}
	for i := range sg {
		mex := map[int]bool{}
		for _, p := range ps[i] {
			s := 0
			for j := p.a0; j-p.a0 < p.len; j++ {
				s ^= sg[j]
			}
			mex[s] = true
		}
		for ; mex[sg[i]]; sg[i]++ {
		}
	}

	n := 0
	Fscan(in, &n)
	for _, p := range ps[n] {
		s := 0
		for j := p.a0; j-p.a0 < p.len; j++ {
			s ^= sg[j]
		}
		if s == 0 {
			Fprint(out, p.len)
			return
		}
	}
	Fprint(out, -1)
}

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


package main

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

func main() {
	r := bufio.NewReaderSize(os.Stdin, 1024*1024)
	dims := readInts(r, 3)
	n := dims[0]
	prices := [2]int{dims[1], dims[2]}

	if n == 0 {
		fmt.Print(0)
		return
	}

	minP := 0
	if prices[0] < prices[1] {
		minP = prices[0]
	} else {
		minP = prices[1]
	}

	colors := readInts(r, n)

	exp := 0
	for i := 0; i <= (len(colors) - 1) / 2; i++ {
		col := colors[i]
		contI := len(colors) - 1 - i
		contCol := colors[contI]
		if col == 2 && contCol == 2 {
			exp += minP
			if i != contI {
				exp += minP
			}
		} else if col == 2 {
			exp += prices[contCol]
		} else if contCol == 2 {
			exp += prices[col]
		} else if contCol != col {
			exp = -1
			break
		}
	}

	fmt.Print(exp)
}

func readInts(reader *bufio.Reader, n int) []int {
	tmpInts := strings.Split(readLine(reader), " ")

	var result []int
	for i := 0; i < n; i++ {
		tmpInt, err := strconv.ParseInt(tmpInts[i], 10, 64)
		checkError(err)
		result = append(result, int(tmpInt))
	}
	return result
}

func readString(reader *bufio.Reader, l int) string {
	sTemp := readLine(reader)
	if len(sTemp) < l {
		l = len(sTemp)
	}
	return sTemp[:l]
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

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


package main

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

// github.com/EndlessCheng/codeforces-go
func CF300C(in io.Reader, out io.Writer) {
	const m int64 = 1e9 + 7
	const mx int = 1e6
	F := [mx + 1]int64{1}
	for i := 1; i <= mx; i++ {
		F[i] = F[i-1] * int64(i) % m
	}
	pow := func(x, n int64) int64 {
		res := int64(1)
		for ; n > 0; n >>= 1 {
			if n&1 == 1 {
				res = res * x % m
			}
			x = x * x % m
		}
		return res
	}
	invF := [...]int64{mx: pow(F[mx], m-2)}
	for i := mx; i > 0; i-- {
		invF[i-1] = invF[i] * int64(i) % m
	}
	var a, b, n int
	Fscan(in, &a, &b, &n)
	C := func(k int) int64 { return F[n] * invF[k] % m * invF[n-k] % m }
	ans := int64(0)
	d := n * a
	for i := 0; i <= n; i++ {
		v := d
		for ; v > 0; v /= 10 {
			if v%10 != a && v%10 != b {
				break
			}
		}
		if v == 0 {
			ans = (ans + C(i)) % m
		}
		d += b - a
	}
	Fprint(out, ans)
}

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


package main

import "fmt"

func main() {
	var a1,a2,a3,a4 int
	fmt.Scanf("%d%d%d%d", &a1,&a2,&a3,&a4)

	sum := a1 + a2 + a3 + a4
	if sum % 2 != 0 {
		fmt.Printf("NO")
	} else {
		if a1 + a2 == sum / 2 || a1 + a3 == sum / 2 || a1 + a4 == sum / 2 || a1 == sum / 2 || a2 == sum / 2 || a3 == sum / 2 || a4 == sum / 2 {
fmt.Printf("YES")
} else {
fmt.Printf("NO")
}
}
}


package main

import (
	"fmt"
)

func main() {
	var friendsCount, pagesCount, answer int
	fmt.Scan(&friendsCount, &pagesCount)

	answer =
		(friendsCount*8)/pagesCount +
			(friendsCount*5)/pagesCount +
			(friendsCount*2)/pagesCount

	if friendsCount*8%pagesCount != 0 {
		answer++
	}

	if friendsCount*5%pagesCount != 0 {
		answer++
	}

	if friendsCount*2%pagesCount != 0 {
		answer++
	}

	fmt.Println(answer)
}


package main

import "fmt"

func main() {
	var n, L int64
	fmt.Scan(&n, &L)
	c := make([]int64, n)
	for i := range c {
		fmt.Scan(&c[i])
	}
	for i := 1; int64(i) < n; i++ {
		if c[i] > c[i-1]*2 {
			c[i] = c[i-1] * 2
		}
	}
	for len(c) < 30 {
		c = append(c, c[len(c)-1]*2)
	}
	ans := int64(0)
	for i := range c {
		if L&(1<<uint(i)) != 0 {
			ans += c[i]
			if ans > c[i]*2 {
				ans = c[i] * 2
			}
		} else if ans > c[i] {
			ans = c[i]
		}
	}
	fmt.Println(ans)
}


// 121A
package main

import (
	"fmt"
)

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

func main() {
	var a [15]int64
	var i, l, r, x, j, n1, n2 int64
	x, j = 0, 1
	fmt.Scan(&l, &r)
	for i = 0; i <= 10; i++ {
		a[i] = 0
	}
	for j <= r {
		i = 10
		a[i]++
		for a[i] > 2 {
			a[i] = 0
			i--
			a[i]++
		}
		j = 0
		for i = 1; i <= 10; i++ {
			if j > 0 && a[i] == 0 {
				break
			}
			if a[i] == 1 {
				n1 = 4
			} else {
				n1 = 0
			}
			if a[i] == 2 {
				n2 = 7
			} else {
				n2 = 0
			}
			j = j*10 + n1 + n2
		}
		if x == 0 && j >= l {
			x += j
		}
		if i <= 10 {
			continue
		}
		if j >= l {
			x += (min(j, r) - l) * j
			l = j
		}
	}
	fmt.Print(x)
}


package main

import "fmt"

func main() {
    var n int
    fmt.Scan(&n)
    p := make([]int,n+1)
    ans := 0
    for i := 2; i <= n; i++ {
        if p[i] == 0 {
            for a := i; a <= n; a += i {
                p[a]++
            }
        } else if p[i] == 2 {
            ans++
        }
    }
    fmt.Println(ans)
}


// Author: sighduck
// URL: https://codeforces.com/contest/1204

package main

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

func Solve(s string) int {
	maxPowerOfTwo := float64(len(s) - 1)
	powersOfFour := int(math.Ceil(maxPowerOfTwo / 2))
	if int(maxPowerOfTwo)%2 == 0 && strings.Count(s, "1") > 1 {
		return powersOfFour + 1
	}
	return powersOfFour
}

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

	var s string
	fmt.Fscanf(reader, "%s\n", &s)
	fmt.Fprintf(writer, "%d\n", Solve(s))
}


// 233B
package main

import (
	"fmt"
	"math"
)

func main() {
	var a, b, c, i, sum int64
	fmt.Scan(&a)
	b = int64(math.Sqrt(float64(a)))
	for i = b - 100; i <= b; i++ {
		if i < 1 {
			continue
		}
		c = i
		sum = 0
		for c > 0 {
			sum = sum + c%10
			c /= 10
		}
		if (sum+i)*i == a {
			fmt.Print(i)
			return
		}
	}
	c = -1
	fmt.Print(c)
}


package main

import "fmt"

func main() {
	m, n := 0, 0
	fmt.Scanf("%d %d", &m, &n)
	if m < n {
		m, n = n, m
	}
	dCount := m * (n / 2)
	if n%2 != 0 {
		dCount += m / 2
	}
	fmt.Println(dCount)
}


// https://codeforces.com/contest/1355/problem/C
package main

import (
	"fmt"
)

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)

func main() {
	var a, b, c, d int
	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	fmt.Scan(&a, &b, &c, &d)

	refs := make([]int, int(2e6))
	for x := a; x <= b; x++ {
		refs[x+b]++
		refs[x+c+1]--
	}
	for i := 1; i < len(refs); i++ {
		refs[i] += refs[i-1]
	}
	ans := int64(0)
	for i := c; i < len(refs); i++ {
		if refs[i] > 0 {
			ans += int64(refs[i]) * int64(nn(min(d, i - 1) - c + 1))
		}
	}
	fmt.Println(ans)
}

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

func nn(a int) int {
	if a < 0 {
		return 0
	}
	return a
}


package main

import (
	"fmt"
)

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

	count := 0

	if len(line) < 7 {
		fmt.Print("NO")
	} else {
		for i := 0; i < len(line)-1; i++ {
			if line[i] == line[i+1] {
				count++
			} else {
				count = 0
			}

			if count == 6 {
				fmt.Print("YES")
				return
			}
		}
		fmt.Print("NO")
	}
}


package main

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

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

func (in *CF1709A) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1709A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

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

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

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

/**
Run solve the problem CF1709A
Date: 23/07/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1709/A
Problem: CF1709A
**/
func (in *CF1709A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		key := in.NextInt() - 1
		arr := []int{
			in.NextInt() - 1,
			in.NextInt() - 1,
			in.NextInt() - 1,
		}

		ans := true
		//|| arr[arr[arr[key]]] == -1
		if arr[key] == -1 || arr[arr[key]] == -1 {
			ans = false
		}

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

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

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


package main

import (
	"fmt"
)

func main() {
	var x int
	fmt.Scanln(&x)
	a := 0
	for x>0 {
		a += x%2
		x /= 2
	}
	fmt.Println(a)
}


// cf670a project main.go
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var ma int
	if n > 1 {
		ma = 2 + (((n - 2) / 7) * 2)
		if (n-2)%7 > 5 {
			ma += ((n - 2) % 7) - 5
		}
	} else {
		ma = n
	}
	mi := (n / 7) * 2
	if n%7 > 5 {
		mi += (n % 7) - 5
	}
	fmt.Println(mi, ma)
}