package main

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

func solve() {
	n := readInt64()
	k := readInt64() - 1
	res := make([]int64, 0)
	d := int64(2)
	for n >= d {
		for n%d == 0 {
			res = append(res, d)
			n /= d
		}
		d++
	}

	visited := map[int64]bool{}
	arr := []int64{1}
	for i := 0; i < len(res); i++ {
		total := int64(1)
		for j := i; j < len(res); j++ {
			total *= res[j]
			if _, ok := visited[total]; !ok {
				visited[total] = true
				arr = append(arr, total)
			}
		}
	}
	sort.Sort(int64arr(arr))
	if int(k) < len(arr) {
		fmt.Println(arr[k])
	} else {
		fmt.Println(-1)
	}
}

type int64arr []int64

func (a int64arr) Len() int           { return len(a) }
func (a int64arr) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a int64arr) Less(i, j int) bool { return a[i] < a[j] }

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 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"
	"os"
	"sort"
	"strconv"
)

func solve() {
	n := readInt64()
	k := readInt64() - 1
	res := map[int64]int{}
	d := int64(2)
	for n >= d {
		for n%d == 0 {
			addres := []int64{}
			for i, _ := range res {
				addres = append(addres, i*d)
			}
			for _, t := range addres {
				res[t]++
			}
			res[d]++
			n /= d
		}
		d++
	}
	arr := []int64{1}
	for i, _ := range res {
		arr = append(arr, i)
	}
	sort.Sort(int64arr(arr))
	if int(k) < len(arr) {
		fmt.Println(arr[k])
	} else {
		fmt.Println(-1)
	}
}

type int64arr []int64

func (a int64arr) Len() int           { return len(a) }
func (a int64arr) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a int64arr) Less(i, j int) bool { return a[i] < a[j] }

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

// IO

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

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

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

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

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


package main
import "fmt"

func main(){
  fmt.Println("test1")
}


// 409H
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scanf("d%d", &a, &b)
	fmt.Print(a + b)
}


package main

import (
    "fmt"
)

func main() {
    var a, b []byte
    fmt.Scanf("%s %s\n", &a, &b)
    const (
        zero byte = 48
    )
    var i, j int = len(a) - 1, len(b) - 1
    var (
        rev   []byte
        k     byte
        carry bool = false
    )

    for ; i >= 0 && j >= 0; i, j = i-1, j-1 {
        k, carry = add(a[i], b[j], carry)
        rev = append(rev, k)
    }
    for ; i >= 0; i-- {
        k, carry = add(a[i], zero, carry)
        rev = append(rev, k)
    }
    for ; j >= 0; j-- {
        k, carry = add(b[j], zero, carry)
        rev = append(rev, k)
    }

    for i, j = 0, len(rev)-1; i < j; i, j = i+1, j-1 {
        rev[i], rev[j] = rev[j], rev[i]
    }
    fmt.Printf("%s", rev)
}

func add(i byte, j byte, b bool) (k byte, c bool) {
    const (
        zero byte = 48
        ten  byte = 58
    )

    k += i + j - zero
    if b {
        k++
    }
    if k >= ten {
        k -= ten - zero
        c = true
    } else {
        c = false
    }
    return
}


package main

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

var scanner *bufio.Scanner

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

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

  x, o := getI(), getI()
  xPairs := x/2
  if xPairs > o {
    xPairs = o
  }
  x -= 2*xPairs
  o -= xPairs
  oFours := o/3
  if oFours > xPairs {
    oFours = xPairs
  }
  xPairs -= oFours
  o -= 3*oFours
  teams := xPairs + 2*oFours
  if x > 0 && o > 1 {
    x--
    o -= 2
    teams++
  }
  writer.WriteString(fmt.Sprintf("%d %d\n", x, o))
  writer.WriteString(fmt.Sprintf("%d\n", teams))
}


package main

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

func main() {
    //io
    scanner := bufio.NewReader(os.Stdin)
    writer := bufio.NewWriter(os.Stdout)
    //---
    var a, b, ans int
    fmt.Fscan(scanner, &a, &b)
    if a > b {
        a, b = b, a
    }

    for a > 0 {
        a--
        b -= 2
        ans++
        if a > b {
            a, b = b, a
        }
    }
    writer.WriteString(strconv.Itoa(ans))
    writer.Flush()
}


package main

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

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

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

func getLine() string {
	s, _ := reader.ReadString('\n')
	if strings.HasSuffix(s, "\r\n") {
		s = s[:len(s)-2]
	} else if strings.HasSuffix(s, "\n") {
		s = s[:len(s)-1]
	}
	return s
}
func getLine2Int() (n int) {
	scanf("%d\n", &n)
	return
}
func getLine2Int2() (a, b int) {
	scanf("%d %d\n", &a, &b)
	return
}
func getLine2Ints(n int) []int {
	ans := make([]int, n)
	for i := 0; i < n; i++ {
		scanf("%d ", &ans[i])
	}
	scanf("%d\n", &ans[n-1])
	return ans
}

func pcheck(i bool) {
	if i {
		printf("Yes\n")
	} else {
		printf("No\n")
	}
}

var debug = true

func see(a interface{}) {
	if debug {
		printf("DEBUG:%v\n", a)
	}
}

func main() {
	defer writer.Flush()

	n, m := getLine2Int2()
	var x int
	if n*2 < m {
		x = n
	} else if m*2 < n {
		x = m
	} else {
		x = (m + n) / 2
	}
	printf("%d\n", x)
}


// 92A
package main

import (
	"fmt"
	"math"
)

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	m %= (n * (n + 1) / 2)
	x := (math.Sqrt(float64(8*m+1)) - 1) / 2.0
	c := float64(m) - x*(x+1)/2
	fmt.Print(c)
}


package main

import (
	"fmt"
)

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

	sums := make([]int, n+1, n+1)
	for i := 1; i <= n; i++ {
		sums[i] = i + sums[i-1]
	}

	if m > sums[n] {
		m %= sums[n]
	}

	for i := 1; i <= n; i++ {
		if m < sums[i] {
			m -= sums[i-1]
			break
		}
	}

	fmt.Println(m)
}


// 92A-mic
package main

import (
    "fmt"
    "math"
)

func main() {
    var n, m, k, sum int
    fmt.Scan(&n, &m)
    for i := 1; i <= n; i++ {
        sum += i
    }
    m -= sum
    if m > 0 {
        for m > 0 && m > k {
            k = 1
            m -= k
            k++
        }
    } else {
        m = int(math.Abs(float64(m)))
        k = n
        for m > 0 {
            m -= k
            k--
        }
        m = int(math.Abs(float64(m)))
    }
    fmt.Println(m)
}


package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	for i := 1; m-i >= 0; i++ {
		m = i - m
		if i == n {
			i = 0
		}
	}
}


package main

import "fmt"

func fillBigCell(x int, y int, board [][]rune) int {
	count := 0
	for i := x * 3; i < x*3+3; i++ {
		for j := y * 3; j < y*3+3; j++ {
			coox, cooy := i+x, j+y
			if board[coox][cooy] == '.' {
				board[coox][cooy] = '!'
				count++
			}
		}
	}

	return count
}

func main() {
	board := make([][]rune, 11)
	for i := 0; i < 11; i++ {
		board[i] = make([]rune, 11)

		if i != 3 && i != 7 {
			for j := 0; j < 11; j++ {
				fmt.Scanf("%c", &board[i][j])
			}
		}
		fmt.Scanf("\n")
	}
	var lastX, lastY int
	fmt.Scanf("%d%d", &lastX, &lastY)

	bigCellX := (lastX - 1) % 3
	bigCellY := (lastY - 1) % 3

	count := fillBigCell(bigCellX, bigCellY, board)
	if count == 0 {
		for i := 0; i < 11; i++ {
			for j := 0; j < 11; j++ {
				if board[i][j] == '.' {
					board[i][j] = '!'
				}
			}
		}
	}

	for i := 0; i < 11; i++ {
		for j := 0; j < 11; j++ {
			fmt.Printf("%c", board[i][j])
		}
		fmt.Println()
	}
}


package main

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

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

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

	var cuts []int

	odd := 0
	even := 0
	for i := 0; i < n; i++ {
		if odd > 0 && even > 0 && odd == even {
			cuts = append(cuts, (int)(math.Abs((float64)(list[i]-list[i-1]))))
			odd = 0
			even = 0
		}

		if list[i]%2 == 0 {
			even++
		} else {
			odd++
		}
	}

	sort.Ints(cuts)
	cost := 0
	count := 0
	for i := 0; i < len(cuts); i++ {
		cost += cuts[i]

		if cost >= B {
			break
		}

		count++
	}

	fmt.Println(count)
}


package main

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

func Init() {
}

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

	if smallestDivisor(N) <= K {
	  io.Println("No")
	} else {
	  io.Println("Yes")
	}
}

func smallestDivisor(n int64) int64 {
  if n % 2 == 0 {
    return 2
  }
  for d := int64(3); d * d <= n; d += 2 {
    if n % d == 0 {
      return d
    }
  }
  return n
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


package main

import "fmt"

type Pair struct {
    a, b int
}

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

func main(){
    var n int
    fmt.Scanln(&n)
    arr := make([]int, n)

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

    pair := Pair{0, 101}
    for i:=0; i < n-2; i++ {
        if arr[i+2] - arr[i] < pair.b {
            pair.b = arr[i+2] - arr[i]
            pair.a = i+1
        }
    }

    arr = append(arr[:pair.a], arr[pair.a+1:]...)
    res := 0
    for i:=1; i < n-1; i++ {
        res = max(res, arr[i]-arr[i-1])
    }

    fmt.Println(res)
}


package main

import "fmt"

func main() {
    var total int

    var n, a int
    fmt.Scan(&n, &a)

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

    f, b := a-1, a-1
    for f >= 0 && b < n-1 {
        if city[f] == 1 && city[b] == 1 {
            total += 2
            if f == b {
                total--
            }
        }
    }
    fmt.Print(total)
}


package main

import "fmt"

func main() {
    var total int

    var n, a int
    fmt.Scan(&n, &a)

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

    f, b := a-1, a-1
    for f >= 0 && b < n-1 {
        if city[f] == 1 && city[b] == 1 {
            total += 2
            if f == b {
                total--
            }
        }
        f--
        b++
    }
    fmt.Print(total)
}


package main
import (
	"fmt"
)

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

	r, b, y, g := 0, 0, 0, 0

	len_bulbs := len(bulbs)

	for i := 0; i < len_bulbs; i++ {
		if bulbs[i] == '!' {
			for j := i % 4; j < len_bulbs; j = j + 4 {
				switch bulbs[j] {
					case 'R':
						r++
						break
					case 'B':
						b++
						break
					case 'Y':
						y++
						break
					case 'G':
						g++
						break
				}
			}
		}
	}

	fmt.Println(r, b, y, g)
}


