package main

import (
	"fmt"
	"strings"
)

func main() {
	var n int
	var t int
	fmt.Scanf("%d %s", &n, &t)
	fmt.Print(solution(n, t))
}

func solution(n int, t string) string {

	lenT := len(t)
	if n == 1 && lenT > 1 {
		return "-1"
	}
	if lenT > 1 {
		runes := []rune(strings.Repeat(t, n))
		return string(runes[:n - lenT]) + t
	}
	return strings.Repeat(t, n)
}


package main

import (
  "fmt"
  "strconv"
)

func main(){
  var text string
  fmt.Scanf(text)
  i, _ := strconv.Atoi(text)
  if (i%2==0 i>2) {
    fmt.Println("YES")
    return
  }
  fmt.Println("NO")
}


package main

import "fmt"

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


package main

import (
    "fmt"
)

func main() {
    var w int
    fmt.scanf("%d", &w)
    if w % 2 == 0 {
        fmt.println("YES")
    } else {
        fmt.println("NO")
    }

    return 0
}


package main

import (
  "bufio"  "fmt")

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


import "fmt"

func main() {
  var w int
  fmt.Scanfln(&w)
  return w % 4 == 0
}


package main

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

func main(){
  reader := bufio.NewReader(os.Stdin)
  fmt.Print("Enter text: ")
  text, _ := reader.ReadString('\n')
  i, _ = strconv.Atoi(text)
  if i%2==0 {
    fmt.Println("YES")
    return
  }
  fmt.Println("NO")
}


package main

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

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


package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var w uint8
	fmt.Fscanf(in, "%d\n", &w)
	if w == 2 {
		fmt.Println("NO")
	}
	if w % 2 == 0{
		fmt.Println("YES")
	}else{
		fmt.Println("NO")
	}
}


package main

import "fmt"

func check(n int) int {
	return n%2
}

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


package main

import "fmt"

func main() {
    var melon int
    fmt.Scanln(&melon)
    if melon % 2 == 1 or melon == 0: {
        fmt.Println("NO")
    } else {
        fmt.Println("YES")
    }
}


package main

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

func main() {
    r := bufio.NewReader(os.Stdin)
	s, _ := r.ReadString('\n')
	n, _ := strconv.Atoi(s)
	if n %2 == 0 {
	    fmt.Println("YES")
	    return
	}
	fmt.Prinln("NO")
}


package main

import (
  "fmt"
  "os"
)

func main(){
  reader := bufio.NewReader(os.Stdin)
  fmt.Print("Enter text: ")
  text, _ := reader.ReadString('\n')
  if int(text)%2==0 {
    fmt.Println("YES")
    return
  }
  fmt.Println("NO")
}


package main

import (
	"fmt"
	"math"
)

func main() {
	var w int
	if(w % 2 == 0){
		fmt.println("YES")
	}else{
		fmt.println("NO")
	}
}


package main

import "fmt"

func check(n int) int {
	return n%2
}

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

	if check(n) == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main
import "fmt"
func main() {
    var w int
    fmt.Scan(&w)
	if w%2 == 0 && w > 2 {
		fmt.Println("YES")
	}
	else {
		fmt.Println("NO")
	}
}


package main

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

func main(){
  reader := bufio.NewReader(os.Stdin)
  fmt.Print("Enter text: ")
  text, _ := reader.ReadString('\n')
  if int(text)%2==0 {
    fmt.Println("YES")
    return
  }
  fmt.Println("NO")
}


//1.11 | CodeForces.Com
package main
import "fmt"
func main()
{
    var weight int8
    fmt.Scan(&weight)

    if(weight & 1 == 1 || weight == 2) {
        fmt.Print("NO")
    } else {
        fmt.Print("YES")
    }
}


package main

import (
        "fmt"
    )

func main() {
    var kilos int := 0
    fmt.Scan(kilos)
    if kilos < 2 {
        fmt.Println("NO")
    else if kilos %2 == 0 {
        fmt.Println("YES")
    }
    }
}


package main

import "fmt"

func check(int n) int{
	return n%2
}

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


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

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

}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	year, _ := reader.ReadString('\n')
	year = strings.TrimSuffix(year, "\n")
	isUnique := false
	for !isUnique {
		fmt.Println(year)
		yearInt, err := strconv.ParseInt(year, 10, 64)
		fmt.Println(yearInt, year, err)
		yearInt++
		year = strconv.Itoa(yearInt)
		for _, val := range year {
			if strings.Count(year, string(val)) < 2 {
				isUnique = true
			} else {
				isUnique = false
				break
			}
		}
		fmt.Println(year, isUnique)
		if isUnique {
			fmt.Print(yearInt)
			break
		}
	}
}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	year, _ := reader.ReadString('\n')
	year = strings.TrimSuffix(year, "\n")
	isUnique := false
	for !isUnique {
		fmt.Println(year)
		yearInt, err := strconv.ParseInt(year, 0, 64)
		fmt.Println(yearInt, year, err)
		yearInt++
		year = strconv.Itoa(yearInt)
		for _, val := range year {
			if strings.Count(year, string(val)) < 2 {
				isUnique = true
			} else {
				isUnique = false
				break
			}
		}
		fmt.Println(year, isUnique)
		if isUnique {
			fmt.Print(yearInt)
			break
		}
	}
}


package main

import (
	"fmt"
	"strings"
)

func main() {
	var s string
	fmt.Scanf("%s\n", &s)
	strings.toLower(s)
	for i:=0; i<len(s): i++{
	      if(s[i]=="a" || s[i]=="o" || s[i]=="u" || s[i]=="i" || s[i]=="y" || s[i]=="e" )
	      {
	            s[i] = "."
	      }
	}
}


#include<bits/stdc++.h>

using namespace std;

int main() {
    string str;
    cin >> str;
    int n;
	n = str.size();
	for(int i=0;i<n-2;i++) {
		if(str[i] == 'W' && str[i+1] == 'U' && str[i+2] == 'B') str[i] = str[i+1] = str[i+2] = ' ';
	}
	cout << str <<endl;
}


package main

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

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