package main

import "fmt"

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

func main() {
    var a,b int64
    fmt.Scan(&a,&b)
    fmt.Println(max(a,b))
}


// 343A
package main

import (
	"fmt"
)

func main() {
	var a, b, c, ans int64
	ans = 0
	fmt.Scan(&a, &b)
	for b != 0 {
		ans += a / b
		a %= b
		c = a
		b = a
		b = c
	}
	fmt.Print(ans)
}


package main

import (
	"fmt"
)

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

func f(a, b int64) int64 {
	if a == 0 {
		return 0
	}
	if b == 1 {
		return a
	}
	if a == b - 1 {
		return 1 + f(a, 1)
	}
	g := gcd(a%b, b)
	return a/b + f(a%b/g, b/g)
}

func main() {
	var a, b int64
	fmt.Scan(&a, &b)
	fmt.Println(f(a,b))
}


package main

import (
	"fmt"
)

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

func f(a, b int64) int64 {
	if a == 0 {
		return 0
	}
	t := (b-1) / a + a
	return t
}

func main() {
	var a, b int64
	fmt.Scan(&a, &b)
	count := a/b
	g := gcd(a%b, b)
	count += f((a%b)/g, b/g)
	fmt.Println(count)
}


package main

import "fmt"

func main() {
    var n int
    fmt.Scan(&n)
    for {
        d := n%10
        if d < 5 { fmt.Print("0-|") } else { fmt.Print("-0|") }
        d %= 5
        for i := 0; i < d; i++ { fmt.Print("0") }
        fmt.Print("-")
        for i := d; i < 4; i++ { fmt.Print("0") }
        fmt.Println()
        n /= 10
        if n == 0 { break }
    }
}


package main

import (
  "fmt"
)

func main() {
  var zero2four = [5]string{"-OOOO", "O-OOO", "OO-OO", "OOO-O", "OOOO-"}
  var num int
  fmt.Scan(&num)
  if num == 0 {
    fmt.Printf("O-|" + zero2four[0])
  } else {
    for num != 0 {
      var div int = num % 10
      if div > 5 {
        fmt.Print("-O|")
      } else {
        fmt.Print("O-|")
      }
      fmt.Printf("%s\n", zero2four[div % 5])
      num /= 10
    }
  }
}


package main

import (
	"fmt"
)

var output map[int]string = map[int]string{
	0: "O-|-OOOO",
	1: "O-|O-OOO",
	2: "O-|OO-OO",
	3: "O-|OOO-O",
	4: "O-|OOOO-",
	5: "-O|-OOOO",
	6: "-O|O-OOO",
	7: "-O|OO-OO",
	8: "-O|OOO-O",
	9: "-O|OOOO-",
}

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

	for n > 0 {
		fmt.Println(output[n%10])
		n /= 10
	}
}


package main
import (
	"fmt"
)

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

	for i:=0;i<n;i++ {
		fmt.Scan(&t)
		f:=true
		for j:=0;j<t;j++ {
			if ((t-7*j)%3)==0 {
				fmt.Println("YES")
				f=false
				break
			}
		}
		if f {
			fmt.Println("NO")
		}
	}
}


package main

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

func main() {
	sc := NewScanner()
	N := sc.NextInt()
	for i := 0; i < N; i++ {
		A := sc.NextInt()
		flag := false
		for k := 0; 7*k <= A; k++ {
			if (A-7*k)%3 == 0 {
				fmt.Println("YES")
				flag = true
			}
		}
		if !flag {
			fmt.Println("NO")
		}
	}

}

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


// 337B
package main

import (
	"fmt"
)

func gcd(m, n int) int {
	var x int
	for n != 0 {
		x = n
		n = m % n
		m = x
	}
	return m
}
func main() {
	var a, b, c, d, e, j, k, l int
	fmt.Scan(&a, &b, &c, &d)
	j = a * d
	k = b * c
	if j >= k {
		e = j - k
		l = gcd(e, j)
		e /= l
		j /= l
		fmt.Println(e, "/", j)
	} else {
		e = k - j
		l = gcd(e, k)
		e /= l
		k /= l
		fmt.Println(e, "/", k)
	}
}


package main

import "fmt"

func main() {
	var a, count0 int
	var s string
	fmt.Scanf("%d\n", &a)
	fmt.Scanf("%s\n", &s)
	for _, v := range s{
		if v == '0'{
			count0++
		}
	}
	var ss = "1"
	for i:=0;i<count0;i++{
		ss+="0"
	}
	fmt.Println(ss)
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var (
		n int
		s []byte
	)

	fmt.Scanln(&n)
	fmt.Scanln(&s)

	cnt := 0
	zeroes := 0
	for i := 0; i < n; i++ {
		if s[i] == '1' {
			cnt++
		} else {
			zeroes++
		}
	}

	cnt = int(math.Ceil(float64(cnt) / 2.0))

	// for i := n - 1; i > 0; i-- {
	// 	for j := n - 1; j > 0; j-- {
	// 		if s[j] == '0' {
	// 			s[j], s[j-1] = s[j-1], s[j]
	// 		}
	// 	}
	// }

	if cnt == 0 {
		fmt.Println("0")

		return
	}

	res := ""
	for i := 0; i < cnt; i++ {
		res += "1"
	}

	for i := 0; i < zeroes; i++ {
		res += "0"
	}

	fmt.Println(res)
}


package main
import "fmt"
func main(){
    var n int
    fmt.Scan(&n)
    fmt.Println(n%2)

}


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 {
		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 main() {
	reader := bufio.NewReader(os.Stdin)

	board := make([]string, 3)
	for i := 0; i < 3; i++ {
		board[i], _ = reader.ReadString('\n')
	}
	fmt.Println(solve(board))
}

func solve(board []string) string {
	cnt := make([]int, 2)
	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			if board[i][j] == 'X' {
				cnt[0]++
			} else if board[i][j] == '0' {
				cnt[1]++
			}
		}
	}

	if cnt[1] > cnt[0] || cnt[0]-cnt[1] > 1 {
		return "illegal"
	}

	win := func(x byte) bool {
		for i := 0; i < 3; i++ {
			var ok = true
			for j := 0; j < 3 && ok; j++ {
				ok = board[i][j] == x
			}
			if ok {
				return true
			}
		}

		for j := 0; j < 3; j++ {
			var ok = true
			for i := 0; i < 3 && ok; i++ {
				ok = board[i][j] == x
			}
			if ok {
				return true
			}
		}
		if board[0][0] == x && board[1][1] == x && board[2][2] == x {
			return true
		}
		if board[0][2] == x && board[1][1] == x && board[2][0] == x {
			return true
		}
		return false
	}
	a := win('X')
	b := win('0')
	if a && b {
		return "illegal"
	}
	// determine win next
	if a {
		return "the first player won"
	}
	if b {
		return "the second player won"
	}
	if cnt[0]+cnt[1] == 9 {
		return "draw"
	}
	if cnt[0] > cnt[1] {
		return "second"
	}
	return "first"
}


package main

import (
	"fmt"
	"log"
)

func main() {
	var board string;

	winner := byte('.')

	for i := 0; i < 3; i++ {
		var line string;
		nargs, err := fmt.Scan(&line);
		if err != nil {
			log.Fatal(err)
		}
		if nargs != 1 {
			log.Fatal("narg!", nargs)
		}

		board += line;
	}

	var num_os, num_xs, num_empty int;

	for _, c := range(board) {
		switch c {
		case 'X':
			num_xs++;
			break;
		case '0':
			num_os++;
			break;
		case '.':
			num_empty++;
			break;
		}
	}
	diff := num_xs - num_os
	if diff < 0 || diff > 1 {
		fmt.Println("illegal");
		return
	}

	for i := 0; i < 3; i++ {
		if get(board, i, 0) != '.' &&
			get(board, i, 0) == get(board, i, 1) &&
			get(board, i, 1) == get(board, i, 2) {
			if winner == '.' || winner == get(board, i, 0) {
				winner = get(board, i, 0);
			} else {
				fmt.Println("illegal");
				return
			}
		}
	}

	for i := 0; i < 3; i++ {
		if get(board, 0, i) != '.' &&
			get(board, 0, i) == get(board, 1, i) &&
			get(board, 1, i) == get(board, 2, i) {
			if winner == '.' || winner == get(board, 0, i) {
				winner = get(board, 0, i);
			} else {
				fmt.Println("illegal");
				return
			}
		}
	}

	if get(board, 0, 0) != '.' &&
		get(board, 0, 0) == get(board, 1, 1) &&
		get(board, 1, 1) == get(board, 2, 2) {
		if winner == '.' || winner == get(board, 0, 0) {
			winner = get(board, 0, 0);
		} else {
			fmt.Println("illegal");
			return
		}
	}

	if get(board, 2, 0) != '.' &&
		get(board, 2, 0) == get(board, 1, 1) &&
		get(board, 1, 1) == get(board, 0, 2) {
		if winner == '.' || winner == get(board, 2, 0) {
			winner = get(board, 2, 0);
		} else {
			fmt.Println("illegal");
			return
		}
	}

	if winner == 'X' {
		fmt.Println("the first player won");
		return;
	}

	if winner == '0' {
		fmt.Println("the second player won");
		return
	}

	if num_empty == 0 {
		fmt.Println("draw");
		return
	}

	if diff == 0 {
		fmt.Println("first");
		return
	}
	fmt.Println("second")
}

func get(board string, x int, y int) byte {
	return board[x * 3 + y]
}


package main

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

var scanner *bufio.Scanner

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

var grid = make([][]byte, 3)

func isLine(r, c, dr, dc int, ch byte) int {
  for i := 0; i < 3; i++ {
    if grid[r+i*dr][c+i*dc] != ch {
      return 0
    }
  }
  return 1
}

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

  xCount, oCount := 0, 0
  for i := range grid {
    grid[i] = []byte(getS())
    for j, ch := range grid[i] {
      if ch == 'X' {
        xCount++
        grid[i][j] = 'x'
      } else if ch == '0' {
        oCount++
        grid[i][j] = 'o'
      }
    }
  }
  diff := xCount - oCount
  if diff < 0 || diff > 1 {
    writer.WriteString("illegal\n")
    return
  }
  xLines, oLines := 0, 0
  for i := 0; i < 3; i++ {
    xLines += isLine(0, i, 1, 0, 'x')
    xLines += isLine(i, 0, 0, 1, 'x')
    oLines += isLine(0, i, 1, 0, 'o')
    oLines += isLine(i, 0, 0, 1, 'o')
  }
  xLines += isLine(0, 0, 1, 1, 'x')
  xLines += isLine(0, 2, 1, -1, 'x')
  oLines += isLine(0, 0, 1, 1, 'o')
  oLines += isLine(0, 2, 1, -1, 'o')
  if xLines > 0 && oLines > 0 {
    writer.WriteString("illegal\n")
  } else if xCount+oCount == 9 && xLines == 0 && oLines == 0 {
    writer.WriteString("draw\n")
  } else if xLines > 0 {
    writer.WriteString("the first player won\n")
  } else if oLines > 0 {
    writer.WriteString("the second player won\n")
  } else if xCount > oCount {
    writer.WriteString("second\n")
  } else {
    writer.WriteString("first\n")
  }
}


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


package main

import "fmt"

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

func main() {
    var r,g,b int
    fmt.Scan(&r,&g,&b)
    ans := min(r,min(g,b))
    r -= ans; g -= ans; b -= ans;
    ans += r/3; ans += g/3; ans += b/3
    if (ans > 0) && (((r%3 == 2) && (g%3 == 2)) || ((r%3 == 2) && (b%3 == 2)) || ((g%3 == 2) && (b%3 == 2))) {
        ans++
    }
    fmt.Println(ans)
}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF322B(_r io.Reader, _w io.Writer) {
	a := make([]int, 3)
	ans := 0
	has3 := false
	for i := range a {
		Fscan(_r, &a[i])
		if a[i] >= 3 {
			has3 = true
		}
		ans += a[i] / 3
		a[i] %= 3
	}
	sort.Ints(a)
	if has3 && a[0] == 0 && a[1] == 2 && a[2] == 2 {
		ans++
	} else {
		ans += a[0]
	}
	Fprint(_w, ans)
}

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


package main

import (
	"fmt"
)

func main() {
	var r, g, b int
	fmt.Scan(&r, &g, &b)
	minVal := min(r, g, b)
	r, g, b = r-minVal, g-minVal, b-minVal
	fmt.Printf("%v", (r/3)+(g/3)+(b/3)+minVal)

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


package main

import "fmt"

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

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	cnt := a / 3 + b / 3 + c / 3 + min(a%3, min(b%3, c%3))
	fmt.Println(cnt)
}


package main

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

func main(){
	var n int
	r := bufio.NewScanner(os.Stdin)
	r.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	r.Scan()
	n, _ = strconv.Atoi(r.Text())
	a := make([]int, 3000)
	count := 0
	for i:=2; i<=n; i++ {
		for j:=2; j<i; j++ {
			if a[j] == 0 && i%j == 0 {
				a[i] += 1
			}
		}
		if a[i] == 2 {
			count += 1
		}
	}
	w.WriteString(strconv.Itoa(count)+"\n")
	w.Flush()
}


// 26A
package main

import (
	"fmt"
)

func main() {
	var d [3005]int
	var n int
	fmt.Scan(&n)
	for i := 2; i <= n; i++ {
		if d[i] != 0 {
			continue
		}
		for j := i; j <= n; j += i {
			d[j]++
		}
	}
	res := 0
	for i := 6; i <= n; i++ {
		if d[i] == 2 {
			res++
		}
		fmt.Println(res)
	}
}


package main

import (
	"fmt"
)

func find_lcm(n,m int)(res int){
	x:=n
	y:=m
	for ;n!=m;{
		if n>m{
			n=n-m
		}else{
			m=m-n
		}
	}
	res=x*y/n
	return

}

func main(){

	/*a:= bufio.NewReader(os.Stdin)
	input,_:= a.ReadString('\n')
	n,m,z:= strings.Split(input," ")
	fmt.Println(n,m,z) */

	var n,m,z int
	fmt.Scan(&n, &m, &z);

	lcm := find_lcm(n,m)

	fmt.Println(lcm)

	 fmt.Println(z/lcm)
}


package main

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

func GCD(a, b int) int {
    for b != 0 {
        a, b = b, a%b
    }

    return a
}

func getLine(s *bufio.Scanner) (int,int,int) {
    s.Scan()
    ab := strings.Fields(s.Text())
    a, _ := strconv.Atoi(ab[0])
    b, _ := strconv.Atoi(ab[1])
    c, _ := strconv.Atoi(ab[2])

    return a,b,c
}

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    n, m, z:= getLine(scanner)
    a := 0
    if GCD(n,m) == 1 {
        a = n*m
    } else {
        a = m
    }
    fmt.Println(z / a)
}


package main

import "fmt"

func main() {
	var n, m, z int

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

	// kill them all
	kill_count := 0

	if n == m {
		fmt.Println(z)
		return
	}

	for i := 1; i <= z; i++ {
		if (i)%m == 0 && (i)%n == 0 {
			kill_count += 1
		}
	}

	fmt.Println(kill_count)

	return
}


package main

import "fmt"

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


package main

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

////////////////////////////////////////////////////////////////////////////////

// INPUT TEMPLATE START

type MyInput struct {
	rdr         io.Reader
	lineChan    chan string
	initialized bool
}

func (mi *MyInput) start(done chan struct{}) {
	r := bufio.NewReader(mi.rdr)
	defer func() {
		close(mi.lineChan)
	}()
	for {
		line, err := r.ReadString('\n')
		if !mi.initialized {
			mi.initialized = true
			done <- struct{}{}
		}
		mi.lineChan <- strings.TrimSpace(line)
		if err == io.EOF {
			break
		}
		if err != nil {
			panic(err)
		}
	}
}

func (mi *MyInput) readLine() string {
	// if this is the first call, initialize
	if !mi.initialized {
		mi.lineChan = make(chan string)
		done := make(chan struct{})
		go mi.start(done)
		<-done
	}

	res, ok := <-mi.lineChan
	if !ok {
		panic("trying to read from a closed channel")
	}
	return res
}

func (mi *MyInput) readInt() int {
	line := mi.readLine()
	i, err := strconv.Atoi(line)
	if err != nil {
		panic(err)
	}
	return i
}

func (mi *MyInput) readInt64() int64 {
	line := mi.readLine()
	i, err := strconv.ParseInt(line, 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (mi *MyInput) readInts() []int {
	line := mi.readLine()
	parts := strings.Split(line, " ")
	res := []int{}
	for _, s := range parts {
		tmp, err := strconv.Atoi(s)
		if err != nil {
			panic(err)
		}
		res = append(res, tmp)
	}
	return res
}

func (mi *MyInput) readInt64s() []int64 {
	line := mi.readLine()
	parts := strings.Split(line, " ")
	res := []int64{}
	for _, s := range parts {
		tmp, err := strconv.ParseInt(s, 10, 64)
		if err != nil {
			panic(err)
		}
		res = append(res, tmp)
	}
	return res
}

func (mi *MyInput) readWords() []string {
	line := mi.readLine()
	return strings.Split(line, " ")
}

// INPUT TEMPLATE END

////////////////////////////////////////////////////////////////////////////////

func main() {
	/*tn := time.Now()
	solve([]int64{6, 6, 4})
	log.Println(time.Since(tn))
	return*/
	mi := MyInput{rdr: os.Stdin}
	solve(mi.readInt64s())
	/*
	for caseNo := 1; caseNo <= t; caseNo++ {
		//solve(mi.readLine())
		fmt.Printf("Case #%d: %v\n", caseNo)
	}
	*/
}

func solve(args []int64) {
	w:=args[0]
	h:=args[1]
	p:=args[2]
	wc:=math.Ceil(float64(w)/float64(p))
	hc:=math.Ceil(float64(h)/float64(p))

	fmt.Println(int(wc*hc))

}


package main

import (
	"fmt"
	"strconv"
)

//a,b <=n  && a+b==x
func count(n, x int64) (ans int64) {
	if n >= x {
		n = x - 1
	}
	ans = n - x/2
	if x%2 == 0 {
		ans++
	}
	if ans < 0 {
		ans = 0
	}
	return
}

func main() {
	var n int64
	fmt.Scan(&n)
	if n < 5 {
		fmt.Println(n * (n - 1) / 2)
		return
	}
	var ans int64
	var max9 int64 = 9
	for max9 < n {
		max9 = max9*10 + 9
	}
	if max9/2+1 <= n {
		fmt.Println(count(n, max9))
		return
	}
	smax9 := fmt.Sprint(max9)
	for i := 0; i < len(smax9); i++ {
		tmp := []byte(smax9)
		for j := 0; j < 9; j++ {
			tmp[i] = byte(j) + '0'
			x, _ := strconv.ParseInt(string(tmp), 10, 64)
			ans += count(n, x)
			fmt.Println(count(n, x), x)
			tmp[i] = '9'
		}
	}
	fmt.Println(ans)
}


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 - 1
		ans += extra * more * more
		ans += (mid - extra) * more * less
	}
	fmt.Println(ans)
}


package main

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

func main() {

	reader := bufio.NewReader(os.Stdin)
	testCases, _ := reader.ReadString('\n')
	testCases = strings.Replace(testCases, "\n", "", -1)
	tc, _ := strconv.Atoi(testCases)

	fmt.Println("tc", tc)

	for tc > 0 {
		units, digits := 1000, 4
		number, _ := reader.ReadString('\n')
		number = strings.Replace(number, "\n", "", -1)
		n, _ := strconv.Atoi(number)

		result := (n % 10) * 10
		for n/units == 0 {
			result -= digits
			units /= 10
			digits--
		}

		fmt.Println(result)
		tc--
	}
}


package main

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

var (
	scanner *bufio.Scanner
	writer  *bufio.Writer

	n      int
	result int
)

var x = map[int]int{
	0: 2,
	1: 7,
	2: 2,
	3: 3,
	4: 3,
	5: 3,
	6: 2,
	7: 5,
	8: 1,
	9: 2,
}

func in() {
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	n = readInt()
}

func out() {
	writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	printInt(result)
	printLine()
}

func run() {
	result = x[n%10] * x[n/10]
}

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

// Read.

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

func readLine() string {
	scanner.Split(bufio.ScanLines)
	defer scanner.Split(bufio.ScanWords)
	return readString()
}

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

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

func readFloat64() float64 {
	ans, _ := strconv.ParseFloat(readString(), 64)
	return ans
}

// Write.

func printString(value string) {
	writer.WriteString(value)
}

func printLine() {
	printString("\n")
}

func printSpace() {
	printString(" ")
}

func printInt(value int) {
	printString(strconv.FormatInt(int64(value), 10))
}

func printInt64(value int64) {
	printString(strconv.FormatInt(value, 10))
}