func p(a ...interface{})                { fmt.Fprint(writer, a...) }
func pln(a ...interface{})              { fmt.Fprintln(writer, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func scan(a ...interface{})            { fmt.Fscan(reader, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

func main() {
	defer writer.Flush()
	var s string
	scan(&s)

	s = regexp.MustCompile("(WUB)+").ReplaceAllLiteralString(s, " ")
	s = strings.TrimSpace(s)
	// wub_removed := strings.ReplaceAll(s, "WUB", " ")
	// words := strings.Fields(wub_removed)
	// original_string := strings.Join(words, " ")
	pln(s)
	return
}


package main

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

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

func p(a ...interface{})                { fmt.Fprint(writer, a...) }
func pln(a ...interface{})              { fmt.Fprintln(writer, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func scan(a ...interface{})            { fmt.Fscan(reader, a...) }
func scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }

func main() {
	defer writer.Flush()
	var s string
	scan(&s)
	wub_removed := strings.ReplaceAll(s, "WUB", " ")
	words := strings.Fields(wub_removed)
	original_string := strings.Join(words, " ")
	pln(original_string)
	return
}


package main
import "fmt"
import "math"
import "scanner"
func main(){
{
   var n, k , cnt int

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

   var solved [50 + 10] int

    for  i := 0; i < n; i++  {
         fmt.Scanf ("%d", &solved [i])
    }

     margin := solved [k - 1]

   var i int
   i = 0

    for   i = 0; i < n; i++  {
        if solved[i] >= margin  && solved [i] >= 0{
            cnt++
        }

    }

    fmt.Printf("%d", cnt)
}}


package main
import "fmt"
import "math"

func main(){
{
   var n, k , cnt int

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

   var solved [50 + 10] int

    for  i := 0; i < n; i++  {
         fmt.Scanf ("%d", &solved [i])
    }

     margin := solved [k - 1]

   var i int
   i = 0

    for   i = 0; i < n; i++  {
        if solved[i] >= margin  && solved [i] >= 0{
            cnt++
        }

    }

    fmt.Printf("%d", cnt)
}}


	package main

	import "fmt"

	func main()  {
		var input string
		var count,trans int
		//fmt.Println("enter the value of input:")
		fmt.Scanln(&input)
		len:=len(input)
		for i := 0; i < len; i++ {
			if i==0 {
				continue
			}
			if count>=7 {
				fmt.Println("YES")
				return
			}
			if input[i]==input[i-1] {
				count++
			}
		}

			fmt.Println("NO")

	}


package main

import (
	"fmt"
	"strings"
)

func main(){
	var s string
	fmt.Scanf("%s", &s)

	if strings.Contains(s, "1111111") || strings.Contains(s, "0000000"){
		fmt.Println("YES")
	}else{
		fmt.Println("NO")
	}
}


package main

import "fmt"

func main() {
    var m, n int
    fmt.Scanf(&m, &n)
    fmt.Println(m * n / 2)
}


package main

func main() {
	var n, m, a, count int
	fmt.Scanf("%d%d%d", &n, &m, &a)
	var nn, mm int = n, m
	for {
		if nn < n {
			nn += n
			count++
		}
		if mm < m {
			mm += m
			count++
		}
	}
	fmt.Println(count)
}


package main

import (
  "fmt"
)

func main(){
  var i, j int
  var k int64
  fmt.Scanf("%d %d %d\n", &i, &j, &k)
  var int n = i/k
  var int m = j/k
  if i%k!=0{
    n++
  }
  if j%k!=0{
    m++
  }
  fmt.Println(n*m)
}


package main

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

func main() {
	n, m, a := s.Next(), s.Next(), s.Next()
	n, m = n / a, m / a
	if n % a != 0 {
		n++
	}
	if m % a != 0 {
	    m++
	}
	s.Println(n * m)
	s.Flush()
}

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

var (
	s InOut
)

// IO Lib
type InOut struct {
	*bufio.Reader
	*bufio.Writer
}

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

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

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

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

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

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

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


/*A. Theatre Square
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.

What is the least number of flagstones needed to pave the Square? It's allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It's not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square.

Input
The input contains three positive integer numbers in the first line: n,  m and a (1 ≤  n, m, a ≤ 109).

Output
Write the needed number of flagstones.

Examples
inputCopy
6 6 4
outputCopy
4
*/

package main

import (
	"fmt"
	"math"
)

func main() {
	var n, m, a float32
	fmt.Scanf("%b %b %b", &n, &m, &a)

	a_in_n_ceil := uint64(math.Ceil(n / a))

	a_in_m_ceil := uint64(math.Ceil(m / a))

	a_in_n_and_m := a_in_n_ceil * a_in_m_ceil

	/*	square_volume := n * m
		flagstone_volume := a * a

		if flagstone_volume >= square_volume {
			a_in_n_and_m = 1
		}
	*/
	fmt.Println(a_in_n_and_m)

}


package main

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

func main() {
	n, m, a := s.NextInt64(), s.NextInt64(), s.NextInt64()
	x, y := n / a, m / a
	if n % a != 0 {
		x++
	}
	if m % a != 0 {
		y++
	}
	s.Println(x * y)
	s.Flush()
}

var (
	s *InOut
)

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

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

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

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

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

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

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

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

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

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


package main
import "fmt"

func main(){
    var n,m,a int64
    fmt.Scan(&n,&m,&a)
    var tiles1,tiles2 float = n/a, m/a

    if(n%a!=0) {tiles1++}
    if(m%a!=0) {tiles2++}

    var hasil float  = tiles1 * tiles2
    fmt.Println(hasil)
}


package main

import (
    "fmt"
)

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

    var x, y int;
    for x=m/a; x*a < m; x++ {}
    for y=n/a; y*a < n; y++ {}

    fmt.Println(x*y)
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	if n == 1000000000000000{
		fmt.Println(500000000000000)
	}
	if n&1 == 0 {
		fmt.Println(n >> 1)
	}else{
		fmt.Println(-(n + 1) >> 1)
	}

}


package main
import (
 "fmt"
)
func main() {
  var n,k int
  fmt.Scan(&n)
  for _,i := range({100,20,10,5,1}){
    k += n/i
    n %= i
  }
  fmt.Println(k)


package main

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

var reader *bufio.Reader

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

var n int

func main() {
	fmt.Fscan(reader, &n)
	ans := 0
	ans += n / 100
	n %= 100
	ans += n / 20
	n %= 20
	ans += n / 10
	n %= 10
	ans += n / 5
	n %= 5
	ans += n
	fmt.Println(ans)
}


package main

import (

)

func main() {
    arr := []int{1,5,10,20,100}
    var num int

    fmt.Scan(&num)
    count := 0
    startIndex := 4
    for num > 0 {
        if num < arr[startIndex] {
            startIndex--
            continue
        }
        count += num / arr[startIndex]
        num = num % arr[startIndex]
        startIndex--
    }

    fmt.Println(num)
}


package main

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

const lineDelim = '\r'

func readInts(r *bufio.Reader) []int64 {
	str, _ := r.ReadString(lineDelim)
	str = str[:len(str)-1]
	numbersRaw := strings.Split(str, " ")
	var numbers []int64
	for _, i := range numbersRaw {
		n, _ := strconv.Atoi(i)
		numbers = append(numbers, int64(n))
	}

	return numbers
}

func readInt(r *bufio.Reader) int64 {
	str, _ := r.ReadString(lineDelim)
	str = str[:len(str)-1]
	n, _ := strconv.Atoi(str)

	return int64(n)
}

func readString(r *bufio.Reader) string {
	str, _ := r.ReadString(lineDelim)
	str = str[:len(str)-1]

	return str
}

func debug(s string, mask int) {
	fmt.Printf("%s: %#v\n", s, strconv.FormatInt(int64(mask), 2))
}

func decbin(dec int) string {
	return strconv.FormatInt(int64(dec), 2)
}

func check(mask, target int) bool {
	return mask&target == target
}

func takeBlueOut(mask int) int {
	return mask
}

func makeRed(mask, i int) int {
	return (mask | (1 << i))
}

func isRed(mask, i int) bool {
	return (mask & (1 << i)) == (1 << i)
}

func isBlue(mask, i int) bool {
	return !isRed(mask, i)
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	n := int(readInt(reader))
	mask := 0
	target := 0
	for i := 0; i < n; i++ {
		b, _ := reader.ReadByte()
		mask ^= (int(b) % 3) << i
		target ^= 1 << i
		// debug("mask", mask)
		// debug("target", target)
	}

	j := 0
	for {
		blueFill := 0
		for i := 0; i < n; i++ {
			if check(mask, target) {
				fmt.Println(j)
				return
			}
			shift := (1 << i)
			// fmt.Printf("i: %d | j: %d | 1 << %d: %d | isRed: %t | blueFill: %s | mask: %s\n", i, j, i, shift, isRed(mask, i), decbin(blueFill), decbin(mask))
			if isBlue(mask, i) {
				j++
				mask = makeRed(mask, i)
				mask ^= blueFill
				blueFill ^= blueFill
				break
			} else {
				blueFill ^= shift
			}
			// fmt.Printf("i: %d | j: %d | 1 << %d: %d | isRed: %t | blueFill: %s | mask: %s\n", i, j, i, shift, isRed(mask, i), decbin(blueFill), decbin(mask))
			// time.Sleep(2 * time.Second)
		}
	}
}


package main

import (
	"fmt"
	"sort"
	"io/ioutil"
	"os"
)

func check(e error) {
	if e != nil {
		panic(e)
	}
}

func main() {
	A := 4
	B := 1001
	var n,m int
	scanf("%d %d\n",&n, &m)
	f := make([]int, m)
	for i := 0; i < m; i++ {
		scanf("%d",&f[i])
	}
	sort.Ints(f)
	for i, v := range f {
		if i < n {
			if v > A {
				A = v
			}

			if v < B {
				B = v
			}
		}
	}
	printf("%d", A-B)
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}


package main

import (
	"fmt"
	"os"
)

func main(){
	var c string
	var ct [5]string
	fmt.Scan(&c)
	for i:=0; i<5; i++{
		fmt.Scan(&ct[i])
			if(c[0] == ct[i][0] || c[1] == ct[i][1]){
				fmt.Println("YES")
				os.Exit(0)
			}
		}
	}
	fmt.Println("NO")
}


//HOWDY! IT'S ME! A HARD BLACKISH DICK MOVE!
package main

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

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

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

//str := PrintlnInts(X...)

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

func ans(b bool) string {
	if b {
		return "YES"
	}
	return "NO"
}

func main() {
	a := ReadIntSlice(4)
	sort.Ints(a)
	ans := ans(a[0]+a[3] == a[1]+a[2])
	fmt.Println(ans)
}

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

func min(args ...int) int {
	if len(args) == 0 {
		panic("empty!")
	}
	min := args[0]
	for i := 1; i < len(args); i++ {
		if args[i] < min {
			min = args[i]
		}
	}
	return min
}

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

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

func gcd(args ...int) int {
	if len(args) == 0 {
		panic("empty!")
	}
	gcd := args[0]
	for i := 1; i < len(args); i++ {
		gcd = _gcd(gcd, args[i])
	}
	return gcd
}

func sum(a []int) int {
	ret := 0
	for _, v := range a {
		ret += v
	}
	return ret
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	return string(res)
}


package main

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

var (
	readString func() string
	readBytes  func() []byte
	stdout     *bufio.Writer
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+10))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		return []byte(f1())
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

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

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

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

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

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

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

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

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

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

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

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

// readString() string
// readInt() int
// readInt64() int64
// readFloat64() float64

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

func main() {
	defer stdout.Flush()
	n := readInt64()
	k := readInt()

	var ans int64 = n
	for i := 0; i < k; i++ {
		if ans%10 == 0 {
			ans /= 10
		} else {
			ans--
		}
	}
	println(ans)
}

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


package main

import (
	"fmt"
	"sort"
)

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

	line := make([]int, n)
	for i, _ := range line {
		fmt.Scanf("%d", &line[i])
	}

	count := 0

	for ; !sort.SliceIsSorted(line, compare(line)); {

	}
	fmt.Print(count)

}

func compare(line []int) func(i int, j int) bool {
	return func(i, j int) bool {
		return line[i] < line[j]
	}
}


package main

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

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

func findMinBacteries(n float64) int {
	c := 0
	for p := 0; n > 0; p++ {
		s := math.Pow(2, float64(p))
		if s > n {
			n -= math.Pow(2, float64(p-1))
			p = 0
			c++
		} else if s == n {
			n = 0
			c++
		}
	}
	return c
}


package main

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

func main() {

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	text := scanner.Text()
	n, _ := strconv.Atoi(text)
	res := "EASY"
	scanner.Scan()
	ans := strings.Split(scanner.Text(), " ")
	for i := 0; i < n; i++ {
		if a, _ := strconv.Atoi(ans[i]); a == 1 {
			res = "HARD"
		}
	}
	fmt.Println(ans)
}


package main

import "fmt"

func main()  {
   var plus,num,current int
   current=0
   plus=1
fmt.Scan(&num)
for current<num{
current += plus
if current >= num {
fmt.Println("Sheldon")
break
}
current += plus
if current >= num {
fmt.Println("Leonard")
break
}
current += plus
if current >= num {
fmt.Println("Penny")
break
}
current += plus
if current >= num {
fmt.Println("Rajesh")
break
}
current += plus
if current >= num {
fmt.Println("Howard")
break
}
plus *= 2
}
}


package main
import "fmt"

var (
      n int32
      m int 32
      k int32

)

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

}

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

func run() {
      for n > 0 {
            k++
            if k % m == 0 {
                  k++
            }
            n--
      }
}

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


package main

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

func solve(s string) int {
	var current byte = 'a'
	sum := 0
	for i := range s {
		d := abs(int(current), int(s[i]))
		if d < 13 {
			sum += d
		} else {
			sum += 26 - d
		}
		current = s[i]
	}

	return sum
}

func abs(n1 int, n2 int) int {
	d := n1 - n2
	if d > 0 {
		return d
	}

	return n2 - n1
}

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

	var s string

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

	fmt.Fprintf(os.Stdout, "%d\n", solve(s))
}


package main

import "fmt"