func printFloat64(value float64) {
	printString(strconv.FormatFloat(value, 'f', 10, 64))
}


package main

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

func ParseBinary(x string) int64 {
	res, _ := strconv.ParseInt(x, 2, 64)
	return res
}

var mask [10]int64 = [...]int64{
	ParseBinary("1111110"), ParseBinary("0110000"),
	ParseBinary("1101101"), ParseBinary("1111001"),
	ParseBinary("0110011"), ParseBinary("1011011"),
	ParseBinary("1011111"), ParseBinary("1110000"),
	ParseBinary("1111111"), ParseBinary("1111011")}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	var n int64
	fmt.Fscan(reader, &n)
	nten := n / 10
	none := n % 10
	counter := 0
	for i := int64(0); i < int64(100); i++ {
		ten := i / 10
		one := i % 10
		if mask[ten]&mask[nten] == mask[nten] && mask[one]&mask[none] == mask[none] {
			counter++
		}
	}
	fmt.Fprintln(writer, counter)
	writer.Flush()
}


package main

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

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

	var n string
	fmt.Fscan(reader, &n)

	mp := make(map[string]int)
	mp["0"] = 2
	mp["1"] = 5
	mp["2"] = 2
	mp["3"] = 3
	mp["4"] = 3
	mp["5"] = 4
	mp["6"] = 2
	mp["7"] = 5
	mp["8"] = 1
	mp["9"] = 2

	fmt.Println(mp[string(n[0])] * mp[string(n[1])])

}


package main

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

func verifyReallyBig(num int, minDiff int) (isReallyBig bool, diff int) {
	sum := 0
	for n := num; n > 0; n /= 10 {
		sum += n % 10
	}
	diff = num - sum
	if diff >= minDiff {
		isReallyBig = true
	} else {
		isReallyBig = false
	}
	return
}

func searchMin(n int, s int) (min int) {
	var left, right, diff int
	var isReallyBig bool
	for left, right, diff = 1, n/10 + 1, math.MaxInt32; right > left; {
		min = (left + (right - left) / 2) * 10
		isReallyBig, diff = verifyReallyBig(min, s)
		if isReallyBig {
			right = min / 10
		} else {
			left = min / 10 + 1
		}
	}
	if (diff < s) {
		min = n + 1
	}
	return min
}

func Solve(input io.Reader) (result string) {
	var n, s int
	fmt.Fscan(input, &n, &s)
	return fmt.Sprintln(n - searchMin(n, s) + 1)
}

func main() {
	fmt.Print(Solve(os.Stdin))
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var n, m int
	mod := 1000000007
	res := 1

	fmt.Scan(&n, &m)
	c := (exp(m) - 1) % mod
	for i := 0; i < n; i++ {
		res = res * c % mod
	}
	fmt.Println(res)
}
func exp(x int) int {
	return int(math.Exp2(float64(x)))
}
func comb(x, y int) int {
	m := 1
	n := 1
	for i := 0; i < y; i++ {
		m = m * (x - i)
		n = n * (i + 1)
	}
	return m / n
}
func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}

func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}


package R593_Div2_B

import (
	"fmt"
	"math/big"
)

func main() {
	var n, m int64

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

	var tmp big.Int

	var t1 = tmp.Exp(big.NewInt(2), big.NewInt(m), nil);
	var t2 = tmp.Sub(t1, big.NewInt(1))
	var t3 = tmp.Exp(t2, big.NewInt(n), big.NewInt(1000000007))

	fmt.Print(t3)
}


package main

import (
"fmt"
"math/big"
)

func main() {
	var n, m int64

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

	var tmp big.Int

	var t = tmp.Exp(big.NewInt(2), big.NewInt(m), nil);
	t = tmp.Sub(t, big.NewInt(1))
	t = t.Exp(t, big.NewInt(n), big.NewInt(1000000007))

	fmt.Print(t)
}


package main

import (
	"fmt"
	"sort"
)

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

	if n == 1 {
		print(0)
		return
	}

	cntOdd := (n + 1) / 2
	cntEven := n / 2
	var odd, even []int
	last, emptyLen := -1, 0
	ans := 0
	for i := 0; i < n; i++ {
		fmt.Scan(&x)

		if x == 0 {
			emptyLen++
			continue
		}

		x %= 2
		if x == 1 {
			cntOdd--
		} else {
			cntEven--
		}

		if last != -1 && x != last {
			ans++
		}

		if emptyLen > 0 {
			if last == -1 || last == x {
				// begin or same parity
				if x == 0 {
					even = append(even, emptyLen)
				} else {
					odd = append(odd, emptyLen)
				}
			}
			emptyLen = 0
		}
		last = x
	}

	if last == -1 {
		print(1)
		return
	}
	if emptyLen > 0 {
		if last == 0 {
			even = append(even, emptyLen)
		} else {
			odd = append(odd, emptyLen)
		}
	}
	// fmt.Println("ans", ans, "cntOdd", cntOdd, "cntEven", cntEven)
	// fmt.Println("even", even)
	// fmt.Println("odd", odd)
	sort.Ints(even)
	sort.Ints(odd)
	ans += len(even) + len(odd)
	for _, x = range even {
		if x > cntEven {
			break
		}
		cntEven -= x
		ans--
	}
	for _, x = range odd {
		if x > cntOdd {
			break
		}
		cntOdd -= x
		ans--
	}
	print(ans)
}


package main

import (
	"fmt"
)

func main() {
	const modulo int = 1000000007

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

	cs := make([][]int, n+1)
	for i := 1; i <= n; i++ {
		cs[i] = make([]int, k+1)
		cs[i][1] = 1
	}
	for j := 1; j <= k; j++ {
		cs[1][j] = 1
	}

	for i := 2; i <= n; i++ {
		for j := 2; j <= k; j++ {
			for l := 1; l <= i; l++ {
				if i%l == 0 {
					cs[i][j] += cs[l][j-1]
					cs[i][j] %= modulo
				}
			}
		}
	}

	cnt := 0
	for i := 1; i <= n; i++ {
		cnt += cs[i][k]
		cnt %= modulo
	}
	fmt.Println(cnt)
}


package main
import (
	"fmt"
)
func main() {
	var s int
	fmt.Scan(&s)
    array1 := []string{"zero","one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "forteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"}
	array2 := []string{"twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"}
	if 0 <= s && s <= 19 {
		fmt.Println(array1[s])
	} else if s == 20 || s == 30 || s == 40 || s == 50 || s == 60 || s == 70 || s == 80 || s == 90 {
		fmt.Println(array2[(s/10) - 2])
	} else {
		fmt.Print(array2[(s/10) - 2])
		fmt.Print("-")
		fmt.Println(array1[s%10])
	}
}


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)

	n := nextInt()
	unit := []string{"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}
	ten := []string{"", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"}
	switch {
		case n >= 10 && n < 20: {
			switch n {
				case 10: println("ten")
				case 11: println("eleven")
				case 12: println("twelve")
				case 13: println("thirteen")
				case 14: println("fourteen")
				case 15: println("fifteen")
				case 16: println("sixteen")
				case 17: println("seventeen")
				case 18: println("eighteen")
				case 19: println("nineteen")
			}
		}

		case n < 10:
			println(unit[n])
		case n >= 20:
			print(ten[n/10])
			if n%10 != 0 {
				print("-", unit[n%10])
			}
			println()
	}
}

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

func next() string {
	if !scanner.Scan() {
		panic("Scan error")
	}
	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 printf(format string, a ...interface{}) {
	fmt.Fprintf(writer, format, a...)
}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	exp := map[int]string{
		1:  "one",
		2:  "two",
		3:  "three",
		4:  "four",
		5:  "five",
		6:  "six",
		7:  "seven",
		8:  "eight",
		9:  "nine",
		10: "ten",
		11: "eleven",
		12: "twelve",
		13: "thirteen",
		15: "fifteen",
		18: "eighteen",
		20: "twenty",
		30: "thirty",
		40: "forty",
		50: "fifty",
		80: "eighty",
	}

	var scr int
	fmt.Fscan(reader, &scr)
	if scr == 0 {
		fmt.Println("zero")
		return
	}
	if _, exst := exp[scr]; exst {
		fmt.Println(exp[scr])
		return
	}

	if scr/10 == 1 {
		fmt.Printf("%s%s", exp[scr%10], "teen")
	} else {
		if _, exst := exp[(scr/10)*10]; exst {
			fmt.Print(exp[(scr/10)*10])
		} else {
			fmt.Printf("%s%s", exp[scr/10], "ty")
		}

		fmt.Printf("-%s", exp[scr%10])
	}
}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	exp := map[int]string{
		1:  "one",
		2:  "two",
		3:  "three",
		4:  "four",
		5:  "five",
		6:  "six",
		7:  "seven",
		8:  "eight",
		9:  "nine",
		10: "ten",
		11: "eleven",
		12: "twelve",
		13: "thirteen",
		15: "fifteen"
		18: "eighteen",
		20: "twenty",
		30: "thirty",
		40: "forty",
		50: "fifty",
		80: "eighty",
	}

	var scr int
	fmt.Fscan(reader, &scr)
	if _, exst := exp[scr]; exst {
		fmt.Println(exp[scr])
		return
	}

	if scr/10 == 1 {
		fmt.Printf("%s%s", exp[scr%10], "teen")
	} else {
		if _, exst := exp[(scr/10)*10]; exst {
			fmt.Print(exp[(scr/10)*10])
		} else {
			fmt.Printf("%s%s", exp[scr/10], "ty")
		}

		fmt.Printf("-%s", exp[scr%10])
	}
}


package main

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

func I(i ...interface{}) error {
	_, err := fmt.Fscan(r, i...)
	return err
}

func O(o ...interface{}) {
	fmt.Fprint(w, o...)
}

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

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

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

func solve(n, k, d int) {
	if d > n {
		O("0\n")
		return
	}
	O(do(n, k, d)-1, "\n")
}

func do(n, k, d int) int {
	if n < 0 {
		return 0
	}
	ans := 1
	for i := d; i <= k; i++ {
		ans += do(n-i, k, 1)
		ans %= 1e9 + 7
	}
	return ans
}


package main

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

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

	var n, k, d int
	Fscan(in, &n, &k, &d)
	dp := make([][2]int, n)
	for i := range dp {
		dp[i][0] = -1
		dp[i][1] = -1
	}
	var f func(int, int) int
	f = func(sum int, contain int) int {
		if sum == n {
			return 1
		}
		if contain == 0 && sum+d > n {
			return 0
		}
		if v := dp[sum][contain]; v != -1 {
			return v
		}
		ans := 0
		if contain == 0 {
			for i := 1; i < d; i++ {
				if sum+i > n {
					break
				}
				ans += f(sum+i, 0)
			}
			for i := d; i <= k; i++ {
				if sum+i > n {
					break
				}
				ans += f(sum+i, 1)
			}
		} else {
			for i := 1; i <= k; i++ {
				if sum+i > n {
					break
				}
				ans += f(sum+i, 1)
			}
		}
		dp[sum][contain] = ans
		return ans
	}
	Fprint(out, f(0, 0))
}

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


package main

import (
	"fmt"
	"bufio"
	"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...) }

const MOD = 1000000007
var n, k, d int

func solve (sum, ok int, dp [][]int) int {
	if sum > n {
		return 0
	}
	if sum == n {
		return ok
	}

	if dp[ok][sum] != -1 {
		return dp[ok][sum]
	}

	ways := 0
	for weight := 1; weight <= k; weight++ {
		if weight >= d {
			ways = (ways + solve(sum+weight, 1, dp)) % MOD
		} else {
			ways = (ways + solve(sum+weight, ok, dp)) % MOD
		}
	}

	return ways
}

func main() {
	scanf("%d %d %d\n", &n, &k, &d)

	if n < d {
		fmt.Println(0)
	}
	dp := make([][]int, 2)
	dp[0] = make([]int, 102)
	dp[1] = make([]int, 102)

	for i := 0; i < 102; i++ {
		dp[0][i] = -1
		dp[1][i] = -1
	}

	solve(0,0, dp)
	fmt.Println(solve(0, 0, dp))
}


package main

import "fmt"

func toBaseSeven(number int, size int) []int {
	result := make([]int, size)
	for i := range result {
		result[i] = number % 7
		number /= 7
	}
	return result
}

func checkDistinctOfNumbers(hour []int, minute [] int) bool {
	var numbers [7]int
	for _, v := range hour {
		numbers[v]++
	}

	for _, v := range minute {
		numbers[v]++
	}

	for _, v := range numbers {
		if v > 1 {
			return false
		}
	}

	return true
}

func sizeInBaseSeven(number int) int {
	res := 1
	for number /= 7; number != 0; number /= 7 {
		res++
	}
	return res
}

func main() {
	var n, m, res int
	fmt.Scan(&n, &m)
	n_size, m_size := sizeInBaseSeven(n), sizeInBaseSeven(m)
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if checkDistinctOfNumbers(toBaseSeven(i, n_size), toBaseSeven(j, m_size)) {
				res++
			}
		}
	}
	fmt.Println(res)
}


package main

import "fmt"

func toBaseSeven(number int, size int) []int {
	result := make([]int, size)
	for i := range result {
		result[i] = number % 7
		number /= 7
	}
	return result
}

func checkDistinctOfNumbers(hour []int, minute [] int) bool {
	var numbers [7]int
	for _, v := range hour {
		numbers[v]++
	}

	for _, v := range minute {
		numbers[v]++
	}

	for _, v := range numbers {
		if v > 1 {
			return false
		}
	}

	return true
}

func sizeInBaseSeven(number int) int {
	res := 1
	for number /= 7; number != 0; number /= 7 {
		res++
	}
	return res
}

func main() {
	var n, m, res int
	fmt.Scan(&n, &m)
	n_size, m_size := sizeInBaseSeven(n), sizeInBaseSeven(m)
	if n_size + m_size > 7 {
		fmt.Println("0")
		return
	}
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if checkDistinctOfNumbers(toBaseSeven(i, n_size), toBaseSeven(j, m_size)) {
				res++
			}
		}
	}
	fmt.Println(res)
}


package main

import "fmt"

func minSlots(n int64) int {
	c := 1
	s := int64(7)
	for {
		if s > n {
			return c
		}
		c ++;
		s *= 7
	}
}

var n, m int64
var slotN, slotM int
var ans = 0
var used = make([]bool, 7)
func cal(num []int) int64 {
	var result int64
	for _, n := range num {
		result = result * int64(7) + int64(n)
	}
	return result
}
func dfs(num []int) {
	if len(num) == slotN {
		if cal(num[:slotN]) >= n {
			return
		}
	} else if len(num) == slotN + slotM {
		if cal(num[slotN:]) < m {
			ans ++
		}
		return
	}
	for i, use := range used {
		if !use {
			used[i] = true
			dfs(append(num, i))
			used[i] = false
		}
	}
}

func main() {
	fmt.Scanf("%d %d", &n, &m)
	slotN = minSlots(n)
	slotM = minSlots(m)
	num := make([]int, 0, slotN + slotM + 1)
	dfs(num)
	fmt.Println(ans)
}


package main

import (
  "fmt"
)

func validate(arr []int64, nSlots int, n int64, m int64) bool {
  length := len(arr)
  for i:= 0; i < length; i++ {
    for j:= i+1; j < length; j++ {
      if arr[i] == arr[j] {
        return false
      }
    }
  }
  var num int64
  for i:=0; i < nSlots; i++ {
    num = num*7+arr[i]
  }
  if num >= n {
    return false
  }
  num = 0
  for i:=nSlots; i < length; i++ {
    num = num*7+arr[i]
  }
  if num >= m {
    return false
  }
  //fmt.Println(arr)
  return true
}

func try(arr []int64, depth int, cnt *int) {
  length := len(arr)
  if depth == length {
    if validate(arr, nSlots, n, m) {
      (*cnt)++
    }
    return
  }
  for i:=0; i < 7; i++ {
    arr[depth] = int64(i)
    try(arr, depth+1, cnt)
  }
}
var n, m int64
var nSlots, mSlots int
func main() {
  fmt.Scan(&n, &m)
  for i:=n-1; i > 0; {
    nSlots++
    i /= 7
  }
  for i:=m-1; i > 0; {
    mSlots++
    i /= 7
  }

  if mSlots + nSlots > 7 || mSlots + nSlots == 0 {
    fmt.Println(0)
    return
  }

  //fmt.Println(nSlots, mSlots)
  var arr []int64 = make([]int64, nSlots+mSlots)

  var cnt int
  try(arr, 0, &cnt)
  fmt.Println(cnt)
  //testValidate()
}

func testValidate() {
  arr := make([]int64, 3)
  arr[0] = 0
  arr[1] = 2
  arr[2] = 1
  fmt.Println(validate(arr, 2, 8, 2))
}


package main

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

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

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

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

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}
func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = res*10 + int(c-'0')
		c = io.NextChar()
	}
	return res * sgn
}
func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = int64(-1)
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = res*10 + int64(c-'0')
		c = io.NextChar()
	}
	return res * sgn
}
func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}
func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextInt() + 1
	}
	return arr
}
func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}
func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextLong()
	}
	return arr
}
func (io *FastIO) NextString() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}
func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}
func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}
func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}
func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}
func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}
func IsLineBreakChar(c byte) bool {
	switch c {
	case 0, '\n', '\r':
		return true
	default:
		return false
	}
}
func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


package main

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

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

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


package main

import (
	"fmt"
	"os"
)

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


package main

import (
	"fmt"
)

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


package main

import (
	"fmt"
	"strings"
)

func main() {
	var n int
	fmt.Scan(&inp)
	bySum := func(x int) int { return x / 11 }
	possBySum := bySum(n)
	byReqSymb := func(x string) int { return strings.Count(x, "8") }
	possByReqSymb := byReqSymb(inp)
	if possBySum >= possByReqSymb {
		fmt.Println(possByReqSymb)
	} else {
		fmt.Println(possBySum)
	}
}


// Author: sighduck
// URL: https://codeforces.com/problemset/problem/128/A

package main

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

type Position struct {
	X int
	Y int
}

type Node struct {
	Maria Position
	Time  int
}

func getNeighbors(p Position) []Position {
	neighbors := []Position{
		{X: p.X - 1, Y: p.Y - 1},
		{X: p.X - 1, Y: p.Y},
		{X: p.X - 1, Y: p.Y + 1},
		{X: p.X, Y: p.Y - 1},
		{X: p.X, Y: p.Y},
		{X: p.X, Y: p.Y + 1},
		{X: p.X + 1, Y: p.Y - 1},
		{X: p.X + 1, Y: p.Y},
		{X: p.X + 1, Y: p.Y + 1},
	}
	var validNeighbors []Position
	for _, neighbor := range neighbors {
		if 0 <= neighbor.X && neighbor.X < 8 && 0 <= neighbor.Y && neighbor.Y < 8 {
			validNeighbors = append(validNeighbors, neighbor)
		}
	}
	return validNeighbors
}

func hasStatue(board [8]string, p Position, time int) bool {
	if 0 <= p.X-time && p.X-time < 8 {
		if string(board[p.X-time][p.Y]) == "S" {
			return true
		}
	}
	if 0 <= p.X-time-1 && p.X-time-1 < 8 {
		if string(board[p.X-time-1][p.Y]) == "S" {
			return true
		}
	}
	return false
}

func Solve(board [8]string) string {
	stack := []Node{{Maria: Position{X: 7, Y: 0}, Time: 0}}
	for {
		currentNode, stack := stack[len(stack)-1], stack[:len(stack)-1]
		if currentNode.Time == 8 || currentNode.Maria.X == 0 {
			return "WIN"
		}
		for _, neighbor := range getNeighbors(currentNode.Maria) {
			if !hasStatue(board, neighbor, currentNode.Time) {
				stack = append(stack, Node{Maria: neighbor, Time: currentNode.Time + 1})
			}
		}
		if len(stack) == 0 {
			break
		}
	}
	return "LOSE"
}

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

	var board [8]string
	for i := 0; i < 8; i++ {
		fmt.Fscanf(reader, "%s\n", &board[i])
	}
	fmt.Fprintf(writer, "%s\n", Solve(board))
}


package main

import (
	"fmt"
	"sort"
)

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

func main() {
	var a int
	fmt.Scan(&a)
	v := make([]int, a/2)
	x := [100]bool{}
	for b := range v {
		fmt.Scan(&v[b])
		x[v[b]] = true
	}
	total1 := 0
	total2 := 0
	sort.Ints(v)
	for i, vv := range v {
		total1 += abs(vv, 2+i*2)
		total2 += abs(vv, (i*2)+1)

	}
	if total1 > total2 {
		fmt.Println(total1)
	} else {
		fmt.Println(total2)
	}

}


package main

import (
	"fmt"
	"sort"
)

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

func main() {
	var a int
	fmt.Scan(&a)
	v := make([]int, a/2)
	x := [100]bool{}
	for b := range v {
		fmt.Scan(&v[b])
		x[v[b]] = true
	}
	total1 := 0
	total2 := 0
	sort.Ints(v)
	for i, vv := range v {
		total1 += abs(vv, 2+i*2)
		total2 += abs(vv, (i*2)+1)

	}
	if total1 < total2 {
		fmt.Println(total1)
	} else {
		fmt.Println(total2)
	}

}