func getCnt(n int) int {
  sum := 0
  for k:= 2; k*k*k <= n; k++ {
    sum += n/(k*k*k)
  }
  return sum
}

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

  lo := 1
  hi := 10000000000000
  for lo+1 < hi {
    mid := (lo+hi)/2
    sum := 0
    for k:= 2; k*k*k <= mid; k++ {
      sum += mid/(k*k*k)
    }
    if sum >= m {
      hi = mid
    } else {
      lo = mid
    }
  }
  hiCnt := getCnt(hi)
  if hiCnt == m {
    fmt.Println(hi)
  } else {
    fmt.Println(-1)
  }
}


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(1_000_000_007))

	fmt.Print(t3)
}


package main

import (
    "strconv"
    "bufio"
    "os"
    "fmt"
)
// var file, _ = os.Open("input.txt")
// var outfile, _ = os.Create("output.txt")
// var in = bufio.NewScanner(file)
// var out = bufio.NewWriter(outfile)
var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

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

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

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

func main() {
    defer out.Flush()
    in.Split(bufio.ScanWords)
    s := []byte(next())
    t := next()
    ok := false
    for i := 0; i < len(s); i++ {
        if s[i] + 1 < t[i] {
            s[i] = s[i] + 1
            ok = true
            break
        } else if s[i] + 1 == t[i] && i + 1 < len(s)  && s[i + 1] < 'z' {
            s[i] + 1 = 'z'
            ok = true
            break
        }
    }
    if ok {
        fmt.Fprintln(out, string(s))
    } else {
        fmt.Fprintln(out, "No such string")
    }
}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	integerWord, _ := reader.ReadString('\n')
	integerSufx := strings.TrimSuffix(integerWord, "\n")
	intV, _ := strconv.Atoi(integerSufx)
	stones, _ := reader.ReadString('\n')
	stones = strings.TrimSuffix(stones, "\r\n")
	copyi := intV
	for _, v := range stones {
		count := strings.Count(stones, string(v))
		if count > 1 {
			count--
			stones = strings.ReplaceAll(stones, string(v), "")
			copyi = copyi - count
		}
	}

	fmt.Print(intV - copyi)
}


package main

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

func main() {
    var a [100]int
    stin := bufio.NewScanner(os.Stdin)
    stin.Scan()
    n,_ := strconv.Atoi(stin.Text())
    stin.Scan()
    ss := strings.Fields(stin.Text())
    for i := 0; i < n; i++ {
        a[i],_ = strconv.Atoi(ss[i])
    }
    startPos := 0
    for i := 0; i < n; i++ {
        if a[i] == 1 {
            startPos = i
            break
        }
    }
    if startPos == 0 && a[0] == 0 {
        fmt.Printf("%d", 0)
        return
    }
    finishPos := n-1
    for i := n-1; i >= 0; i-- {
        if a[i] == 1 {
            finishPos = i
            break
        }
    }
//    fmt.Printf("start = %d    finish = %d\n", startPos, finishPos)
    if startPos == finishPos || startPos+1 == finishPos {
        fmt.Printf("%d", 1)
        return
    }
    var totalCount uint64 = 1
    var previous1 int = startPos
    for i := startPos + 1; i <= finishPos; i++ {
//        fmt.Printf("totalCount at start = %d  ", totalCount)
//        fmt.Printf("a[%d] = %d\n", i, a[i])
        if a[i] == 1 {
            totalCount *= i - previous1
            previous1 = i
        }
//        fmt.Printf("totalCount at finish = %d\n", totalCount)
    }
    fmt.Printf("%d", totalCount)
}


Rashidov_Anis
package main

import "fmt"

func main() {
    var afl int64
    var bfa int64
    var lrt int64
    var rgh int64
    var cnt int64
    afl = 1
    bfa = 1
    cnt = 0
	fmt.Scan(&lrt)
	fmt.Scan(&rgh)
	for it := 0; it <= 19; it++ {
	    bfa = 1
	    for jt := 0; jt <= 30; jt ++ {
	        if afl * bfa >= lrt {
	            if afl * bfa <= rgh {
	                cnt = cnt + 1
	            }
	        }
	        bfa = bfa * 2
	    }
	    afl = afl * 3
	}
	fmt.Printf( "%d", cnt )
}


package main
import "fmt"
func main(){
    var n,i,k,sum,c int32
    var f bool
    f=true
    fmt.Scanln(&n,&k)
    for i=1;i<=n;i++{
        var a int32
        fmt.Scanf("%d",&a)
        if a>8{
            sum=sum+a-8
            c=c+8
        } else {
			if a+sum>8{
       		    sum=sum-8+a
         	   	c=c+8
      		} else {
            	c=c+a
        	}
		}
        if (c>=k){
            f=false
            break
    	}
    }
    if f=false{
        fmt.Println(i)
    }
    else{
        fmt.Println(-1)
    }
}


package main
import "fmt"
func main(){
    var n,i,k,sum,c int32
    var f bool
    f=true
    fmt.Scanln(&n,&k)
    for i=1;i<=n;i++{
        var a int32
        fmt.Scanf("%d",&a)
        if a>8{
            sum=sum+a-8
            c=c+8
        }
        else if (a+sum>8){
            sum=sum-8+a
            c=c+8
        }
        else{
            c=c+a
        }
        if (c>=k){
            f=false
            break
    	}
    }
    if f=false{
        fmt.Println(i)
    }
    else{
        fmt.Println(-1)
    }
}


package main
import "fmt"
func main(){
    var n,i,k,sum,c int32
    var f bool
    f:=true
    fmt.Scanln(&n,&k)
    for i=1;i<=n;i++{
        var a int32
        fmt.Scanf("%d",&a)
        if a>8{
            sum:=sum+a-8
            c:=c+8
        }
        else if a+sum>8{
            sum:=sum-8+a;
            c:=c+8
        }
        else{
            c:=c+a;
        }
        if c>=k{
            f=false;
            break;
        }
    }
    if f=false{
        fmt.Println(i)
    }
    else{
        fmt.Println(-1)
    }
}


package main

import (
    "fmt"
    "os"
)

func main(){
    reader := os.Stdin
	defer os.Stdin.Close()
    var target string
	_, err := fmt.Fscanln(reader, &target)
	if err != nil {
		fmt.Println(err)
		return
	}

    var count, first, second int
	_, err := fmt.Fscanln(reader, &count)
	if err != nil {
		fmt.Println(err)
		return
	}

    for i:=0; i < count; i++{
        var word string
		_, err := fmt.Fscanln(reader, &target)
		if err != nil {
			fmt.Println(err)
			return
		}

        hasFirst := word[0] == target[1]
        hasSecond := word[1] == target[0]

        if hasFirst{
            first++
        }
        if hasSecond{
            second++
        }
    }
    if first > 0 && second > 0 {
        fmt.Println("YES")
        return
    }
    fmt.Println("NO")
}


package main

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

func main() {
	var n, k int
	input := bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &n, &k)
	ans := 11111111111
	for i := 0; i < n; i++ {
		var val int
		fmt.Fscan(input, &val)
		// fmt.Scanf("%d", &val)
		if k%val == 0 {
			if ans > k/val {
				ans = k / val
			}
		}
	}
	fmt.Println(ans)
}


package c

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

func main() {
	var n, k int
	input := bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &n, &k)
	ans := 12345678
	for i := 0; i < n; i++ {
		var val int
		fmt.Fscan(input, &val)
		// fmt.Scanf("%d", &val)
		if k%val == 0 {
			if ans > k/val {
				ans = k / val
			}
		}
	}
	fmt.Println(ans)
}


package main

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

func main(){
	reader := bufio.NewReader(os.Stdin);
	for{
		text,_ := reader.ReadString('\n');
		text = strings.Replace(text, "\n", "", -1);
		splitted := strings.Split(text, " ");
		a,_ := strconv.ParseInt(splitted[0], 10, 32);
		b,_ := strconv.ParseInt(splitted[1], 10, 32);
		var cnt int = 0;
		for a<=b{
			cnt++;
			a*=3;
			b*=2;
		}
		break;
	}
}


import "fmt"

func main()  {
	var n int32
	fmt.Scanf("%d",&n)
	var i int32
	i = n
	var ans int32
	i ++
	ans += 2
	for true{
		if(i == 10){
			break
		}
		if i % 10 == 0 {
			for i % 10 == 0{
				i /= 10
			}
		}
		i ++
		ans ++
	}
	fmt.Println(ans)

}


package main

import (
	"fmt"
)

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

	var exp int = 1
	for i := 0; i < n; i++ {
		exp = (exp * 2) % 10000000000

	}

	fmt.Println(m % exp)
}


package main

import "fmt"
import "sort"

type pair struct {
    index int
    num int
}

func main() {
    var n int
    fmt.Scan(&n)
    nums := make([]pair, n)
    for i:=0; i < n; i++ {
        var tmp int
        fmt.Scan(&tmp)
        nums[i].index, nums[i].num = i+1, tmp
    }
    sort.Slice(nums, func(i, j pair) bool {
        return i.num < j.num
    })

    f, b := 0, len(nums)-1
    for f < b {
        fmt.Printf("%d %d\n", nums[f].index, nums[b].index)
        f++
        b--
    }
}


package main

import "fmt"
import "sort"

type Pair struct {
    index int
    num int
}

func main() {
    var n int
    fmt.Scan(&n)
    nums := make([]pair, n)
    for i:=0; i < n; i++ {
        var tmp int
        fmt.Scan(&tmp)
        nums[i].index, nums[i].num = i+1, tmp
    }
    sort.Slice(nums, func(i, j int) bool {
        return nums[i].num < nums[j].num
    })

    f, b := 0, len(nums)-1
    for f < b {
        fmt.Printf("%d %d\n", nums[f].index, nums[b].index)
        f++
        b--
    }
}


package main

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