package main

import (
	"fmt"
)

var (
	num int
	i   int
	s   [50]int

	b_count  int
	b_count1 int
	w_count  int
	w_count1 int
	ccl      int
	cclp     int
	flag     bool
)

func main() {
	b_count = 0
	w_count = 0

	fmt.Scanln(&num)

	ccl = num / 2
	for i = 0; i < ccl; i++ {
		fmt.Scanf("%d", &cclp)
		s[i] = cclp
	}

	if ccl == 1 {

		fmt.Println(0)
	} else {

		flag = true
		for flag {
			flag = false
			for i = 1; i < num/2; i++ {

				if s[i-1] > s[i] {
					flag = true
					ccl = s[i]
					s[i] = s[i-1]
					s[i-1] = ccl
				}
			}
		}
		fmt.Println(s)
		for i = 0; i < num/2; i++ {
			ccl = s[i] - 2*i - 1
			cclp = s[i] - 2*i - 2
			b_count += Iabs(ccl)
			w_count += Iabs(cclp)

		}

		if b_count < w_count {
			fmt.Println(b_count)
		} else {
			fmt.Println(w_count)
		}
	}
	return
}
func Iabs(a int) int {
	if a < 0 {
		return -a
	} else {
		return a
	}
}


package main

import (
	"fmt"
)

var (
	num     int
	i       int
	s       [100]int
	b_count int
	w_count int
	ccl     int
	cclp    int
	flag    bool
)

func main() {
	b_count = 0
	w_count = 0
	//fmt.Scanf("%d", &num)
	fmt.Scanln(&num)
	for i = 0; i < num/2; i++ {
		fmt.Scanf("%d", &s[i])
	}
	flag = true
	for flag {
		for i = 1; i < num/2; i++ {
			flag = false
			if s[i-1] > s[i] {
				flag = true
				ccl = s[i]
				s[i] = s[i-1]
				s[i-1] = ccl
			}
		}
	}

	for i = 0; i < num/2; i++ {
		ccl = s[i] - 2*i - 1

		cclp = s[i] - 2*i - 2

		b_count += Iabs(ccl)
		w_count += Iabs(cclp)
	}
	if b_count < w_count {
		fmt.Println(b_count)
	} else {
		fmt.Println(w_count)
	}
}
func Iabs(a int) int {
	if a < 0 {
		return -a
	} else {
		return a
	}
}


package main

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

func main() {

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	scanner.Scan()
	ans := strings.Split(scanner.Text(), "")

	total := 0
	for i := 0; i < len(ans)-1; i++ {
		a, _ := strconv.Atoi(ans[i])
		total += a
		if findGolden(total, ans[i+1:]) {
			fmt.Print("YES")
			return
		}
	}
	fmt.Print("NO")
}

func findGolden(cut int, rem []string) bool {
	total := 0
	for i := 0; i < len(rem); i++ {
		a, _ := strconv.Atoi(rem[i])

		total += a
		if total > cut {
			return false
		}
		if total == cut {
			return i+1 == len(rem) || findGolden(cut, rem[i+1:])

		}
	}
	return false
}


package main

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

type vec struct{ x, y int64 }

func (a vec) sub(b vec) vec   { return vec{a.x - b.x, a.y - b.y} }
func (a vec) dot(b vec) int64 { return a.x*b.x + a.y*b.y }
func (a vec) det(b vec) int64 { return a.x*b.y - a.y*b.x }

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

	f := func(a, b, c vec) bool {
		a, b = b.sub(a), c.sub(a)
		return a.x == 0 && b.y == 0 || a.y == 0 && b.x == 0
	}
	var a, b, c vec
	Fscan(in, &a.x, &a.y, &b.x, &b.y, &c.x, &c.y)
	if b.sub(a).det(c.sub(b)) == 0 {
		Fprint(out, 1)
	} else if f(a, b, c) || f(b, a, c) || f(c, a, b) {
		Fprint(out, 2)
	} else {
		Fprint(out, 3)
	}
}

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


package main

import "fmt"

func main () {
    var h, w, hs1, hw1, hs2, hw2 int32
    var count int32

        count = 0
        fmt.Scanf("%d %d\n", &w, &h)
        fmt.Scanf("%d %d\n", &hw1,&hs1)
        fmt.Scanf("%d %d\n", &hw2, &hs2)

        count = ((h*(h+1))/2) + w
        //fmt.Println(count)
        if (count < hw1) {
            count = 0
        } else {
            count = count - hw1
        }

        if (count < hw2) {
            count = 0
        } else {
            count = count - hw2
        }
        fmt.Println(count)
}


package main

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

func sum(st, end int) int {
	if st > end{
		return 0
	}
	return (st + end) * (end - st + 1) / 2
}
func main() {
	buf := bufio.NewReader(os.Stdin)
	var w, h int
	fmt.Fscanf(buf, "%d %d\n", &w, &h)
	//_,err := ioutil.ReadFile(str)
	var u1, d1 int
	var u2, d2 int
	fmt.Fscanf(buf, "%d %d\n", &u1, &d1)
	fmt.Fscanf(buf, "%d %d\n", &u2, &d2)
	ans := w+sum(d2,h)
	//fmt.Printf("ans1=%d\n",ans)
	ans -= u2;
	//fmt.Printf("ans2=%d\n",ans)
	if ans < 0 {
		ans = 0
	}
	ans += sum(d1,d2-1)
//	fmt.Printf("ans3=%d\n",ans)
	ans -= u1+1;
//	fmt.Printf("ans4=%d\n",ans)
	if ans < 0 {
		ans = 0
	}
	ans += sum(d1-1,1)
	fmt.Printf("%d\n",ans)
}


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

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


package main

import (
	"fmt"
)

func main() {
	var (
		n int
	)
	fmt.Scan(&n)
	a, b := Calculate854A(n)
	fmt.Print(a, b)
}

func Calculate854A(n int) (int, int) {
	var maxA = 0
	var maxB = 0
	for i := 1; i < n; i++ {
		var a = i
		var b = n - i
		if a >= b {
			break
		}
		if Gcd(a, b) != 0 {
			maxA = a
			maxB = b
		}
	}
	return maxA, maxB
}

func Gcd(a int, b int) (int) {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var a, b int
	if n %2 == 0{
		a = n/2-1
		b = n/2+1
	} else {
		a = n/2
		b = n/2+1
	}
	fmt.Println(a, " ", b)
}


#include <bits/stdc++.h>
#define tr(v,it) for(auto it=v.begin(); it!=v.end(); it++)
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define F first
#define S second
#define endl "\n"
#define MOD 1000000007
#define pie 3.141592653589793
#define INF 1e18
using namespace std;

int main()
{
        //freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);

        ios::sync_with_stdio(0); cin.tie(0);

        long long n;
        cin>>n;
        double value=0;
        long long x,y;
        for(int i=1; i<=n; i++)
        {
                for(int j=i; j<=n; j++)
                {
                        long long a=i;
                        long long b=j;
                        if(a+b==n)
                        {
                                long long k=__gcd(i,j);
                                if(k==1)
                                {
                                        double tempv=(a*1.0/b);
                                        if(tempv>value)
                                        {
                                                x=i;
                                                y=j;
                                        }
                                }
                        }

                }
        }
        cout<<x<<" "<<y<<endl;

        return 0;
}


package main

import "fmt"

func vzaimnoProst(a, b int) bool {
	return gcd(a, b) == 1
}

func gcd(a, b int) int {
	for a != b {
		if a > b {
			a -= b
		} else {
			b -= a
		}
	}

	return a
}

func main() {
	var a, b, n int
	fmt.Scanf("%d", &n)
	if n%2 == 0 {
		a = n/2 - 1
		b = n/2 + 1
	} else {
		a = n / 2
		b = n/2 + 1
	}
	for !vzaimnoProst(a, b) {
		a++
		b--
	}
	fmt.Println(a, b)
}


import "fmt"

func main() {
	var (
		n int
		k int
	)
	fmt.Scan(&n, &k)
	min, max := Calculate854B(n, k)
	fmt.Print(min, max)
}

func Calculate854B(n int, k int) (int, int) {
	var min = 1
	var max = n - k
	if k <= n/3 {
		max = k * 2
	}
	if n == k || k == 0 {
		min = 0
		max = 0
	}
	return min, max
}


package main

import (
        "fmt"
)

var (
        n int
        k int
)

func main() {
        fmt.Scan(&n, &k)
        min := 1
        max := k + 1
        if k <= n/3 {
                max = k * 2
        } else if max > n-k {
                max = n - k
        }
        if k == n || k == 0 || n == 0 {
                min = 0
                max = 0
        }
        fmt.Println(min, max)
}


package main

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

func main() {
	sc := NewScanner()
	N, K := sc.NextInt(), sc.NextInt()
	if N == K {
		fmt.Println(0, 0)
		return
	}
	fmt.Println(1, min(K*2, N-K))

}

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

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, k, lo, hi int64
	fmt.Scan(&n, &k)
	if k != 0 && k != n {
		lo = 1
	}
	n -= k
	if k*3 <= n {
		hi = k * 2
	} else if n <= k {
		hi = n
	} else {
		hi = n - k
	}
	fmt.Println(lo, hi)
}


package main

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

func fastRead(reader *bufio.Reader) (i int, j int) {
	var c rune
	c, _, _ = reader.ReadRune()

	//space = 32
	//space and between 0-9
	for c != 32 && c > 47 && c < 58 {
		//x = x*10+c
		i = (i << 1) + (i << 3) + int(c) - 48
		c, _, _ = reader.ReadRune()
	}

	c, _, _ = reader.ReadRune()
	//newline = 10
	for c != 10 && c > 47 && c < 58 {
		//x = x*10+c
		j = (j << 1) + (j << 3) + int(c) - 48
		c, _, _ = reader.ReadRune()
	}

	return
}

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

	var x, y = fastRead(reader)

	if y <= 0 || (x%2 == 0 && y%2 == 0) {
		fmt.Println("No")
		return
	}

	var x2 = x - (y - 1)
	/*for x1 < x {
		x1 += 2
	}*/

	if y <= 1 && x > 0 || x2%2 == 1 {
		fmt.Println("No")
	} else {
		fmt.Println("Yes")
	}
}


package main

import (
	"fmt"
)

func failed() {
  fmt.Println("No")
}
func Success() {
  fmt.Println("Yes")
}