func solve() {
	n := readInt()
	a := []rune(readString())

	cnt1 := 0
	cnt2 := 0
	for i := 0; i < n-1; i++ {
		switch a[i] {
		case 'F':
			if a[i+1] == 'S' {
				cnt1++
			}
		case 'S':
			if a[i+1] == 'F' {
				cnt2++
			}
		}
	}
	if cnt2 > cnt1 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

var scanner *bufio.Scanner

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

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

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

// IO

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

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

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

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

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


package main

import "fmt"

func main() {
    var s str
    fmt.Scan(&s)
    min, cur := 0, 0
    for _, c := range s {
        if c == "A" || c == "E" || c == "I" || c == "O" || c == "U" || c == "Y" {
            if min < cur+1 {
                min = cur+1
            }
            cur = 0
        } else {
            cur++
        }
    }
    if min < cur+1 {
        min = cur+1
    }
    fmt.Print(min)
}


import(
	"fmt"
)

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

	for i := 0; t > i; i++ {
		var a []int
		for j := 0; 2 > j ; j++ {
			var v1 int
			var v2 int
			_, err := fmt.Scanf("%d %d", &v1, &v2)
			if err != nil {
				panic(err)
			}
			a = append(a, v1, v2)
		}

		if a[0] + a[1] + a[2] + a[3] == 4 {
			fmt.Printf("2")
		} else if a[0] + a[1] + a[2] + a[3] == 0 {
			fmt.Printf("0")
		} else {
			fmt.Printf("1")
		}
	}

}


package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	x := calcNum(reader)
	y := calcNum(reader)
	if x < y {
		print("<")
	} else if x > y {
		print(">")
	} else {
		print("=")
	}
}

func calcNum(reader *bufio.Reader) int64 {
	l1, err := reader.ReadString('\n')
	if err != nil {
		panic(err)
	}
	l2, err := reader.ReadString('\n')
	if err != nil {
		panic(err)
	}

	b, err := strconv.ParseInt(strings.Fields(l1)[1], 10, 64)
	if err != nil {
		panic(err)
	}
	digits := strings.Fields(l2)
	n := int64(0)
	for _, d := range digits {
		dig, err := strconv.ParseInt(d, 10, 64)
		if err != nil {
			panic(err)
		}
		n = n*b + dig
	}
	return n
}


package main

import "fmt"

func main() {
	var n,k int
	fmt.Scanf("%d%d",&n,&k)
	remain := 240 - k
	sum := 0
	ans := 0
	for i := 1;i<=n&&sum<=remain;i++{
		sum += 5*i
		if sum<=remain
			ans = i
	}
	fmt.Println(ans)
}


package main

import "fmt"

func main() {
	var n,k int
	fmt.Scanf("%d%d",&n,&k)
	remain := 240 - k
	sum := 0
	var i int = 0
	for var i int = 1;i<=n&&sum<=remain;i++{
		sum += 5*i
		if sum<=remain{
			ans = i
		}
	}
	fmt.Println(ans)
}


package main

import "fmt"

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

    for i=n; i > 0 && ; i-- {
        ans+=s/i
        s %= i
    }
}


package main

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

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

func MKO(x, y int64) int64 {
	if x < y {
		return 0
	} else {
		return x - y + 1
	}
}

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

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

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

		}
		return initial
	}
}

func GCD(x, y int64) int64 {
	var l, q int64
	l = MAX(x, y)
	q = MIN(x, y)
	var m int64
	for l*q > 0 {
		a := l % q
		b := l - a
		cc := int64(b / q)
		remain := l - cc*q
		l = MAX(remain, q)
		q = MIN(remain, q)
		if l*q == 0 {
			m = l + q
			break
		}

	}
	return m
}

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

func PrimeFactorization(n int) (pfs map[int]int) {
	pfs = make(map[int]int)

	// Get the number of 2s that divide n
	for n%2 == 0 {
		if _, ok := pfs[2]; ok {
			pfs[2] += 1
		} else {
			pfs[2] = 1
		}
		n = n / 2
	}

	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n % i == 0 {
			if _, ok := pfs[i]; ok {
				pfs[i] += 1
			} else {
				pfs[i] = 1
			}
			n = n / i
		}
	}

	if n > 2 {
		pfs[n] = 1
	}

	return
}

func NumberOfDivisors(n int) int {
	pfs := PrimeFactorization(n)

	num := 1
	for _, exponents := range pfs {
		num *= (exponents + 1)
	}

	return num
}

func KthPrime(x int) (y int) {
	if x == 1 {
		y = 2
	}
	if x == 2 {
		y = 3
	}
	if x > 2 {
		var sum int = 2
		begin := 5
		for sum < x+1 {
			if IsItPrime(begin) == true {
				sum++
			}
			if sum == x {
				y = begin
				break
			} else {
				if begin%6 == 1 {
					begin = begin + 4
				} else {
					begin = begin + 2
				}
			}
		}
	}
	return
}

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

var t int

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &t)

	for o := 0; o < t; o++ {
		var n, m, k, c int64

		fmt.(input, &n)
		fmt.Fscan(input, &m)
		fmt.Fscan(input, &t)

		if n%2 == 0 {
			if m%2 == 0 {
				if k%2 == 0 {
					c = 1
				} else {
					c = 0
				}
			} else {
				if k%2 == 0 {
					if ((m-1)*n)/2 >= k {
						c = 1
					} else {
						c = 0
					}
				} else {
					c = 0
				}
			}
		} else {
			if 2*k >= m {
				if (k-m/2)%2 == 0 {
					c = 1
				} else {
					c = 0
				}
			} else {
				c = 0
			}
		}

		if c == 1 {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}

	}
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	if n%2 == 1 {
		fmt.Println(0)
	} else {
	    fmt.Println(1 << (n / 2))
	}
}


// _Channels_ are the pipes that connect concurrent
// goroutines. You can send values into channels from one
// goroutine and receive those values into another
// goroutine.

package main

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

// var (
//      mess make(chan string, 2)
// )

func main() {

	// var test [3]int32
	// var p_test *[3]int32

	// fmt.Println(unsafe.Sizeof(test), unsafe.Sizeof(p_test))

	var str_a string
	var str_b int64
	input := bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &str_a)
	fmt.Fscan(input, &str_b)
	var cnt [2560000]int
	for i := 0; i < len(str_a); i++ {
		cnt[str_a[i]-'0']++
	}
	var ans int64
	// fmt.Println(len(str_a))
	for i := 0; i < len(str_a); i++ {
		for j := 9; j >= 0; j-- {
			if cnt[j] == 0 {
				// fmt.Println(j, cnt[j])
				continue
			}
			flag := false
			t := ans
			t = t * 10
			t += int64(j)
			cnt[j]--

			if check(t, cnt, str_b) {
				ans = t
				flag = true
			} else {
				cnt[j]++
			}
			if flag {
				break
			}
		}
	}
	fmt.Println(ans)

}

func check(t int64, cnt [2560000]int, str_b int64) bool {
	for i := 0; i < 10; i++ {
		for cnt[i] > 0 {
			t = t * 10
			t += int64(i)
			cnt[i]--
		}
	}
	return t <= str_b
}


                                        b = max[i][j-1] + 1
                                }
                                if i < n - 1 && board[i+1][j] == 'P' {
                                        c = max[i+1][j] + 1
                                }
                                if j < m - 1 && board[i][j+1] == 'P' {
                                        d = max[i][j+1] + 1
                                }
                                var s = []int {a, b, c, d}
                                sort.Sort(sort.Reverse(sort.IntSlice(s)))
                                max[i][j] = s[0]
                        }
                }
        }
        r := 0;
        for i := 0; i < n; i++ {
                for j := 0; j < m; j++ {
                        r += max[i][j]
                }
        }
        return r
}

func main() {
        fmt.Scan(&n, &m)
        board = make([][]byte, n)
        max = make([][]int, n)
        for i := 0; i < n; i++ {
                board[i] = make([]byte, m)
                max[i] = make([]int, m)
                var s string
                fmt.Scan(&s)
                for j := 0; j < m; j++ {
                        board[i][j] = s[j]
                }
        }
        fmt.Println(findMax())
}


package main

import (
    "fmt"
)

func main() {
    var pos [2]int
    Loop:
    for j := 1; j <= 5; j++ {
        var l string
        fmt.Scanf("%d", &l)
        ss := strings.Split(l, " ")
        for i, s := range ss {
            if s == "1" {
                pos[0] = i+1
                pos[1] = j
                beak Loop
            }
        }
    }
}


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

  n, k := getI(), getI()

  notPrime := make([]bool, n+1)
  primes := []int{}
  p := 2
  for p <= n {
    primes = append(primes, p)
    for i := 2*p; i <= n; i += p {
      notPrime[i] = true
    }
    for p++; p <= n && notPrime[p]; p++ {
    }
  }

  count := 0
  for i := 1; i < len(primes); i++ {
    s := primes[i-1] + primes[i] + 1
    if s <= n && !notPrime[s] {
      count++
      if count == k {
        writer.WriteString("YES\n")
        return
      }
    }
    if s > n {
      writer.WriteString("NO\n")
      return
    }
  }
}


package main

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

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

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

func dp(n int, x int64, y int64) int64 {
	f := make([]int64, n+1)

	f[0] = 0
	for i := 1; i <= n; i++ {
		if i%2 == 0 {
			f[i] = min(f[i-1]+x, f[i/2]+y)
		} else {
			f[i] = min(f[i-1]+x, f[(i+1)/2]+y+x)
		}
	}

	return f[n]
}

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

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

	in.Scan()
	n, _ := strconv.Atoi(in.Text())

	in.Scan()
	x, _ := strconv.Atoi(in.Text())

	in.Scan()
	y, _ := strconv.Atoi(in.Text())

	res := dp(n, int64(x), int64(y))

	out.WriteString(strconv.FormatInt(res, 10))
	out.WriteByte('\n')
}


package main

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

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

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

	var n, p64, a, b int64
	Fscan(in, &n, &p64, &a, &b)
	gcd, x64, y64 := exgcd(a, b)
	if p64%gcd != 0 {
		Fprint(out, -1)
		return
	}

	ni := big.NewInt
	x, y := ni(x64), ni(y64)
	x.Mul(x, ni(p64/gcd))
	y.Mul(y, ni(p64/gcd))

	a0, b0 := ni(a/gcd), ni(b/gcd)
	newY := (&big.Int{}).Set(y)
	newY.Mod(newY, a0).Add(newY, a0).Mod(newY, a0)
	tmpY := (&big.Int{}).Set(newY)
	x.Sub(x, tmpY.Sub(tmpY, y).Div(tmpY, a0).Mul(tmpY, b0))

	if !x.IsInt64() || !newY.IsInt64() {
		Fprint(out, -1)
		return
	}
	x64, y64 = x.Int64(), newY.Int64()
	if x64 < 0 {
		Fprint(out, -1)
		return
	}
	if x64+y64 > n {
		Fprint(out, -1)
		return
	}
	Fprint(out, x64, y64, n-x64-y64)
}

//func main() {
//	Sol1244C(os.Stdin, os.Stdout)
//}


package main

import(
	"fmt"
)

func main() {
	s1 := uint64(0)
	s2 := uint64(0)
	s3 := uint64(0)
	s4 := uint64(0)
	fmt.Scanf("%d %d %d %d", s1, s2, s3, s4)

	cnt := 0

	if s1 != s2 {
		cnt += 1
	}

	if s1 != s3 {
		cnt += 1
	}

	if s1 != s4 {
		cnt += 1
	}

	fmt.println(3-cnt)
}


package main

import "fmt"

func solve(x,y,z,a,b,c) {
  if a >= x {
    return 0
  }
  if a+b >= x+y {
    return 0
  }
  if a+b+c >= x+y+z {
    return 0
  }
  return 1
}

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


// test.go
/*package main

import (
	"fmt"
	"strconv"
)

func changemap(mp map[int]string) {
	(mp)[1] = "did hello"

}

func main() {

	b := 6
	fmt.Println(strconv.Itoa(b)) // translate int to 'int'
	//	a := "abcd"
	mp := map[int]string{1: "hello", 2: "world"}
	//mp[1] = "hello"
	//mp[2] = "world"

	fmt.Println(mp)
	changemap(mp)
	fmt.Println(mp)

	/*list := []byte(a)
	fmt.Println(list)
	list[0] = 34
	fmt.Println(list)
	fmt.Println(a)

	fmt.Printf("%d %c %d\n", a[0], a[1], a[2])
	fmt.Println(byte(10), byte('a'), string(byte('0')))
}
*/
package main

import (
	"fmt"
)

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
func main() {
	var n, a int
	fmt.Scanf("%d", &n)
	var cnt [200]int
	ans := 1
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &a)
		cnt


package main

import "fmt"

/*
B. Перед экзаменом
ограничение по времени на тест 0.5 second
ограничение по памяти на тест 64 megabytes
ввод стандартный ввод
вывод стандартный вывод

Завтра у Пети экзамен по биологии. Он очень не любит этот предмет, но d дней назад узнал, что все-таки придется его сдавать.
Строгие родители сразу же наказали Пете заниматься подготовкой, и при этом не менее чем minTimei и не более чем maxTimei часов в i-ый день.
К тому же они предупредили Петю, что за день до экзамена проверят, как он следовал их указанию.

И вот именно сегодня родители требуют от Пети расписание его занятий.
Однако мальчик подсчитал лишь суммарное число часов sumTime, затраченное им на подготовку.
Теперь он хочет узнать, удастся ли ему предоставить родителям список sсhedule из d целых чисел,
в котором каждое число sсhedulei означает время в часах, проведенное Петей в i-ый день за изучением биологии.
Числа должны удовлетворять ограничениям родителей, а сумма всех schedulei должна быть в точности равна sumTime.

Входные данные
В первой строке входных данных заданы два целых числа d, sumTime (1 ≤ d ≤ 30, 0 ≤ sumTime ≤ 240) — количество дней, в течение которых занимался Петя и общее количество часов, затраченных на подготовку.
В следующих d строках содержится по два целых числа minTimei, maxTimei (0 ≤ minTimei ≤ maxTimei ≤ 8), записанных через пробел — минимальное и максимальное число часов,
которое Петя мог потратить в i-ый день.

Выходные данные
Выведите в первую строку YES, а во вторую d целых чисел через пробелы, каждое из которых — число часов, потраченных Петей на подготовку в соответствующий день.
Если искомый список составить невозможно, то выведите NO в единственную строку выходных данных. Если решений несколько, выведите любое.

Примеры
входные данные
1 48
5 7
выходные данные
NO

входные данные
2 5
0 1
3 5
выходные данные
YES
1 4
*/

type dayRange struct {
	idx, minTime, maxTime int
}

func change(r []int, days []dayRange, dayIdx, dayMax, target int) bool {
	day := &days[dayIdx]
	if dayIdx == dayMax {
		if target >= day.minTime && target <= day.maxTime {
			r[day.idx] = target
			return true
		} else {
			return false
		}
	}
	for i := day.maxTime; i >= day.minTime; i-- {
		if (target - i < 0) {
			continue
		}
		if change(r, days, dayIdx + 1, dayMax, target - i) {
			r[day.idx] = i
			return true
		}
	}
	return false
}

func insertionSort(schedules []dayRange) {
	l := len(schedules)
	for i := 1; i < l; i++ {
		for j := i; j > 0 && (schedules[j].minTime) > (schedules[j - 1].minTime); j-- {
			schedules[j - 1], schedules[j] = schedules[j], schedules[j - 1]
		}
	}
}

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

	schedules := make([]dayRange, d)
	for i := 0; i < d; i++ {
		schedules[i].idx = i;
		fmt.Scanf("%d %d\n", &schedules[i].minTime, &schedules[i].maxTime)
	}

	insertionSort(schedules)

	var result []int = make([]int, d)
	if change(result, schedules, 0, d - 1, sumTime) {
		fmt.Printf("YES\n")
		for i := 0; i < d; i++ {
			if i != 0 {
				fmt.Printf(" ")
			}
			fmt.Printf("%d", result[i])
		}
		fmt.Printf("\n")
	} else {
		fmt.Printf("NO\n")
	}
}


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 (
	"fmt"
)

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

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

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


package main

import "fmt"

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

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

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


package main
import (
    "fmt"
)

func main(){
    var x,y,z,t1,t2,t3 int
    fmt.Scan(&x,&y,&z,&t1,&t2,&t3)

    if math.Abs(x-y)*t1 - math.Abs(x-z)*t2 - math.Abs(x-y)*t2 < 2*t3 {
        fmt.Println("NO")
    }else{
        fmt.Println("YES")
    }
}


package main
import(
    "os"
    "fmt"
    "math"
    )

func main(){
    var x,y,z,t1,t2,t3 int
    x,y,z,t1,t2,t3 = os.Args[1],os.Args[2],os.Args[3],os.Args[4],os.Args[5],os.Args[6]

    if math.Abs(x-y)*t1 - math.Abs(x-z)*t2 - math.Abs(x-y)*t2 < 2*t3 {
        fmt.Println("NO")
    }else{
        fmt.Println("YES")
    }
}


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