func main(){
  var copied, original int
  fmt.Scan(&copied, &original)
  for original > 1 {
    original--
    copied--
    if(copied < 0 ){
      failed();
      return
    }
  }
  for copied > 0{
    copied -= 2
    if(copied < 0){
      failed();
      return
    }
  }
  Success()
}


package main

import (
	"fmt"
)

func failed() {
  fmt.Println("No")
}
func Success() {
  fmt.Println("Yes")
}

func main(){
  var copied, original int
  fmt.Scan(&copied, &original)
	if(original == 1){
		if(copied >= 1){
			failed()
			return
		}
	}
	if(original > copied + 1){
		failed()
		return
	}
	copied -= original - 1

  if( copied % 2 == 0){
		Success()
	}	else{
		failed()
	}
}


package main

import (
	"fmt"
)

func main() {
	var x, y int64
	fmt.Scan(&x, &y)
	cal := x - (y - 1)
	if x == 0 && y == 1 {
		fmt.Printf("yes")
	} else if x == 1 && y == 0 {
		fmt.Printf("no")
	} else if cal%2 == 0 && cal > 0 {
		fmt.Printf("yes")
	} else if cal <= 0 && y-1 == x {
		fmt.Printf("yes")
	} else {
		fmt.Printf("no")
	}

}


package main

import (
	"fmt"
	"github.com/go-redis/redis"

	"net/http"
	"log"
)

func saveStat(redisClient *redis.Client) func (w http.ResponseWriter, r *http.Request) {
	return func (w http.ResponseWriter, r *http.Request) {
		err := redisClient.Set("key", "value", 0).Err()
		if err != nil {
			panic(err)
		}
		fmt.Fprintf(w, "{\"status\": \"ok\"}")
		fmt.Println(r.URL.Query()["param"])
		fmt.Println(r.URL.Query()["value"])
	}
}

func main() {

	client := redis.NewClient(&redis.Options{
		Addr:     "127.0.0.1:6379",
		Password: "",
		DB:       0,
	})

	http.HandleFunc("/set", saveStat(client)) // set router
	err := http.ListenAndServe(":9090", nil) // set listen port
	if err != nil {
		log.Fatal("ListenAndServe: ", err)
	}

}


package main

import (
        "fmt"
)

var n int
var x int
var a [101]int

func main() {
        fmt.Scan(&n, &x)
        cnt := 0
        for i := 0; i < n; i++ {
                fmt.Scan(&a[i])
        }
        if a[0] != 0 {
                fmt.Println(0)
        } else {
                for i := 0; i < n; i++ {
                        cnt += a[i]
                        if cnt >= x {
                                fmt.Println(i + 1)
                                break
                        }
                }
        }
}


package main

import (
	"fmt"
	"log"
)

func init() {
	log.SetFlags(0)
}

func main() {
	var flag bool
	var n, x, mark int
	fmt.Scanf("%d %d", &n, &x)
	arr := make([]int, x)
	for i := range arr {
		arr[i] = i
	}
	for i, tmp := 0, 0; i < n; i++ {
		fmt.Scanf("%d ", &tmp)
		if tmp < x {
			for j, val := range arr {
				if tmp == val {
					mark = j
					break
				}
			}
			arr = arr[:mark+copy(arr[mark:], arr[mark+1:])]
		} else if tmp == x {
			flag = true
		}
	}
	if flag {
		fmt.Println(len(arr) + 1)
	} else {
		fmt.Println(len(arr))
	}
}


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

func main() {
	var n,x,a int
	var abc string
	fmt.Scan(&n,&abc)
	for i:=0;i<n/2;i++ {
		a=n-i-1
		x+=int(abc[i])
		if (string(abc[i])!="4" && string(abc[i])!="7")  || (string(abc[a])!="4" && string(abc[a])!="7"){
			x=1
			break
		}
	}
	if x!=0 {
	fmt.Println("NO")
	} else {
	fmt.Println("YES")
	}
}


// 146A
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanln(&n)
	var number string
	fmt.Scanf(number)
	out := "YES"
	firstSum, secondSum := 0, 0
	for k := 0; k < n/2; k++ {
		if number[k] != '4' && number[k] != '7' {
			out = "NO"
		}
		if number[n/2+k] != '4' && number[n/2+k] != '7' {
			out = "NO"
		}
		firstSum += int(number[k] - '0')
		secondSum += int(number[n/2+k] - '0')
	}
	if firstSum != secondSum {
		out = "NO"
	}
	fmt.Println(out)
}


// 146A
package main

import (
	"fmt"
)

func main() {
	var n int
	var x string
	fmt.Scan(&n)
	fmt.Scan(&x)
	out := "YES"
	firstSum, secondSum := 0, 0
	for k := 0; k < n; k++ {
		if x[k] != 4 && x[k] != 7 {
			out = "NO"
		}
		if k < (n / 2) {
			firstSum += int(x[k] - '0')
		} else {
			secondSum += int(x[k] - '0')
		}
	}
	if firstSum != secondSum {
		out = "NO"
	}
	fmt.Println(out)
}


package main

import (
	"bufio"
	"os"
	"fmt"
)
var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }
func println(a ...interface{}) { fmt.Fprintln(writer, a...) }
func scanln(a ...interface{}) { fmt.Fscanln(reader, a...) }
func print(a ...interface{}) { fmt.Fprint(writer, a...) }
func scan(a ...interface{}) { fmt.Fscan(reader, a...) }

func main() {
	defer writer.Flush()
	var n int
	scanln(&n)
	a := 0
	r := 0
	for i := 0; i <n ; i++ {
		var b int
		scan(&b)
		r += b - a - 1
		a = b
	}
	if r >= 0 {
		fmt.Println(r)
	} else {
		println(0)
	}
}


package main

import "fmt"

func main() {
	var a int
        var b int
        var c int
	fmt.Scan(&a, &b, &c)
	if b >=a and c >= a  {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


package main

import "fmt"

func main() {
	var n, m, k int
	fmt.Scan(&n, &m, &k)
	if n <= m || n <= k {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}


package main

import (
	"fmt"
	"strings"
)

func main() {
	var s string
	fmt.Scanf("%s", &s)
	substrs := strings.Split(s, "WUB")
	for i := 0; i < len(substrs)-2; i++ {
		if substrs[i] != "" {
			fmt.Print(substrs[i] + " ")
		}
	}
	fmt.Print(substrs[len(substrs)-2])
}


package main

import "fmt"

func IsWUB(pos int, s string) bool {
    if (pos+3 > len(s)) {
        return false
    } else if (s[pos] == 'W') && (s[pos+1] == 'U') && (s[pos+2] == 'B') {
        return true
    } else {
        return false
    }
}

func main() {
    var s string
    fmt.Scan(&s)
    first := true
    for i := 0; i < len(s); {
        if IsWUB(i,s) {
            i += 3
        } else {
            if !first { fmt.Print(" ") } else { first = false }
            for ; !IsWUB(i,s); i++ {
                fmt.Print(string(s[i]))
                if ((i+1) == len(s)) { break }
            }
        }
        if ((i+1) == len(s)) { break }
    }
    fmt.Println()
}


package main

import (
	"fmt"
	"strings"
)

func main() {
	const WUB = "WUB"
	var song string
	fmt.Scanf("%s", &song)
	words := strings.Split(song, WUB)
	fmt.Println(words)
	var result string
	for _, word := range words {
		if len(word) == 0 {
			continue
		} else {
			result += word + " "
		}
	}
	fmt.Println(strings.TrimSpace(result))
}


package main

import (
	"fmt"
)

func main() {
	var s string
	var flag bool
	var count, i int
	fmt.Scanf("%s", &s)
	count = len(s)
	for {
		if i == count {
			break
		}
		if s[i] == 'W' && s[i+1] == 'U' && s[i+2] == 'B' {
			i = i + 3
			if flag {
				fmt.Printf(" ")
			}
		} else {
			fmt.Printf("%c", s[i])
			flag = true
			i++
		}
	}
}


package main

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

func main() {
	var n, k int
	var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

	scanner.Scan()
	fmt.Sscanf(scanner.Text(), "%d %d", &n, &k)

	x := 0
	for m := (240 - k) / 5; m >= x && x < n; m -= x {
		x++
	}

	fmt.Print(x)
}


package main

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

func solve() {
    n, k := readInt(), readInt()
    cur := 4*60-k
    ans := 0
    for i := 1; i <= n; i++ {
        cur -= 5*i
        if cur >= 0 {
            ans++
        }
    }
    fmt.Println(ans)
}

// Helpers

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

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

// Helpers

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

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

// Math

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

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

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

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

// Sort

type Ints64 []int64

func (a Ints64) Len() int           { return len(a) }
func (a Ints64) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a Ints64) Less(i, j int) bool { return a[i] < a[j] }

/* Sort tempalte
func (a ) Len() int           { return len(a) }
func (a ) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ) Less(i, j int) bool { return  }
*/


package main

import (
	"fmt"
)

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

	if abs(a-b) < 2 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func abs(n int) int {
	if n >= 0 {
		return n
	} else {
		return -n
	}
}


package main

import "fmt"

func abs(x int) int {
	if x >= 0 {
		return x
	} else {
		return x * -1
	}
}

func main() {
	var a, b int
	fmt.Scanf("%d %d\n", &a, &b)
	if abs(a-b) == 1 || abs(a-b) == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

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

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

	if Abs(A - B) <= 1 {
		io.Println("YES")
	} else {
		io.Println("NO")
	}
}

func Abs(x int) int {
	if (x < 0) {
		return -x
	} else {
		return x
	}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


package main

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

func main() {
	sc := NewScanner()
	a := sc.NextInt()
	b := sc.NextIntArray()

	if a == b || a == b + 1 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}

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"
	"os"
	"strconv"
	"fmt"
	"strings"
)

var in *bufio.Scanner = bufio.NewScanner(os.Stdin)
var out *bufio.Writer = bufio.NewWriter(os.Stdout)

func main() {
	defer out.Flush()
	in.Split(bufio.ScanWords)

	keys := []string{
		"qwertyuiop",
		"asdfghjkl;",
		"zxcvbnm, ./",
	}

	dx := 1
	if next() == "R" {
		dx = -1
	}

	for _, k := range next() {
		for _, s := range keys {
			if strings.IndexRune(s, k) > -1 {
				fmt.Print(string(s[strings.IndexRune(s, k) + dx]))
			}
		}
	}

}

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


package main

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

var in *bufio.Scanner = bufio.NewScanner(os.Stdin)
var out *bufio.Writer = bufio.NewWriter(os.Stdout)

func main() {
	defer out.Flush()
	in.Split(bufio.ScanWords)

	keys := "qwertyuiopasdfghjkl;zxcvbnm, ./"

	dx := 1
	if next() == "R" {
		dx = -1
	}

	for _, k := range next() {
		if strings.IndexRune(keys, k) > -1 {
			fmt.Print(string(keys[strings.IndexRune(keys, k) + dx]))
		}
	}
}

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


package main

import "fmt"

func main() {
	upperRow := map[string]int{"q": 1, "w": 2, "e": 3, "r": 4, "t": 5, "y": 6, "u": 7, "i": 8, "o": 9, "p": 10}
	lookUpUpperRow := map[int]string{1: "q", 2: "w", 3: "e", 4: "r", 5: "t", 6: "y", 7: "u", 8: "i", 9: "o", 10: "p"}

	middleRow := map[string]int{"a": 1, "s": 2, "d": 3, "f": 4, "g": 5, "h": 6, "j": 7, "k": 8, "l": 9, ";": 10}
	lookUpMiddleRow := map[int]string{1: "a", 2: "s", 3: "d", 4: "f", 5: "g", 6: "h", 7: "j", 8: "k", 9: "l", 10: ";"}

	lowerRow := map[string]int{"z": 1, "x": 2, "c": 3, "v": 4, "b": 5, "n": 6, "m": 7, ",": 8, ".": 9, "/": 10}
	lookUpLowerRow := map[int]string{1: "z", 2: "x", 3: "c", 4: "v", 5: "b", 6: "n", 7: "m", 8: ",", 9: ".", 10: "/"}

	var shiftDirection, inputString string

	fmt.Scanf("%s\n", &shiftDirection)

	fmt.Scanf("%s\n", &inputString)

	strSize := len(inputString)

	for i := 0; i < strSize; i++ {
		if upperRow[string(inputString[i])] != 0 {
			targetPos := upperRow[string(inputString[i])]
			if shiftDirection == "L" {
				fmt.Print(lookUpUpperRow[targetPos-1])
			} else {
				fmt.Print(lookUpUpperRow[targetPos+1])
			}
		} else if middleRow[string(inputString[i])] != 0 {
			targetPos := middleRow[string(inputString[i])]
			if shiftDirection == "L" {
				fmt.Print(lookUpMiddleRow[targetPos-1])
			} else {
				fmt.Print(lookUpMiddleRow[targetPos+1])
			}
		} else {
			targetPos := lowerRow[string(inputString[i])]
			if shiftDirection == "L" {
				fmt.Print(lookUpLowerRow[targetPos-1])
			} else {
				fmt.Print(lookUpLowerRow[targetPos+1])
			}
		}
	}

	fmt.Println()

}


package main

import "fmt"

func main() {
	var n int64
	fmt.Scan(&n)
	secondDigit := n / 10
	firstDigit := n / 100 * 10 + n % 10

	if firstDigit > secondDigit && firstDigit > n {
		fmt.Printf("%d", firstDigit)
	}else if secondDigit > firstDigit && secondDigit > n {
		fmt.Printf("%d", secondDigit)
	}else {
		fmt.Printf("%d", n)
	}
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	if n < 0 {
		n = -n
		steplast := (n / 10) % 10
		if steplast == 0 {
			n = n / 10
		} else {
			n = n%10 + (n/100)*10
		}
		n = -n
	}
	fmt.Print(n)
}


package main

import "fmt"

func main() {
    var s string
    fmt.Scan(&s)
    if s[0] == '-' {
        del := 1
        for i := 1; i < len(s); i++ {
            if s[del] < s[i] { del = i }
        }
        ans := 0
        for i := 1; i < len(s); i++ {
            if i != del { ans = (ans*10) + int(s[i]-'0') }
        }
        fmt.Println(-ans)
    } else {
        fmt.Println(s)
    }
}


package main

import "fmt"

// A. Nearly Lucky Number
// time limit per test
// 2 seconds
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

// Unfortunately, not all numbers are lucky. Petya calls a number nearly lucky if the number of lucky digits in it is a lucky number. He wonders whether number n is a nearly lucky number.
// Input

// The only line contains an integer n (1 ≤ n ≤ 1018).

// Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is preferred to use the cin, cout streams or the %I64d specificator.
// Output

// Print on the single line "YES" if n is a nearly lucky number. Otherwise, print "NO" (without the quotes).

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

	var nLuckyDigits int
	for ; n > 0; n /= 10 {
		digit := n % 10
		if digit == 4 || digit == 7 {
			nLuckyDigits++
		}
	}

	for ; nLuckyDigits > 0; nLuckyDigits /= 10 {
		digit := nLuckyDigits % 10
		if digit != 4 && digit != 7 {
			fmt.Print("NO")
			return
		}
	}

	fmt.Print("YES")
}


package main

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

func main() {

	buf := new(bytes.Buffer)

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanLines)

	str := ""

	for sc.Scan() {
		str = sc.Text()
		break
	}
	lower := "qwertyuiopasdfghjklzxcvbnm"
	rd := strings.NewReader(str)
	sc = bufio.NewScanner(rd)
	sc.Split(bufio.ScanRunes)
	i := 0
	for sc.Scan() {
		i ++
		if i == 1 {
			{
				buf.WriteString(strings.ToUpper(sc.Text()))

			}
			buf.WriteString(strings.ToLower(sc.Text()))
		}

	}
	io.Copy(os.Stdout, buf)
}


package main

import (
	"bytes"
	"fmt"
	"strings"
	"unicode"
)

func main() {
	var s string
	fmt.Scan(&s)
	var ok = true
	for i := 1; i < len(s); i++ {
		if 'a' <= s[i] && s[i] <= 'z' {
			ok = false
			break
		}
	}
	if ok {
		var buffer bytes.Buffer
		buffer.WriteRune(unicode.ToUpper(rune(s[0])))
		buffer.WriteString(strings.ToLower(s[1:]))
		fmt.Print(buffer.String())
		return
	}
	fmt.Print(s)
}


package main

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

func main() {
	var n, m, z, cnt, cnt1, cnt2 int

	scr := bufio.NewReader(os.Stdin)
	ocr := bufio.NewWriter(os.Stdout)

	fmt.Fscanln(scr, &n, &m)
	t := make([]int, n)
	res := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Fscanf(scr, "%d", &z)

		t[i] = z
	}

	for x, y := range t {
		cnt += y
		if cnt > m {
			cnt2 = cnt
			sort.Ints(t[:x])
			for i := len(t[:x]) - 1; i >= 0; i-- {

				cnt2 -= t[i]
				cnt1++

				if cnt2 <= m {
					res[x] = cnt1
					cnt1 = 0
					break
				}
			}
		} else {
			res[x] = 0
		}
	}

	for _, y := range res {
		fmt.Fprintf(ocr, "%d ", y)
	}
	ocr.Flush()

}


package main

import "fmt"

func main() {
	var n, m, k int
	fmt.Scan(&n, &m, &k)
	if n <= m || n <= k {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}


package main

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

func main() {
	do()
}

func do() {
	s := bufio.NewScanner(os.Stdin)
	s.Split(bufio.ScanWords)
	s.Scan()
	n, _ := strconv.Atoi(s.Text())
	s.Scan()
	m, _ := strconv.Atoi(s.Text())
	s.Scan()
	k, _ := strconv.ParseInt(s.Text(), 10, 64)
	s.Scan()
	x, _ := strconv.Atoi(s.Text())
	s.Scan()
	y, _ := strconv.Atoi(s.Text())

	min := minAsk(n, m, k)
	max := maxAsk(n, m, k)
	cnt := count(n, m, x, y, k)
	fmt.Printf("%v %v %v\n", max, min, cnt)
}

func minAsk(n, m int, k int64) int64 {
	if n <= 2 {
		return k / int64(n*m)
	}

	t := int64(2*n*m - 2*m)
	th := int64(n * m)
	d := k / t
	r := k % t

	if r < th {
		return d
	}
	return d + 1
}

func maxAsk(n, m int, k int64) int64 {
	if n <= 2 {
		d := k / int64(n*m)
		r := k % int64(n*m)
		if r > 0 {
			return d + 1
		}
		return d
	}

	t := int64(2*n*m - 2*m)
	th := int64(n * m)
	d := k / t
	r := k % t

	if r <= int64(m) {
		return d * 2
	} else if r <= th {
		return d*2 + 1
	}

	return d*2 + 2
}

func count(n, m, x, y int, k int64) int64 {
	if n <= 2 {
		d := k / int64(n*m)
		r := k % int64(n*m)
		if r >= int64((x-1)*m+y) {
			return d + 1
		}
		return d
	}

	t := int64(2*n*m - 2*m)
	th := int64(n * m)
	d := k / t
	r := k % t

	if x == 1 {
		if r >= int64(y) {
			return d + 1
		}
		return d
	} else if x == n {
		if r-int64((n-1)*m) >= int64(y) {
			return d + 1
		}
		return d
	} else {
		if r < int64((x-1)*m+y) {
			return d * 2
		} else if r >= int64((x-1)*m+y) && r < th+int64((n-x-1)*m+y) {
			return d*2 + 1
		}
	}

	return d*2 + 2
}


package main

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

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

	N := io.NextInt()
	M := io.NextInt()
	K := io.NextLong()
	X := io.NextInt()
	Y := io.NextInt()

	var desksPerPass int64
	if N == 1 {
		desksPerPass = int64(M)
	} else {
		desksPerPass = int64(M * (N + N - 2))
	}
	passes := K / desksPerPass

	G := MakeMatrix(N + 1, M + 1)
	for i := 1; i <= N; i++ {
		for j := 1; j <= M; j++ {
			switch i {
				case 1, M:
					G[i][j] = passes
				default:
					G[i][j] = 2 * passes
			}
		}
	}

	dr := 1
	r := 1
	c := 1
	for rem := K - (passes * desksPerPass); rem > 0; rem-- {
		G[r][c]++
		if c == M {
			if r == N {
				dr = -1
			}
			c = 1
			r += dr
		} else {
			c++
		}
	}

	min := int64(math.MaxInt64)
	max := int64(0)
	for i := 1; i <= N; i++ {
		for j := 1; j <= M; j++ {
			min = Min(min, G[i][j])
			max = Max(max, G[i][j])
		}
	}

	io.Printf("%d %d %d\n", max, min, G[X][Y])

	io.FlushOutput()
}

func MakeMatrix(rows, cols int) [][]int64 {
	mat := make([][]int64, rows)
	for i := range mat {
		mat[i] = make([]int64, cols)
	}
	return mat
}

func Min(lhs, rhs int64) int64 {
	if lhs < rhs {
		return lhs
	} else {
		return rhs
	}
}

func Max(lhs, rhs int64) int64 {
	if lhs > rhs {
		return lhs
	} else {
		return rhs
	}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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