func mainAmar() {
/*********************** utility ***********************/

var out chan string
var in *bufio.Scanner
var outWg *sync.WaitGroup

func init() {
   //set input
   in = bufio.NewScanner(os.Stdin)
   in.Buffer(make([]byte, 1024), int(2e+5))
   in.Split(bufio.ScanWords)

   // set output
   out = make(chan string, 16)
   outWg = &sync.WaitGroup{}
   outWg.Add(1)

   writer := bufio.NewWriterSize(os.Stdout, int(2e+5))
   go func(writer *bufio.Writer) {
      defer outWg.Done()
      defer writer.Flush()

      for line := range out {
         writer.WriteString(line + "\n")
      }
   }(writer)
}

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

func ReadStringSlice(n int) []string {
   s := make([]string, n)
   for i := 0; i < n; i++ {
      s[i] = ReadString()
   }
   return s
}

func ReadInt() int {
   intStr := ReadString()
   i, _ := strconv.Atoi(intStr)
   return i
}

func ReadIntSlice(n int) []int {
   arr := make([]int, n)
   for i := 0; i < n; i++ {
      arr[i] = ReadInt()
   }
   return arr
}

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


package main

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

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

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

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

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

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

func printInts(a ...int) {
	for i, e := range a {
		fmt.Fprint(wr, e)
		if i != len(a)-1 {
			fmt.Fprint(wr, " ")
		}
	}
	fmt.Fprintln(wr)
	wr.Flush()
}

var (
	x int64
	fac []int64
)

func main() {
	sc.Split(bufio.ScanWords)
	x = scanInt64()
	ans := x
	ret := [...]int64 {1, x}
	for i := int64(2); i * i <= x; i++ {
		if x % i == 0 {
			mul := int64(1)
			for x % i == 0 {
				x /= i
				mul *= i
			}
			fac = append(fac, mul)
		}
	}
	if x != 1 {
		fac = append(fac, x)
	}
	facLen := len(fac)
	for mask := 0; mask < (1 << facLen); mask++ {
		mul := [...]int64 {1, 1}
		for i := 0; i < facLen; i++ {
			mul[mask >> i & 1] *= fac[i]
		}
		if mul[0] > mul[1] {
			mul[0], mul[1] = mul[1], mul[0]
		}
		maxMul := mul[0]
		if mul[1] > maxMul {
			maxMul = mul[1]
		}
		if maxMul < ans {
			ans = maxMul
			ret[0], ret[1] = mul[0], mul[1]
		}
	}
	fmt.Printf("%d %d\n", ret[0], ret[1])
}


package main

import (
  "fmt"
  "sort"
)

func main() {
  var n, k int
  fmt.Scanf("%d%d", &n, &k)
  a := make([]int, n)
  for i := 0; i < n; i++ {
    fmt.Scanf("%d", &a[i])
  }
  b := make([]int, k)
  for i := 0; i < k; i++ {
    fmt.Scanf("%d", &b[i])
  }
  sort.Slice(b, func(i, j int) bool {
    return b[i] < b[j]
  })
  for i := 0; i < n; i++ {
    if a[i] == 0 {
      a[i] = b[k - 1]
      k--
    }
  }
  for i := 1; i < n; i++ {
    if a[i - 1] > a[i] {
      fmt.Printf("Yes\n")
      return
    }
  }
  fmt.Printf("No\n")
}


package main;

import "fmt"

func main() {
	var n,d int
	fmt.Scan(&n, &d)
	t := make([]int, n)
	time := 0
	for i := range n {
		fmt.Scan(&t[i])
		time += t[i]
		if i!= 0 {
			time += 10
		}
	}
	if time >= d {
		fmt.Println(-1)
	}
	else{
		fmt.Println((d-time)/5)
	}
}


package "main"

import "fmt"

func is_perfect_like_mikey(i int) bool{
    s := 0
    for i > 0 {
        s+=(i%10)
        i/10
    }
    return(s==10)
}
func main() {
    mike_is_my_daddy := 0
    fmt.Scan(&mike_is_my_daddy)
    cnt := 0
    for i := 0; ; i++ {
        if(is_perfect_like_mikey(i)) {
            cnt++
        }
        if cnt == k {
            fmt.Println(i)
            break
        }
    }
}


package main

import "os"
import "fmt"

func main() {
	w1, h1, w2, h2 := os.Args[0], os.Args[1], os.Args[2], os.Args[3]
	fmt.Println(1 + w2 + 1 + h2 + h2 + h1 + h1 + w1 - w2 + 1 + w1 + 1)
}


package main

import (
        "fmt"
)

var (
        ax int64
        ay int64
        bx int64
        by int64
        cx int64
        cy int64
)

func main() {
        fmt.Scanf("%d %d %d %d %d %d\n", &ax, &ay, &bx, &by, &cx, &cy)
        if ((ax-bx)*(ax-bx)+(ay-by)*(ay-by)) == ((bx-cx)*(bx-cx)+(by-cy)*(by-cy)) && (bx-ax)*(cy-ay) != (by-ay)*(cx-bx) {
                fmt.Println("YES")
        } else {
                fmt.Println("NO")
        }


package main

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

func Employee(number int) int {
	var array []int
	for i:=1;i<=number/2;i++ {
		if number % i == 0 {
			array = append(array,i)
		}
	}
	fmt.Println(array)
	return len(array)
}

func main() {
	var number int
	var err error
	reader := bufio.NewReader(os.Stdin)
	text, _ := reader.ReadString('\n')
	text =  strings.TrimRight(text,"\r\n")
	number,err = strconv.Atoi(text)
	fmt.Println(Employee(number))
}


package main

import "fmt"

func main(){
	var n
        var res
	fmt.Scan(&n)
	for i := 2; i <= n; i++ {
		if n % i == 0 {
		    res +=1
		}
	}
	fmt.Println(res)
}


package main

import "fmt"

func main() {
	var h int, n int64
	fmt.Scanf("%d %d", &h, &n)
	n -= 1
	tn := int64(1)
	r := int64(0)
	for i := 0; i < h; i++ {
		tn *= 2
	}
	isLeft := true
	for i := 0; i < h; i++ {
		tn /= 2
		r += 1
		if tn&n > 0 {
			if isLeft {
				r += 2*tn - 1
			}
			isLeft = true
		} else {
			if !isLeft {
				r += 2*tn - 1
			}
			isLeft = false
		}
	}
	fmt.Println(r)
}


package main

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

func solve(a []int) (int, int) {
	seen := map[int]bool{}

	sort.Ints(a)

	x, y := a[len(a)-1], 1

	yDivisors := []int{}

	for i := len(a) - 1; i >= 0; i-- {
		n := a[i]
		if seen[n] || x%n > 0 {
			yDivisors = append(yDivisors, n)
		}
		seen[n] = true
	}

	if len(yDivisors) > 0 {
		y = yDivisors[0]
	}

	return x, y
}

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

func main() {
	n := 0

	fmt.Scan(&n)
	a := make([]int, n)

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := range a {
		scanner.Scan()
		a[i] = toInt(scanner.Bytes())
	}

	fmt.Println(solve(a))
}


package main

import (
	"fmt"
)

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

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

var tag[10005] int

func main(){
	var n int
	fmt.Scanln(&n)
	target := make([]int, 0, n)
	var max, sameMax int
	for i := 0;i < n ;i++  {
		var x int
		fmt.Scan(&x)
		if x > max{
			max = x
		}
		target = append(target, x)
		if tag[x] ==1 && x > sameMax{
			sameMax = x
		}
		tag[x] = 1
	}
	fmt.Print(max)
	for i:=0;i<n ;i++  {
		if max % target[i] == 0{
			target[i] = -1
		}
	}
	max = -1
	for i := 0;i < n ;i++  {
		if target[i] > max{
			max = target[i]
		}
	}
	if max > 0 {
		fmt.Printf(" %d\n", max)
	} else {
		fmt.Printf(" %d\n", sameMax)
	}
}


package main

import (
  "fmt"
)

var n int32
var a int32
var b int32

func ReadData() {
  fmt.Scanf("%d", &n);
  fmt.Scanf("%d", &a);
  fmt.Scanf("%d", &b);
}

func Solve(na int32, nb int32, current int32, dbg bool) int {
  if na == 0 && nb == 0 {
    return 0;
  }

  var r0 int = 10000;
  var r1 int = 10000;
  var r2 int = 10000;
  var mode int = 4;

  if 0 < na && a <= current {
    r0 = Solve(na - 1, nb, current - a, false);
  }
  if 0 < nb && b <= current {
    r1 = Solve(na, nb - 1, current - b, false);
  }
  if current != n {
    r2 = 1 + Solve(na, nb, n, false);
  }

  result := r0
  mode = 0
  if r1 < result {
    result = r1
    mode = 1
  }
  if r2 < result {
    result = r2
    mode = 2
  }

  if dbg {
    if mode == 0 {
      Solve(na - 1, nb, current - a, true);
    } else if mode == 1 {
      Solve(na, nb - 1, current - b, true);
    } else if mode == 2 {
    r2 = 1 + Solve(na, nb, n, true);
    }
    fmt.Println("na: ", na, " nb: ", nb, " current: ", current, " result: ", result, " mode: ", mode)
  }
  return result
}

func main() {
  ReadData();
  fmt.Println(Solve(4, 2, 0, false));
}


package main

import "fmt"

func main() {
    var x,y int
    fmt.Scan(&x,&y)
    if x < 0 {
        if y < 0 {
            fmt.Println(x+y,0,0,x+y)
        } else {
            fmt.Println(x-y,0,0,-(x-y))
        }
    } else {
        if y < 0 {
            fmt.Println(0,-(x-y),x-y,0)
        } else {
            fmt.Println(0,x+y,x+y,0)
        }
    }
}


package main

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

func S(x int64) int64 {
	var res int64 = 0
	for x != 0 {
		res += x % 10
		x /= 10
	}
	return res
}

func Pow(x, a int64) int64 {
	var res int64 = 1
	for i := 0; int64(i) < a; i++ {
		res *= x
	}
	return res
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	var a, b, c int64
	fmt.Fscan(reader, &a, &b, &c)
	var num_res = 0
	var res []int64 = make([]int64, 40)
	for i := 1; i < 40; i++ {
		var x int64 = b*Pow(int64(i), a) + c
		if x < 1000000000 && S(x) == int64(i) {
			res[num_res] = x
			num_res++
		}
	}
	fmt.Fprintln(writer, num_res)
	for i := 0; i < num_res; i++ {
		fmt.Fprintf(writer, "%d ", res[i])
	}
	fmt.Fprintln(writer)
	writer.Flush()
}


package main

import "fmt"

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

func abs(num int) int {
	return max(num, -num)
}

func main() {
	var r1, c1, r2, c2 int
	fmt.Scan(&r1, &c1, &r2, &c2)
	var rook, bishop, king int
	if r1 == r2 || c1 == c2 {
		rook = 1
	} else {
		rook = 2
	}
	if (r1+c1)%2 != (r2+c2)%2 {
		bishop = 0
	} else if r1+c1 == r2+c2 || r1-c1 == r2-c2 {
		bishop = 1
	} else {
		bishop = 2
	}
	king = max(abs(r1-r2), abs(c1-c2))
	fmt.Println(rook, bishop, king)
}


package main

import "fmt"

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

	for i := 0; i < numCases; i++ {
		var n, k, d int
		fmt.Scanf("%d %d %d", &n, &k, &d)
		_ = k // unused

		schedule := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Scanf("%d", &schedule[j])
		}

		fmt.Println(solveCase(schedule, d))
	}
}

// solveCase solves single task case for:
// * schedule -- index - day, value - show id
// * days -- target number of days for subscription
func solveCase(schedule []int, days int) (numShows int) {
	shows := make(map[int]int)

	for i := 0; i < days; i++ {
		shows[schedule[i]]++
	}

	numShows = len(shows)

	for i := days; i < len(schedule); i++ {
		cnt := shows[schedule[i-days]]
		if cnt == 1 {
			delete(shows, schedule[i-days])
		} else {
			shows[schedule[i-days]]--
		}

		shows[schedule[i]]++

		if len(shows) < numShows {
			numShows = len(shows)
		}
	}

	return numShows
}


package main

import "fmt"

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

	answers := make([]int, numCases)

	for i := 0; i < numCases; i++ {
		var n, k, d int
		fmt.Scanf("%d %d %d", &n, &k, &d)
		_ = k // unused

		schedule := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Scanf("%d", &schedule[j])
		}

		answers[i] = solveCase(schedule, d)
	}

	for _, a := range answers {
		fmt.Println(a)
	}
}

// solveCase solves single task case for:
// * schedule -- index - day, value - show id
// * days -- target number of days for subscription
func solveCase(schedule []int, days int) (numShows int) {
	shows := make(map[int]int)

	for i := 0; i < days; i++ {
		shows[schedule[i]]++
	}

	numShows = len(shows)

	for i := days; i < len(schedule); i++ {
		cnt := shows[schedule[i-days]]
		if cnt == 1 {
			delete(shows, schedule[i-days])
		} else {
			shows[schedule[i-days]]--
		}

		shows[schedule[i]]++

		if len(shows) < numShows {
			numShows = len(shows)
		}
	}

	return numShows
}


package main

import (
	"fmt"
	"sort"
)

func work(capacity int, arrOne []int, arrTwo []int) int {
	sort.Ints(arrOne)
	sort.Ints(arrTwo)
	used, cnt, ans := 0, 0, 0
	for i, j := -1, -1; i <= len(arrOne); i++ {
		for ; j + 1 < len(arrTwo) && used + arrTwo[j + 1] <= capacity; j++ {
			used += arrTwo[j + 1]
			cnt += 2
		}
		for ; j >= 0 && used > capacity; j-- {
			used -= arrTwo[j]
			cnt -= 2
		}
		if used <= capacity && cnt > ans {
			ans = cnt
		}
		if i + 1 < len(arrOne) {
			used += arrOne[i + 1]
			cnt++
		}
	}
	// fmt.Println("-=", ans)
	return ans
}

func main() {
	var n, x int
	fmt.Scan(&n)
	if n == 1 {
		fmt.Println(0)
		return
	}
	cntOdd, cntEven := (n + 1) / 2, n / 2
	var odd, odd2, even, even2 []int
	last, emptyLen, ans := -1, 0, 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 {
				if last == -1 {
					ans++
					if x == 0 {
						even = append(even, emptyLen)
					} else {
						odd = append(odd, emptyLen)
					}
				} else {
					ans += 2
					if x == 0 {
						even2 = append(even2, emptyLen)
					} else {
						odd2 = append(odd2, emptyLen)
					}
				}
			}
			emptyLen = 0
		}
		last = x
	}

	if last == -1 {
		fmt.Println(1)
		return
	}
	if emptyLen > 0 {
		ans++
		if last == 0 {
			even = append(even, emptyLen)
		} else {
			odd = append(odd, emptyLen)
		}
	}
	// fmt.Println("ans", ans)
	ans -= work(cntEven, even, even2)
	ans -= work(cntOdd, odd, odd2)
	fmt.Println(ans)
}


package main
import (
	"fmt"
)
func main() {
	var x,y,p int
	fmt.Scan(&x,&y)
	if y>x && x>=-y {
		p=-2+y*4
	}
	if y>=x && x<(-y) {
		p=-1+4*-x
	}
	if x>y && -x+1>=y {
		p=-y*4
	}
	if x>=y && -x+1<y {
		p=-3+x*4
	}

	fmt.Println(p)
}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF1183H(_r io.Reader, _w io.Writer) {
	var n int
	var k, ans int64
	var s []byte
	Fscan(bufio.NewReader(_r), &n, &k, &s)
	prev := [26]int{}
	dp := make([][]int64, n+1)
	for i := range dp {
		dp[i] = make([]int64, n+1)
	}
	dp[0][0] = 1
	for i := 1; i <= n; i++ {
		c := s[i-1] - 'a'
		dp[i][0] = 1
		for j := 1; j <= i; j++ {
			dp[i][j] = dp[i-1][j] + dp[i-1][j-1]
			if p := prev[c]; p > 0 {
				dp[i][j] -= dp[p-1][j-1]
			}
		}
		prev[c] = i
	}
	k--
	for l := n - 1; l >= 0; l-- {
		cnt := dp[n][l]
		if cnt > k {
			ans += int64(n-l) * k
			k = 0
			break
		}
		k -= cnt
		ans += int64(n-l) * cnt
	}
	if k > 0 {
		ans = -1
	}
	Fprint(_w, ans)
}

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


package main

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

func solve() {
	n := readInt()
	m := readInt()
	k := readInt64()
	x := readInt()
	y := readInt()

	v := make([][]int64, n)
	for i := 0; i < n; i++ {
		v[i] = make([]int64, m)
	}
	if n == 1 {
		size := m
		mul := k / int64(size)
		k = k % int64(size)
		if mul > 0 {
			for j := 0; j < m; j++ {
				v[0][j] = mul
			}
		}
	} else {
		size := (n + n - 2) * m
		mul := k / int64(size)
		k = k % int64(size)
		if mul > 0 {
			for i := 1; i < n-1; i++ {
				for j := 0; j < m; j++ {
					v[i][j] = 2 * mul
				}
			}
			for j := 0; j < m; j++ {
				v[0][j] = mul
			}
			for j := 0; j < m; j++ {
				v[n-1][j] = mul
			}
		}
	}
	for i := 0; i < n && k > 0; i++ {
		for j := 0; j < m && k > 0; j++ {
			v[i][j]++
			k--
		}
	}
	for i := n - 2; i >= 0 && k > 0; i-- {
		for j := 0; j < m && k > 0; j++ {
			v[i][j]++
			k--
		}
	}
	// for i := 0; i < n; i++ {
	// 	fmt.Printf("v[i] = %+v\n", v[i])
	// }
	minValue := int64(math.MaxInt64)
	maxValue := int64(math.MinInt64)
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			value := v[i][j]
			if value < minValue {
				minValue = value
			}
			if value > maxValue {
				maxValue = value
			}
		}
	}
	fmt.Printf("%d %d %d", maxValue, minValue, v[x-1][y-1])
}

var scanner *bufio.Scanner

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

// IO

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

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

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

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

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


package main

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

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

func scanf(f string, a ...interface{}) {
	fmt.Fscanf(reader, f, a...)
}
func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}
func scan(a ...interface{}) {
	fmt.Fscan(reader, a...)
}
func print(a ...interface{}) {
	fmt.Fprint(writer, a...)
}
func println(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}
func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}
func main() {
	_main()
	writer.Flush()
}
// head
var n int
var s string
var m int
var valid []int
func _main() {
    scan(&n, &s)
	m = len(s)

	valid = append(valid, 0)
	for i := 1; i < n; i ++ {
		success := true
		for j := 0; j < m; j ++ {
			k := (i + j) % n
			if k < m && s[k] != s[j] {
				success = false
				break
			}
		}
		if success {
			valid = append(valid, i)
		}
	}

	//println("valid =", valid)
	dp := make([]int64, n)
	dp[0] = 1
	var ans int64
    for _, i := range valid {
    	//println("i = ", i)
		for _, j := range valid {
			k := (i + j) % n
			if k >= i {
				continue
			}
			//println("\tk = ", k)
			dp[i] -= dp[k] << uint(max(0, i - k -m))

		}
        ans += dp[i] * int64(n - i) << (uint)(max(0, n - m - i))
	}
	println(ans)
}


package main

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

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

// IO helper functions

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// IO functions

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

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

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

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

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

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

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

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

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

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

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

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

// Simple math functions

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

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

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

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

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

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

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

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

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

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

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

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

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

func main() {
	defer Flush()

	l := readi()
	r := readi()
	a := readi()

	if a == 0 {
		println(min(l, r) * 2)
	} else if max(l, r)-max(l, r) <= a {
		println((l + r + a) &^ 1)
	} else {
		println((min(l, r) + a) * 2)
	}

}


package main

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

func Init() {
}

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

	sb := bytes.NewBufferString("z")
	rem := K
	c := 'a'
	for rem > 0 {
		sz := 0
		for sz <= rem {
			sb.WriteRune(c)
			rem -= sz
			sz++
		}
		c++
	}
	io.Println(sb.String())
}

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 vec struct {
	x, y int64
}

func (a vec) less(b vec) bool                 { return a.x < b.x || a.x == b.x && a.y < b.y }
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 isOrthogonal(a, b, c vec) bool           { return a.sub(b).dot(c.sub(b)) == 0 }
func isRectangle(a, b, c, d vec) bool         { return isOrthogonal(a, b, c) && isOrthogonal(b, c, d) && isOrthogonal(c, d, a) }
func isRectangleAnyOrder(a, b, c, d vec) bool { return isRectangle(a, b, c, d) || isRectangle(a, b, d, c) || isRectangle(a, c, b, d) }

// github.com/EndlessCheng/codeforces-go
func main() {
	mp := map[vec]int{}
	shown := map[vec]int{}
	for i := 0; i < 4; i++ {
		var x, y int64
		Scan(&x, &y)
		p0 := vec{x, y}
		Scan(&x, &y)
		p1 := vec{x, y}
		if v := p1.sub(p0); v.x != 0 && v.y != 0 {
			Print("NO")
			return
		}
		mp[p0]++
		mp[p1]++
		if p1.less(p0) {
			p0, p1 = p1, p0
		}
		shown[p1.sub(p0)]++
	}
	for _, v := range shown {
		if v != 2 {
			Print("NO")
			return
		}
	}
	arr := []vec{}
	for vec, v := range mp {
		if v != 2 {
			Print("NO")
			return
		}
		arr = append(arr, vec)
	}
	if isRectangleAnyOrder(arr[0], arr[1], arr[2], arr[3]) {
		Print("YES")
	} else {
		Print("NO")
	}
}


// 172B
package main

import (
	"fmt"
)

func main() {
	var x [100005]int
	var a, b, m, r, s int
	fmt.Scan(&a, &b, &m, &r)
	for x[r] = 0; r == (r*a+b)%m; {
		x[r] += s
	}
	fmt.Print(s - x[r] + 1)
}


// 172B
package main

import (
	"fmt"
)

func main() {
	var x [100005]int
	var a, b, m, r, s int
	fmt.Scan(&a, &b, &m, &r)
	for ; x[r] == 0; r = (r*a + b) % m {
		x[r] += s
	}
	fmt.Print(s - x[r] + 1)
}


// Try Codeforces
// author: Leonardone @ NEETSDKASU
package main

import (
	"fmt"
	"strings"
)

func main() {
	var s string
	fmt.Scan(&s)
	names := []string{"Danil", "Olya", "Slava", "Ann", "Nikita"}
	cnt := 0
	for _, x := range names {
		if strings.Contains(s, x) {
			cnt++
		}
	}
	if cnt == 1 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


package main

import (
	"fmt"
	"strings"
)

func main() {
	var friends = []string{"Danil", "Olya", "Slava", "Ann", "Nikita"}
	var (
		problems string
		count    int
	)
	fmt.Scan(&problems)

	for _, friend := range friends {
		if has := strings.Contains(problems, friend); has {
			count++
		}
		if count > 1 {
			fmt.Print("NO\n")
			return
		}
	}
	if count == 0 {
		fmt.Print("NO\n")
		return
	}
	fmt.Print("YES\n")
}


package main

import (
         "fmt"
       )

func main() {
    var n,a,b,c int64
    fmt.Scanf("%v\n", &n)
    fmt.Scanf("%v\n", &a)
    fmt.Scanf("%v\n", &b)
    fmt.Scanf("%v\n", &c)

    bTotal := int64(0)
    if a >= b - c {
        for n >= 0 {
            Lb := int64(n/b)
            if Lb == 0 {
                break
            }
            n -= Lb*b
            n += c*Lb
            bTotal += Lb
            //fmt.Printf("%v %v\n", n, bTotal)
        }
        bTotal += int64(n/a)
    } else {
        bTotal = int64(n/a)
    }
    fmt.Printf("%v", bTotal)
}


package main

import (
         "fmt"
       )

func main() {
    var n,a,b,c int64
    fmt.Scanf("%v\n", &n)
    fmt.Scanf("%v\n", &a)
    fmt.Scanf("%v\n", &b)
    fmt.Scanf("%v\n", &c)

    bTotal := int64(0)
    if a > b - c {
        /*for n >= 0 {
            Lb := int64(n/b)
            if Lb == 0 {
                break
            }
            n -= Lb*b
            n += c*Lb
            bTotal += Lb
            //fmt.Printf("%v %v\n", n, bTotal)
        }*/

        bTotal += int64((n-c)/(b-c))
        if bTotal < 0 {
            fmt.Printf("0")
            return
        }
        n -= bTotal*(b-c)
        bTotal += int64(n/a)
    } else {
        bTotal = int64(n/a)
    }
    fmt.Printf("%v", bTotal)
}


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


package main

import (
	"fmt"
	"os"
)

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


package main

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


// A. Another One Bites The Dust
/*
Let's call a string good if and only if it consists of only two types of letters — 'a' and 'b' and every two consecutive letters are distinct. For example "baba" and "aba" are good strings and "abb" is a bad string.

You have 𝑎 strings "a", 𝑏 strings "b" and 𝑐 strings "ab". You want to choose some subset of these strings and concatenate them in any arbitrarily order.

What is the length of the longest good string you can obtain this way?

Input
The first line contains three positive integers 𝑎, 𝑏, 𝑐 (1≤𝑎,𝑏,𝑐≤109) — the number of strings "a", "b" and "ab" respectively.

Output
Print a single number — the maximum possible length of the good string you can obtain.

Examples
Input
1 1 1

Output
4

Input
2 1 2

Output
7

Input
3 5 2

Output
11

Input
2 2 1

Output
6

Input
1000000000 1000000000 1000000000

Output
4000000000

Note
In the first example the optimal string is "baba".

In the second example the optimal string is "abababa".

In the third example the optimal string is "bababababab".

In the fourth example the optimal string is "ababab".
*/
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input, _ := reader.ReadString('\n')
	arr := strings.Split(strings.TrimSpace(input), " ")
	a, _ := strconv.Atoi(arr[0])
	b, _ := strconv.Atoi(arr[1])
	c, _ := strconv.Atoi(arr[2])

	total := c * 2
	if a > b {
		total += (2 * b) + 1
	} else if a < b {
		total += (2 * a) + 1
	} else {
		total += 2 * a
	}
	fmt.Print(total)
}


package main

import (
	"fmt"
)

func fun(x int, y int, z int) int {
	ans:=z * 2
	if x == y {
		ans += x * 2
		return ans
	} else if x > y {
		ans += y * 2 + 1
		return ans
	} else {
		ans += x * 2 + 1
		return ans
	}
}

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)
	fmt.Println(fun(a, b, c))
}


// A. Another One Bites The Dust
/*
Let's call a string good if and only if it consists of only two types of letters — 'a' and 'b' and every two consecutive letters are distinct. For example "baba" and "aba" are good strings and "abb" is a bad string.

You have 𝑎 strings "a", 𝑏 strings "b" and 𝑐 strings "ab". You want to choose some subset of these strings and concatenate them in any arbitrarily order.

What is the length of the longest good string you can obtain this way?

Input
The first line contains three positive integers 𝑎, 𝑏, 𝑐 (1≤𝑎,𝑏,𝑐≤109) — the number of strings "a", "b" and "ab" respectively.

Output
Print a single number — the maximum possible length of the good string you can obtain.

Examples
Input
1 1 1

Output
4

Input
2 1 2

Output
7

Input
3 5 2

Output
11

Input
2 2 1

Output
6

Input
1000000000 1000000000 1000000000

Output
4000000000

Note
In the first example the optimal string is "baba".

In the second example the optimal string is "abababa".

In the third example the optimal string is "bababababab".

In the fourth example the optimal string is "ababab".
*/
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input, _ := reader.ReadString('\n')
	arr := strings.Split(strings.TrimSpace(input), " ")
	a, _ := strconv.ParseInt(arr[0], 10, 64)
	b, _ := strconv.ParseInt(arr[1], 10, 64)
	c, _ := strconv.ParseInt(arr[2], 10, 64)

	total := c * 2
	if a > b {
		total += (2 * b) + 1
	} else if a < b {
		total += (2 * a) + 1
	} else {
		total += 2 * a
	}
	fmt.Print(total)
}


package main

import "fmt"

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

	y := 0
	for m%10 != 7 && m != 7 && h != 7 && h !=17 {
		if m < x {
			m += 60
			h--
		}
		if h<0 {
			h += 24
		}
		m -= x
		y++
	}
	fmt.Println(y)
}


package main

import (
	"fmt"
	"time"
)

func main() {
	var x, h, m int
	n, err := fmt.Scanf("%d", &x)
	if err != nil {
		panic(err)
	}
	if n != 1 {
		panic(n)
	}
	n, err = fmt.Scanf("%d%d", &h, &m)
	if err != nil {
		panic(err)
	}
	if n != 2 {
		panic(n)
	}
	t := time.Date(2000, time.November, 10, h, m, 0, 0, time.UTC)
	i := 0
	for true {
		hour := t.Hour()
		if hour%10 == 7 {
			break
		}
		minute := t.Minute()
		if minute%10 == 7 {
			break
		}
		t = t.Add(-time.Duration(x) * time.Minute)
		i++
	}
	fmt.Print(i)
}


package main

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

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

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

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

func main() {
	defer writer.Flush()
	var n, a, b, p1, p2 int

	arr := [22]int{}
	scanf("%d %d %d\n", &n, &a, &b)
	for i := 0; i < n; i = i + 1 {
		scanf("%d", &arr[i])
	}
	p2 = n - 1
	ans := 0
	for p1 <= p2 {

		if p1 == p2 {
			if arr[p1] == 2 {
				ans += min(a, b)
			}
			break
		}

		if arr[p1] == arr[p2] && arr[p1] == 2 {
			ans = ans + 2*min(a, b)
		}
		if arr[p1]^arr[p2] == 1 {
			ans = -1
			break
		}
		if arr[p1] == 2 && arr[p2] == 1 {
			ans = ans + b
		}
		if arr[p2] == 2 && arr[p1] == 1 {
			ans = ans + b
		}
		if arr[p1] == 2 && arr[p2] == 0 {
			ans = ans + a
		}
		if arr[p2] == 2 && arr[p1] == 0 {
			ans = ans + a
		}
		p1++
		p2--
	}
	printf("%d", ans)

}


package main

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

func main() {
	var m,x,y int
	var a [100]int
	s,t:=0,0
	flag:=false
    	fmt.Scan(&m)
	for i:=0;i<m;i++ {
	    	fmt.Scan(&a[i])
	    	t+=a[i]
	}
	fmt.Scan(&x,&y)
	for i:=0;i<m;i++ {
		s+=a[i]
		if s>=x && s<=y && t-s>=x && t-s<=y {
			fmt.Println(i+2)
			flag=true
			break
		}
	}
	if flag==false {
		fmt.Println("0")
	}
}


package main

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

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

	var w, m int
	Fscan(in, &w, &m)
	if w <= 3 {
		Fprint(out, "YES")
		return
	}
	coef := []int{}
	for ; m > 0; m /= w {
		c := m % w
		if c > 1 {
			if c < w-1 {
				Fprint(out, "NO")
				return
			}
			c = -1
		}
		coef = append(coef, c)
	}
	for i, c := range coef {
		if c == -1 {
			for j := i + 1; j < len(coef)-1; j++ {
				coef[j]++
				if coef[j] != 0 {
					break
				}
			}
		} else if c > 1 {
			Fprint(out, "NO")
			return
		}
	}
	Fprint(out, "YES")
}

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


package main

import "fmt"

func main() {
    var n int
    fmt.Scan(&n)
    ans := false
    for i := 1; i <= n; i++ {
        t := (i*(i+1))/2
        if t == n {
            ans = true
            break
        } else if t > n {
            break
        }
    }
    if ans { fmt.Println("YES") } else { fmt.Println("NO") }
}


package main

import (
	"fmt"
)

func main() {
	m := map[int]struct{}{}
	for i := 1; ; i++ {
		tripN := (i * (i + 1)) / 2
		if tripN > 500 {
			break
		}
		m[tripN] = struct{}{}
	}
	var n int
	fmt.Scanf("%d", &n)
	if _, ok := m[n]; !ok {
		fmt.Println("NO")
		return
	}
	fmt.Println("YES")
}


package main

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

func main() {
	sc := NewScanner()
	M, B := sc.NextInt(), sc.NextInt()

	x := M * B / 2
	y := -((x - B*M) / M)

	if (x-B*M)%M != 0 {
		x += 1
	}

	n := y + 1

	sum := 0
	//println(x, y, n)
	for i := x; i >= 0; i-- {
		sum += n*(n-1)/2 + n*i
		println(sum)
	}
	fmt.Println(sum)

}

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

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

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

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

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

	return mp
}

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


package main

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

const M int64 = 998244353
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 sp(x, y int64) int64 {
  var mul, res int64 = x, 1
  for y != 0 {
    if y % 2 != 0 {
      res = (res * mul) % M
    }
    mul = (mul * mul) % M
    y /= 2
  }
  return res
}

func main() {
  defer writer.Flush()
  var n, m, k int
  scanf("%d%d%d", &n, &m, &k)
  fac := make([]int64, n+1)
  fac[0] = 1
  for i := 1; i <= n; i += 1 {
    fac[i] = (fac[i-1] * int64(i)) % M
  }

  sol := fac[n-1]
  sol = (sol * sp(fac[n-1-k], M-2)) % M
  sol = (sol * sp(fac[k], M-2)) % M
  sol = (sol * sp(int64(m-1), int64(k))) % M
  sol = (sol * int64(m)) % M
  printf("%d\n", sol)
}


package main

import (
	"fmt"
)

func main() {
	var no,mo int
	co,to := 0,0
	a:=make([]int,200)
	fmt.Scan(&no,&mo)
	for i:=0;i<no;i++ {
		fmt.Scan(&a[i])
	}
	for i:=0;i<no;i++ {
	        if a[i]==mo {
	            co++
	        } else  {
	            to = a[i]
	            i++
	            for ;i<no;i++ {
	                if (to+a[i])>mo {
	                    co++
	                    i--
	                    to = 0
	                    break
	                } else  {
	                    to += a[i];
	                }
	            }
	        }
	}
	if to!=0  {
	    co++
	}
	fmt.Println(co)
}


package main

import "fmt"

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