import java.io.*
import java.math.BigDecimal
import java.math.BigInteger
import java.util.*
import java.io.InputStreamReader
import java.io.PrintWriter
import kotlin.concurrent.thread
import kotlin.math.roundToInt

object programkt {
    abstract class Task {
        fun <T:Comparable<T>> min(a: T, b: T) = if (a > b) b else a
        fun <T:Comparable<T>> max(a: T, b: T) = if (a < b) b else a
        fun <T : Int> abs(a: T) = if(a > 0) a else -(a)
        fun <T : Long> abs(a: T) = if(a > 0) a else -(a)
        fun <T : Double> abs(a: T) = if(a > 0) a else -(a)
        abstract fun solve(scanner: FastScanner, printer: PrintWriter)
    }

    class FastScanner(inpStr: InputStream, var br: BufferedReader = BufferedReader(InputStreamReader(inpStr)), var stok: StringTokenizer? = null){
        private fun nextToken(): String? {
            while (stok == null || !stok!!.hasMoreTokens())
                stok = StringTokenizer(br.readLine() ?: return null)
            return stok!!.nextToken()
        }

        fun nextInt() = nextToken()!!.toInt()
        fun nextLong() = nextToken()!!.toLong()
        fun nextDouble() = nextToken()!!.toDouble()
        fun nextChar() = br.read().toChar()
        fun nextString() = nextToken()!!
        fun nextLine() = br.readLine()
        fun nextBigInteger() = BigInteger(nextToken()!!)
        fun nextBigDecimal() = BigDecimal(nextToken()!!)
    }

    @JvmStatic fun main(args: Array<String>) {
        val inputStream = System.`in`
        val outputStream = System.out
        val scanner = FastScanner(inputStream)
        val printer = PrintWriter(outputStream)

        /* TASK */
        val solver = TaskG()
        /* TASK */

        solver.solve(scanner, printer)
        printer.close()
    }

    class TaskA: Task() {
        override fun solve(scanner: FastScanner, printer: PrintWriter) {
            val length = scanner.nextInt()
            val check = { a: Int, b: Int -> abs(a-b) <= 1 }
            val arr = Array(length) { 0 }
            (0 until length).forEach { arr[it] = scanner.nextInt() }

            (0 until length).forEach {l ->
                (l until length).forEach { r ->
                }
            }
        }
    }

    class TaskC: Task() {
        override fun solve(scanner: FastScanner, printer: PrintWriter) {
            var m = scanner.nextLong()
            var n = scanner.nextLong()
            var cnt = 0L
            cnt += m
            while (m >= n-1) {
                cnt += (m/n)
                m/=n

                println("$cnt $m $n")
            }
            println(cnt)
        }
    }

    class TaskG: Task() {
        override fun solve(scanner: FastScanner, printer: PrintWriter) {
            fun code(n: Long, x: Long): Long {
                var count = 0L
                if(x == 1L) return 1L
                for(i in (1L..n+1L)) {
                    if(i == 1L && n >= x) {
                        count += 1
                    } else if(x % i == 0L && i != 1L && x <= n * i) {
                        count += 1
                    }
                }
                return count
            }
            val n = scanner.nextLong()
            val x = scanner.nextLong()
            if(n < x%n) {
                printer.println(0)
                System.exit(0)
            }
            printer.println(code(n,x))
        }
    }

    class TaskI: Task() {
        override fun solve(scanner: FastScanner, printer: PrintWriter) {
            val word = scanner.nextString()

            val crossedResult = scanner.nextString()
            val crossIndexOrder = Array(word.length) { scanner.nextInt() }
            val wordCharArray = Array<Char?>(word.length, word::get)

            var lastIndex = -1

            crossIndexOrder.forEachIndexed { index, item ->
                wordCharArray[item - 1] = null

                val checkString = wordCharArray.toFancyString()
                val checkResult = checkString.contains(crossedResult)
                if (checkResult) lastIndex = index + 1
                if (checkString.length <= crossedResult.length) {
                    println(lastIndex)
                    return
                }
            }
        }

        private fun Array<Char?>.toFancyString() = joinToString(separator = "") { it?.toString() ?: "" }
    }
}


fun main(args: Array<String>) {
    val (n, x) = readInts()
    var count = 0
    for (i in 1..n) {
        if (x % i == 0 && x % i <= n) {
            count++
        }
    }
    println(count)
}

private fun readInts() = readLine()!!.split(" ").map { it.toInt() }


//package codeforces

import java.io.BufferedReader
import java.io.InputStreamReader

fun main() {
    val In = BufferedReader(InputStreamReader(System.`in`))
    val nums = In.readLine()!!.split(" " ).map {it.toInt()}
    val n = nums[0]
    val x = nums[1]
    var times = 0
    if(n*n < x) println(0)
    else if(n*n == x) println(1)
    else {
        times = (1..n)
            .filter { x % it == 0 && x / it <= n }
            .size
        println(times)
    }
}


import kotlin.math.sqrt

fun main(args: Array<String>) {
    val (n, x) = readLine()!!.split(' ').map { it.toInt() }

    println(if (x > n * n) 0
    else
        sqrt(x.toDouble()).toInt()
                .let {
                    (1 .. it).count { x % it == 0 && x/it <= n } * 2 - if (it * it == x) 1 else 0
                })
}


import java.util.*
import kotlin.math.min

val f0 = "What are you doing at the end of the world? Are you busy? Will you save us?"
val left = "What are you doing while sending \""
val mid = "\"? Are you busy? Will you send \""
val rigth = "\"?"

val MAXN = 100000

fun main(args: Array<String> ) {
    val l = LongArray( MAXN + 1, { 0 } )
    l[0] = f0.length.toLong()
    for ( i in 1 until l.size ) {
        l[i] = min( Long.MAX_VALUE / 2, l[i - 1] * 2 + left.length + mid.length + rigth.length )
    }

    val sc = Scanner( System.`in` )
    val q = sc.nextInt()

    for ( qq in 1 .. q ) {
        var n = sc.nextInt()
        var p = sc.nextLong() - 1
        if ( p >= l[n] ) {
            print( "." )
            continue
        }
        while ( true ) {
            if ( n == 0 ) {
                print( f0[p.toInt()] )
                break
            }
            if ( p < left.length ) {
                print( left[p.toInt()] )
                break
            }
            p -= left.length
            if ( p < l[n - 1] ) {
                n --
                continue
            }
            p -= l[n - 1]
            if ( p < mid.length ) {
                print( mid[p.toInt()] )
                break
            }
            p -= mid.length
            if ( p < l[n - 1] ) {
                n --
                continue
            }
            p -= l[n - 1]
            print( rigth[p.toInt()] )
            break
        }
    }
    println()
}


import java.util.*

val reader = Scanner(System.`in`)
var c = 0
fun main(args: Array<String>) {
    val n = reader.nextInt()
    for (i in 1..n)
        c+=reader.nextInt()
    if ((c+1)%(n+1)==1)
        println(2)
    else
        println(3)
}


fun main() {
    var n = readLine()!!.toInt()
    var list = readLine()!!.split(' ').map { it.toInt() }.sum()
    var ans = 0
    for (i in 1..5) {
        if ((list + i) % (n + 1) != 1) {
            ans = i
            break
        }
    }
    println(ans)
}


fun main() {
    val size = readLine()?.toInt() ?: return
    var swappableCount = 0
    var leftOdd = 0
    var rightOdd = 0
    for (i in 0.until(size)) {
        val values = readLine()?.split(' ') ?: return
        val left = values[0].toInt() % 2 == 0
        val right = values[1].toInt() % 2 == 0
        if (!left) {
            leftOdd++
        }
        if (!right) {
            rightOdd++
        }
        if (left != right) {
            swappableCount++
        }
    }
    // both even
    if (leftOdd % 2 == 0 && rightOdd % 2 == 0) {
        println(0)
        return
    }
    // odd and equal
    if (leftOdd == rightOdd) {
        if (swappableCount > 0) {
            println(1)
            return
        }
        else{
            println(-1)
            return
        }
    }
    val diff = Math.abs(leftOdd - rightOdd)
    if (diff % 2 != 0) {
        println(-1)
        return
    }
    val swapCount = diff / 2
    if (swappableCount >= swapCount) {
        println(swapCount)
        return
    }
    println(-1)
}


fun main(arg: Array<String>) {
    val s = readLine()!!
    var metka = '0'
    var o = 0
    var k = 0
    for (i in 0..s.length-1) {
       if (s[i] == metka) o++
        else {
           metka = s[i]
           k = maxOf(k, o)
           o = 1
       }
    }
    if (k >= 7) println("YES")
           else println("NO")
}


fun main() {
        val players = readLine()!!.map { it.toInt() }
        var c = 1

        run l1@{
            players.drop(1).forEachIndexed { index, i ->
                if(i != players[index - 1]) {
                    c = 1
                } else {
                    c++
                    if(c >= 7) {
                        return@l1
                    }
                }
            }
        }
        println(if (c >= 7) "YES" else "NO")
    }


package a

import java.util.*

fun main(args: Array<String>) {
    val word = Scanner(System.`in`).nextLine()

    var counter = 0

    word.forEachIndexed { index, c ->
        println("before $counter")

        if (index == 0) counter++
        else {
            if (c == '0' && word[index - 1] == '0') counter++
            else if (c == '1' && word[index - 1] == '1') counter++
            else counter = 1
        }

        if (counter == 7) return println("YES")
    }

    println("NO")
}


package com.lstr.codeforces

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readDouble() = readLn().toDouble() // single double
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of longs
private fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles
private fun readIntsArr() = ArrayList(readInts()) // ArrayList of ints

private val MX = 200005
private val MOD = 1000000007
private val SZ = 1 shl 18
private val INF = (1e18).toLong()

private fun add(a: Int, b: Int) = (a + b) % MOD // from tourist :o
private fun sub(a: Int, b: Int) = (a - b + MOD) % MOD
private fun mul(a: Int, b: Int) = ((a.toLong() * b) % MOD).toInt()

private fun solve(){
    val players = readLn()
    println(if(players.contains("1111111")||players.contains("0000000")) "YES" else "NO")
}

fun main(){
    val t = 1  // # of test cases
    for (i in 1..t) {
        solve()
    }
}


fun main() {
    val players = readLine()!!
    val stringMatch = Regex("([0-1])\1\1\1\1\1\1+")
    print(if(players.contains(stringMatch)) "YES" else "NO")
}


import kotlin.math.max
import kotlin.math.min

fun main(args: Array<String>) {
    var (la, ra, ta) = readLine()!!.split(' ').map(String::toLong)
    var (lb, rb, tb) = readLine()!!.split(' ').map(String::toLong)
    if (la > lb) {
        var t = la; la = lb; lb = t
        t = ra; ra = rb; rb = t
        t = ta; ta = tb; tb = t
    }
    rb -= la
    lb -= la
    ra -= la
    la = 0
    val tgcd = gcd(ta, tb)
    val q = lb / tgcd
    lb -= q * tgcd
    rb -= q * tgcd
    val ans1 = (min(ra, rb) - max(la, lb) + 1)
    lb -= tgcd
    rb -= tgcd
    val ans2 = (min(ra, rb) - max(la, lb) + 1)
    println(max(ans1, ans2))
}

fun gcd(a: Long, b: Long): Long {
    var aa = a
    var bb = b
    while (bb > 0) {
        val t = aa
        aa = bb
        bb = t % bb
    }
    return aa
}


import java.io.BufferedReader
import java.io.InputStreamReader
import kotlin.math.max
import kotlin.math.min

fun main() {
    val jin = BufferedReader(InputStreamReader(System.`in`))
    var (la, ra, ta) = jin.readLine().split(" ").map { it.toLong() }
    var (lb, rb, tb) = jin.readLine().split(" ").map { it.toLong() }
    val g = gcd(ta, tb)
    val sa = ra - la
    val sb = rb - lb
    la %= g
    lb %= g
    val answer = maxOf(
            min(la + sa, lb + sb) - max(la, lb),
            min(la + sa + g, lb + sb) - max(la + g, lb),
            min(la + sa, lb + sb + g) - max(la, lb + g)
    ) + 1L
    println(answer)
}

fun gcd(a: Long, b: Long): Long = if (b == 0L) a else gcd(b, a % b)


fun main() {
    val (numCitizens, numWizards, percentage) = readLine()!!.split(" ").map(String::toInt)
    val total = numCitizens * percentage / 100 + if ((numCitizens * percentage) % 100 == 0) 0 else 1
    print(total - numWizards)
}


fun main(args: Array<String>){
    val opa = readLine()
    if (opa == null){
    System.out.println("No")
    return
    } else {
    var result = false
    for (i in 1..opa.length - 2){
    if (opa.get(i) != opa.get(i-1)
    && opa.get(i) != opa.get(i+1)
    && opa.get(i) != '.'
    && opa.get(i+1) != '.'
    && opa.get(i-1) != '.'){
        result = true
    }
    }
    if (result){
    println("Yes")
    } else {
    println("No")
    }
    }

}


import java.util.*

fun main(args: Array<String>) {

    val sc = Scanner(System.`in`)

    val a = sc.nextInt()
    val b = sc.nextInt()
    val c = sc.nextInt()

    var a1 = a / 3
    var a2 = a / 3
    var a3 = a / 3
    when (a.rem(3)) {
        0 -> {}
        1 -> a1++
        2 -> {
            a1++
            a2++
        }
    }
    var b1 = b / 2
    var b2 = b / 2
    b1 += b.rem(2)
    var c1 = c / 2
    var c2 = c / 2
    c1 += c.rem(2)

    var res = 0
    res = Math.max(res,  days(arrayOf(a1, b1, c1, a2, c2, b2, a3)))
    res = Math.max(res,  days(arrayOf(b1, c1, a1, c2, b2, a2, a3)))
    res = Math.max(res,  days(arrayOf(c1, a1, c2, b1, a2, a3, b2)))
    res = Math.max(res,  days(arrayOf(a1, c1, b1, a2, a3, b2, c2)))
    res = Math.max(res,  days(arrayOf(c1, b1, a1, a2, b2, c2, a3)))
    res = Math.max(res,  days(arrayOf(b1, a1, a2, b2, c1, a3, c1)))
    res = Math.max(res,  days(arrayOf(a1, a2, b1, c1, a3, c2, b2)))

    println(res)
}

fun days(week: Array<Int>): Int {
    val min = week.min()!!
    var days = min * 7
    var pos = 0
    while (pos < 7) {
        if (week[pos] > min) {
            days++
        } else {
            break
        }
        pos++
    }
    return days
}


//package cf1154

import java.util.StringTokenizer
import kotlin.math.max
import kotlin.math.min

class C {
    fun solve() {
        val st = StringTokenizer(readLine())

        val a: IntArray = IntArray(3)
        val needs: IntArray = intArrayOf(0, 1, 2, 0, 2, 1, 0)

        a[0] = st.nextToken().toInt()
        a[1] = st.nextToken().toInt()
        a[2] = st.nextToken().toInt()

        val weeks = min(a[0] / 3, min(a[1] / 2, a[2] / 2))
        var ans = weeks * 7

        a[0] -= (weeks * 3)
        a[1] -= (weeks * 2)
        a[2] -= (weeks * 2)

        if (weeks == 0) {
            for (weekDay in 0..6) {
                var days = 0
                val b: IntArray = a.copyOf()
                var cur = weekDay
                while (b[needs[cur]] != 0) {
                    b[needs[cur]] --
                    days ++
                    cur ++
                    cur %= 7
                }
                ans = max(days, ans)
            }
        } else {
            if (a[0] >= 2) {
                ans += 2
            }
            if (a[2] == 0) {
                if (a[1] >= 2) {
                    ans += 2
                }
            }
        }
        println(ans)
    }
}

fun main(args: Array<String>) {
    C().solve()
}


import java.util.*
import kotlin.math.min

fun main(args: Array<String>) {
    with(Scanner(System.`in`)) {
        val pt = mutableListOf<Int>()
        val X2 = nextInt()
        val mk = Array(X2 + 1, { true })

        var counter = 0
        (2..X2).forEach {
            if (mk[it]) {
                pt.add(it)
                for (j in (it * 2)..X2 step it) {
                    mk[j] = false
                    ++counter
                }
            }
        }

        pt.reverse()

        val maxFactor = fun(x: Int): Int {
            return pt.first { x%it == 0 }
        }

        val lo = fun(x: Int) = x - maxFactor(x) + 1

        var ans = X2
        (lo(X2)..X2).forEach {
            val c = lo(it)
            if (c > 3) {
                ans = min(ans, c)
            }
        }
        println(ans)
    }
}


import java.util.*
import kotlin.math.min

fun main(args: Array<String>) {
    with(Scanner(System.`in`)) {
        val pt = mutableListOf<Int>()
        val X2 = nextInt()
        val mk = Array(X2 + 1, { true })
        val mf = Array(X2 + 1, { 0 })

        var counter = 0
        (2..X2).forEach {
            if (mk[it]) {
                pt.add(it)
                for (j in (it * 2)..X2 step it) {
                    mk[j] = false
                    mf[j] = it
                    ++counter
                }
            }
        }

        pt.reverse()

        val lo = fun(x: Int) = x - mf[x] + 1

        var ans = X2
        (lo(X2)..X2).forEach {
            if (!mk[it]) {
                val c = lo(it)
                if (c > 3) {
                    ans = min(ans, c)
                }
            }
        }
        println(ans)
    }
}


import java.util.*
import kotlin.math.max
import kotlin.math.min

fun main() {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val k = scanner.nextInt()
    val a = scanner.nextInt()
    val b = scanner.nextInt()

    tailrec fun gcd(i: Int, j: Int): Int =
            if (i % j == 0) j
            else gcd(j, i % j)

    val m = n * k
    var min = m
    var max = 1

    outer@ for (i in arrayOf(a + b, a - b, -a + b, -a - b)) {
        for (j in 0..n) {
            val s = j * k + i
            if (s in 1..m) {
                val g = gcd(m, s)
                val c = m / g
                min = min(min, c)
                max = max(max, c)
                if (min == 1 && max == m) break@outer
            }
        }
    }

    println("$min $max")
}


fun main() {
    val n = readLine()!!.toInt()
    val validPrimes = mutableListOf<Int>()
    val notPrimes = mutableListOf<Int>()
    for (candidate in 2..n / 2) {
        if (candidate !in notPrimes) {
            if (n % candidate == 0)
                validPrimes.add(candidate)
            for (multiplied in candidate + candidate until n / 2 step candidate)
                notPrimes.add(multiplied)
        }
    }
    var sol = mutableSetOf<Int>(1, n)
    for (validPrime in validPrimes) {
        val divisors = mutableSetOf(1, n)
        var multiplied = validPrime
        while (multiplied < n) {
            if (n % multiplied == 0)
                divisors.add(multiplied)
            multiplied += validPrime
        }
        if (divisors.size > sol.size) sol = divisors
    }
    print(sol.sortedDescending().joinToString(" "))
}


fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    val k = r.readLine()!!.toInt()
    val v = r.readLine()!!.split(" ").map { it.toInt() }.sortedDescending()
    var ans = 0
    var acc = 0
    while (acc < k && ans < 12) {
        acc += v[ans++]
    }
    println(if (ans==12) -1 else ans)
}


fun main(args: Array<String>) {
    val k = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toInt() }

    var count = 0
    println(a.sortedDescending().fold(0, {acc, i ->
        if (acc >= k) {
            println(count)
            return
        } else {
            count++
            acc + i
        }
    }))
    println(-1)
}


import java.io.BufferedInputStream

fun main() {
    val pows = LongArray(40)
    pows[0] = 1L
    for (e in 1..39) {
        pows[e] = 7L * pows[e - 1]
    }
    val jin = FastScanner()
    val n = jin.nextInt().toLong()
    val m = jin.nextInt().toLong()
    var e = 0
    var pow = 1L
    while (pow < n) {
        e++
        pow *= 7L
    }
    var f = 0
    pow = 1L
    while (pow < m) {
        f++
        pow *= 7L
    }
    val used = mutableSetOf<Int>()
    var answer = 0
    var hour = 0L
    var minute = 0L
    fun recur(d: Int) {
        if (d == e + f) {
            if (hour < n && minute < m) {
                answer++
            }
        } else {
            for (digit in 0..6) {
                if (digit !in used) {
                    used.add(digit)
                    if (d < e) {
                        hour += digit.toLong() * pows[d]
                    } else {
                        minute += digit.toLong() * pows[d - e]
                    }
                    recur(d + 1)
                    if (d < e) {
                        hour -= digit.toLong() * pows[d]
                    } else {
                        minute -= digit.toLong() * pows[d - e]
                    }
                    used.remove(digit)
                }
            }
        }
    }
    recur(0)
    println(answer)
}

class FastScanner {
    private val BS = 1 shl 16
    private val NC = 0.toChar()
    private val buf = ByteArray(BS)
    private var bId = 0
    private var size = 0
    private var c = NC
    private var `in`: BufferedInputStream? = null

    constructor() {
        `in` = BufferedInputStream(System.`in`, BS)
    }

    private val char: Char
        private get() {
            while (bId == size) {
                size = try {
                    `in`!!.read(buf)
                } catch (e: Exception) {
                    return NC
                }
                if (size == -1) return NC
                bId = 0
            }
            return buf[bId++].toChar()
        }

    fun nextInt(): Int {
        var neg = false
        if (c == NC) c = char
        while (c < '0' || c > '9') {
            if (c == '-') neg = true
            c = char
        }
        var res = 0
        while (c >= '0' && c <= '9') {
            res = (res shl 3) + (res shl 1) + (c - '0')
            c = char
        }
        return if (neg) -res else res
    }
}


fun main() {
    fun readInts() = readLine()!!.split(" ").map(String::toInt)

    readLine()
    val occs = IntArray(6)
    val groupA = readInts()
    val groupB = readInts()
    for (pos in groupA.indices)
        if ((groupA[pos] + groupB[pos]) and 1 == 1) return print(-1)
    for (performance in groupA) occs[performance]++
    for (performance in groupB) occs[performance]--
    val positive = occs.fold(0) { acc, i -> if (i > 0) acc + i else acc }
    val negative = occs.fold(0) { acc, i -> if (i < 0) acc - i else acc }
    print(if (positive == negative && positive % 2 == 0) positive / 2 else -1)
}


import java.io.*
import java.util.*
import kotlin.test.asserter

fun main(args: Array<String>) {
    val inputStream = System.`in`
    val outputStream = System.out
    val inp = InputReader(inputStream)
    val out = PrintWriter(outputStream)
    val solver = TaskB()
    solver.solve(inp, out)
    out.close()
}

class TaskB {
    fun solve(inp: InputReader, out: PrintWriter) {
        val t = inp.nextInt()
        for (i in 1..t) {
            val a = inp.nextLong()
            val b = inp.nextLong()
            val d1 = a - b
            val d2 = a + b
            if (d1 == 1L) {
                if (isPrime(d2))
                    out.println("YES")
                else
                    out.println("NO")
            } else
                out.println("NO")
        }
    }

    private fun isPrime(x: Long): Boolean {
        if (x == 1L)
            return false
        var d = 2L
        while (d * d <= x) {
            if (x % d == 0L)
                return false
            d++
        }
        return true
    }
}

class InputReader(stream: InputStream) {
    private var reader: BufferedReader = BufferedReader(InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer? = null

    init {
        tokenizer = null
    }

    operator fun next(): String {
        while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
            try {
                tokenizer = StringTokenizer(reader.readLine())
            } catch (e: IOException) {
                throw RuntimeException(e)
            }
        }
        return tokenizer!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return next().toLong()
    }
}


import java.io.FileInputStream
import java.util.*

object programkt {
  @JvmStatic fun main(args: Array<String>) {
    if (args.size == 1)
      System.setIn(FileInputStream(args[0]))
    val sc = Scanner(System.`in`)
    val t = Integer.parseInt(sc.nextLine())
    IntRange(1, t).forEach {
      val a = sc.nextLong()
      val b = sc.nextLong()
      println(if (a - b == 1L) "YES" else "NO")
    }
  }
}


fun main(args: Array<String>) {
    val t = readLine()!!.toInt()
    for (test in 0 until t) {
        val (a, b) = readLine()!!.split(" ").map{it.toLong()}
        val res = a * a - b * b
        var flag = true
        for (i in 2..Math.sqrt(res.toDouble()).toInt()) {
           if (res % i == 0L) {
               flag = false
               break
           }
        }
        if (flag) println("YES") else println("NO")
    }
}


fun isPrime(n: Long): Boolean {
    var k: Long
    var upperBound = n / 2

    k = 3
    while (k <= upperBound) {
        upperBound = n / k
        if (n % k == 0L)
            return false
        k += 2
    }
    return true
}

fun main(args: Array<String>) {
    val t = readLine()!!.toInt()
    for (test in 0 until t) {
        val (a, b) = readLine()!!.split(" ").map{it.toLong()}
        val res = a * a - b * b
        if (isPrime(res)) println("YES") else println("NO")
    }
}


import kotlin.math.sqrt

fun main() {
    repeat(readLine()!!.toInt()) {
        val (a,b)= readLine()!!.split(" ").map { it.toLong() }
        if(a - b > 1) {
            println("NO")
        } else {
            var isPrime = true
            for (i in 3..sqrt((a+b).toDouble()).toInt() step 2) {
                if(i.rem(a+b) == 0L) {
                    isPrime = false
                    break
                }
            }
            if(isPrime) {
                println("YES")
            } else {
                println("NO")
            }

        }

    }

}


import java.math.BigInteger
import java.util.Scanner
fun main(){
    var s = Scanner(System.`in`);
    var k = s.nextLine();
    var m = s.nextInt();
    var kb = BigInteger(k);
    var lb = BigInteger("1");
    var lob = BigInteger("10")
    var ob = BigInteger("0")
    while (m>0){
        if(kb%lob==ob){
            kb=kb/lob
       }
        else{
            kb -= lb}
        m--;

    }
print(kb);

}


fun main(args: Array<String>) {
    val input = args.map { it.toInt() }
    var start = input[0]
    var count = input[1]

    while (count-- > 0) {
        if (start % 10 == 0) {
            start /= 10
        } else {
            start--
        }
    }

    println(start)
}


fun main(args: Array<String>) {
    var n:Int= readLine()!!.toInt()
    var k:Int= readLine()!!.toInt()
    for(i in 0 until k)
    {
        if (n%10==0) n=n/10
        else n=n-1
    }
    println(n)
}


fun main(args: Array<String>) {
    val a = readLine()!!.split(" ").map{ it.toInt() }.toMutableList()
    if (a[0] * 3 >= a[1]) {
        print(0)
    } else {
        print(a[0] * 3 - a[1])
    }
}


fun main() {
    val (numExams, requiredSum) = readLine()!!.split(" ").map(String::toInt)
    if (requiredSum <= 2* numExams) return print(numExams)
    print(3 * numExams - requiredSum)
}


fun readLn() = readLine()!!
fun readInt() = readLn().toInt()
fun readStrings() = readLn().split(" ")
fun readInts() = readStrings().map { it.toInt() }

inline fun <T> T.mapK(k: Int, f: (T) -> T): T {
    var res = this
    for (i in 1..k) {
        res = f(res)
    }
    return res
}

fun solve(s: String): String =
    (s.indices.let { it.first until it.last }).map {
        s.substring(it..it + 1)
    }.groupBy { it }
        .map { it.key to it.value.size }
        .maxBy { it.second }!!
        .first

fun main() {
    readLine()
    val s = readLine()
    println(solve(s))
}


import java.util.*

class Main : Runnable {
    private val scanner: Scanner = Scanner(System.`in`)

    override fun run() {
        scanner.nextInt()
        val string = scanner.nextLine()
        val max =
            IntRange(0, string.length - 3)
                .groupingBy { string.substring(it, it + 2) }
                .eachCount()
                .maxBy { it.value }!!
        println(max.key)
    }

}

fun main() = Main().run()


fun main(args: Array<String>) {
    val length = readLine()!!
    val string = readLine()!!
  	println(sol(length, string))
}

fun sol(length: Int, string: String): String{
    val array = Array(91, {IntArray(91)})
    for (i in 0..(length-2)){
        var beg = string[i].toInt()
        var end = string[i+1].toInt()
		array[beg][end]++
    }
    var maxi = 0
    var l1 = 0
    var l2 = 0
    for (i in 41..90){
        for (j in 41..90){
            if (maxi < array[i][j]){
                maxi = array[i][j]
                l1=i
                l2=j
            }
        }
    }
    var p1 = l1.toChar()
    var p2 = l2.toChar()
    return "$p1$p2"
}


import java.util.regex.Pattern

fun twogram(): Pair<String, Int>?{
    val n = readLine()?.toInt() ?: 0
    val s = readLine().orEmpty()
    val chars = s.toList()
    if(chars.size == n) {
        val allPairs = chars.map { c ->
            chars.map {
                "$it" + "$c"
            }.distinct()
        }.flatten().distinct()
        val m = allPairs.map {
            val pattern = Pattern.compile(it) //case insensitive, use [g] for only lower
            val matcher = pattern.matcher(s)
            var count = 0
            while (matcher.find()) count++
            it to count
        }.maxBy { it.second }
        return m
    }else return "" to 0
}


import java.util.regex.Pattern

    val n = readLine()?.toInt() ?: 0
    val s = readLine().orEmpty()
    val chars = s.toList()
    if(chars.size == n) {
        val allPairs = chars.map { c ->
            chars.map {
                "$it" + "$c"
            }.distinct()
        }.flatten().distinct()
        val m = allPairs.map {
            val pattern = Pattern.compile(it) //case insensitive, use [g] for only lower
            val matcher = pattern.matcher(s)
            var count = 0
            while (matcher.find()) count++
            it to count
        }.maxBy { it.second }
        println( m)
    }


import java.util.Scanner

fun main(args: Array<String>)
{

    val map = mutableMapOf<String , Int>()
    val reader = Scanner(System.`in`)
    var n:Int = reader.nextInt()
    var s = reader.nextLine()

    var i:Int = 1
    while(i < n-1){
    	val ch = s.get(i)
    	val t1:String? = Character.toString(ch)
    	val ch2 = s.get(i+1)
    	val t2:String? = Character.toString(ch2)
    	var temp:String = t1+t2
    	if(map.containsKey(temp)){
    		map.put(temp,map.get(temp)!!.plus(1))
    	}else{
    		map.put(temp,1)
    	}
    	i++
    }
    var maxBy = map.maxBy { it ->  it.value }
    println(maxBy!!.key)
}


import java.util.*

object test {
    fun main(argv: Array<String>) {
        val cin = Scanner(System.`in`)
        val len = cin.nextInt()
        val n:String = cin.next()
        val map = mutableMapOf<String, Int>()
        for (i in 0 until len - 1) {
            var temp = n.substring(IntRange(i,i+1))
            if(map.containsKey(temp))
                map[temp] = map[temp]!! + 1
            else map[temp] = 1
        }
        var MIN = 0
        var res = ""
        for ((key, value) in map) {
            if (MIN < value) {
                MIN = value
                res = key
            }
        }
        System.out.println(res)
        cin.close()
    }
}


import java.io.OutputStream
import java.io.IOException
import java.io.InputStream
import java.io.PrintWriter
import java.util.InputMismatchException

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author prakhar17252
 */
fun main(args: Array<String>) {
    val inputStream = System.`in`
    val outputStream = System.out
    val `in` = Main.InputReader(inputStream)
    val out = PrintWriter(outputStream)
    val solver = Main.BTwoGram()
    solver.solve(1, `in`, out)
    out.close()
}

object Main {
    internal class BTwoGram {
        fun solve(testNumber: Int, `in`: InputReader, out: PrintWriter) {
            val n = `in`.nextInt()
            val s = `in`.nextString()

            val freq = Array(26) { IntArray(26) }

            for (i in 0 until n - 1) {
                freq[s.charAt(i) - 'A'][s.charAt(i + 1) - 'A']++
            }

            var ans = StringBuilder()
            var maxi = 0
            for (i in 0..25) {
                for (j in 0..25) {
                    if (freq[i][j] > maxi) {
                        maxi = freq[i][j]
                        ans = StringBuilder()
                        ans.append(('A'.toInt() + i).toChar())
                        ans.append(('A'.toInt() + j).toChar())
                    }
                }
            }

            out.println(ans.toString())
        }

    }

    internal class InputReader(private val stream: InputStream) {
        private val buf = ByteArray(1024)
        private var curChar: Int = 0
        private var numChars: Int = 0
        private val filter: InputReader.SpaceCharFilter? = null

        fun read(): Int {
            if (numChars == -1) {
                throw InputMismatchException()
            }
            if (curChar >= numChars) {
                curChar = 0
                try {
                    numChars = stream.read(buf)
                } catch (e: IOException) {
                    throw InputMismatchException()
                }

                if (numChars <= 0) {
                    return -1
                }
            }
            return buf[curChar++].toInt()
        }

        fun nextInt(): Int {
            var c = read()
            while (isSpaceChar(c)) {
                c = read()
            }
            var sgn = 1
            if (c == '-'.toInt()) {
                sgn = -1
                c = read()
            }
            var res = 0
            do {
                if (c < '0'.toInt() || c > '9'.toInt()) {
                    throw InputMismatchException()
                }
                res *= 10
                res += c - '0'.toInt()
                c = read()
            } while (!isSpaceChar(c))
            return res * sgn
        }

        fun nextString(): String {
            var c = read()
            while (isSpaceChar(c)) {
                c = read()
            }
            val res = StringBuilder()
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c)
                }
                c = read()
            } while (!isSpaceChar(c))
            return res.toString()
        }

        fun isSpaceChar(c: Int): Boolean {
            return filter?.isSpaceChar(c) ?: isWhitespace(c)
        }

        interface SpaceCharFilter {
            fun isSpaceChar(ch: Int): Boolean

        }

        companion object {

            fun isWhitespace(c: Int): Boolean {
                return c == ' '.toInt() || c == '\n'.toInt() || c == '\r'.toInt() || c == '\t'.toInt() || c == -1
            }
        }

    }
}


fun main(args: Array<String>) {
    val map = mutableMapOf<String, Int>()
    readLine()!!.let {
        (it.chunked(2) + it.drop(1).chunked(2))
            .filter { it.length == 2 }
            .forEach { twoGram -> map[twoGram] = 1 + (map[twoGram] ?: 0) }
    }
    println(map.maxBy { it.value }!!.key)
}


fun main(args: Array<String>) {
    readLine() // discard first line
    val string = readLine()
    val map = mutableMapOf<String, Int>()
    (string.chunked(2) + string.drop(1).chunked(2))
        .filter { it.length == 2 }
        .forEach { map[it] = 1 + (map[it] ?: 0) }
    println(map.maxBy { it.value }!!.key)
}


fun main(vararg args: String) {
    val (a, b) = readLine()!!.split(' ')
    print(getCount(a.toInt(), b))
}

private fun getCount(count: Int, str: String): String {
    val temp = HashMap<String, Int>()
    var maxCounted = 1
    var maxValue = ""
    (0 until count - 1).forEach { index ->
        val two = str.substring(index, index + 2)
        if(index == 0) {
            maxValue = two
        }
        val existed = temp[two]
        if (existed != null) {
            val newCount = existed.plus(1)
            if(maxCounted < newCount) {
            	maxCounted = existed.plus(1)
                maxValue = two
            }
            temp[two] = newCount
        } else {
            temp[two] = 1
        }
    }
    return maxValue
}


import java.lang.Integer.parseInt
import java.lang.Long.parseLong
import java.lang.Math.max
import java.lang.System.exit

import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.StringTokenizer

object B {

    internal var `in`: BufferedReader? = null
    internal var out: PrintWriter? = null
    internal var tok: StringTokenizer? = null

    @Throws(Exception::class)
    internal fun solve() {
        val n = scanInt()
        val s = scanString()
        val cnts = IntArray(26 * 26)
        var maxcnt = 0
        for (i in 0 until n - 1) {
            maxcnt = max(maxcnt, ++cnts[s[i] - 'A' + (s[i + 1] - 'A') * 26])
        }
        for (i in 0 until 26 * 26) {
            if (cnts[i] == maxcnt) {
                out!!.print("" + (i % 26 + 'A'.toInt()).toChar() + (i / 26 + 'A'.toInt()).toChar())
                break
            }
        }
    }

    @Throws(IOException::class)
    internal fun scanInt(): Int {
        return parseInt(scanString())
    }

    @Throws(IOException::class)
    internal fun scanLong(): Long {
        return parseLong(scanString())
    }

    @Throws(IOException::class)
    internal fun scanString(): String {
        while (tok == null || !tok!!.hasMoreTokens()) {
            tok = StringTokenizer(`in`!!.readLine())
        }
        return tok!!.nextToken()
    }

    @JvmStatic
    fun main(args: Array<String>) {
        try {
            `in` = BufferedReader(InputStreamReader(System.`in`))
            out = PrintWriter(System.out)
            solve()
            `in`!!.close()
            out!!.close()
        } catch (e: Throwable) {
            e.printStackTrace()
            exit(1)
        }

    }
}


import java.util.*
import kotlin.collections.HashMap

fun main() {
    val scanner = Scanner(System.`in`)
    val input = scanner.nextLine().trim()

    var result: HashMap<String, Int> = HashMap()
    for(i in 0 until input.length - 1) {
        val j = i + 1
        val key = String(charArrayOf(input[i], input[j]));
        var amount = result.get(key)
        if (amount == null) {
            result.put(key, value = 1)
        } else {
            result.put(key, amount + 1)
        }
    }
    println(result.maxBy { it.value }!!.key)
}


package com.happypeople.codeforces.c1212

import java.io.ByteArrayInputStream
import java.io.InputStream
import java.util.*

fun main(args: Array<String>) {
    try {
        B1212().run()
    } catch (e: Throwable) {
        println("")
        e.printStackTrace()
    }
}

class B1212 {
    fun run() {
        val sc = Scanner(systemIn())
        val n=sc.nextInt()
        val str=sc.next()
        val dmap = mutableMapOf<String, Int>()
        for(i in 0..str.length-2) {
            val twogram=str.substring(i..i+1)
            val old=dmap.getOrDefault(twogram, 0);
            dmap.set(twogram, old+1);
        }
        println(dmap.toList().sortedByDescending { (_, value) -> value }.first().first)
    }

    companion object {
        var inputStr: String? = null

        fun systemIn(): InputStream {
            if (inputStr != null)
                return ByteArrayInputStream(inputStr!!.toByteArray())
            else
                return System.`in`
        }

        var printLog = false
        fun log(str: String) {
            if (printLog)
                println(str)
        }
    }
}


import kotlin.math.min

fun main() {
    fun readInt() = readLine()!!.toInt()
    print(min(readInt(), min(readInt(), readInt())) + 1)
}


import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.*
private fun readLn() = readLine()!! // string
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() //long
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map {it.toLong()} // list of longs

val N = 5005 // 1e5.toInt()+5   //1e9.toInt() + 7

fun main() {
    val b = readInt()
    val g = readInt()
    val n = readInt()
    println(min(n+1,min(b,g)+1))

}


import kotlin.math.min

private fun readString() = readLine()!!
private fun readInt() = readString().toInt()
private fun readStrings() = readString().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

fun main(){
    var b = readInt()
    var g = readInt()
    val n = readInt()
    var count = 0

    while(b > 0){
        val take = min(b,n)
        b -= take
        g -= n - take
        count++
    }
    while(g > 0){
        val take = min(g,n)
        g -= take
        count++
    }

    println(count)
}


import kotlin.math.*
import kotlin.random.Random.Default.nextInt
import kotlin.system.exitProcess

const val B = 31
const val MOD = 998244353

fun readInt(): Int {
    var digit = System.`in`.read()
    while(digit <= 32) {
        digit = System.`in`.read()
    }

    val negative = digit == '-'.toInt()
    if (negative) {
        digit = System.`in`.read()
    }
    var res = 0
    while (digit in '0'.toInt()..'9'.toInt()) {
        res *= 10
        res += digit - '0'.toInt()
        digit = System.`in`.read()
    }
    return if (negative) -res else res
}

fun main() {
    val k = readLine()!!.toInt()

    val dp = Array(B) { Array(B) { Array(2) { 0L } } }

    dp[B - 1][0][1] = 1
    for(i in B - 1 downTo 1) {
        for(j in 0 until B) {
            for(p in 0..1) {
                if(dp[i][j][p] == 0L) continue

//                println("$i $j $p ${dp[i][j][p]}")

                if(p == 0 || ((k shr (i - 1)) and 1) == 1) {
//                    println("$i $j $p")
                    dp[i - 1][j + 1][p] = (dp[i - 1][j + 1][p] + dp[i][j][p]) % MOD
                }

                if(p == 0) {
                    dp[i - 1][j][0] = (dp[i - 1][j][0] + dp[i][j][p] * (1 shl j)) % MOD
                } else if(j == 0) {
                    val newp = if(((k shr (i - 1)) and 1) == 1) 0 else 1
                    dp[i - 1][j][newp] = (dp[i - 1][j][newp] + dp[i][j][p]) % MOD
                } else if(((k shr (i - 1)) and 1) == 1) {
                    dp[i - 1][j][0] = (dp[i - 1][j][0] + dp[i][j][p] * (1 shl (j - 1))) % MOD
                    dp[i - 1][j][1] = (dp[i - 1][j][1] + dp[i][j][p] * (1 shl (j - 1))) % MOD
                } else {
                    dp[i - 1][j][1] = (dp[i - 1][j][1] + dp[i][j][p] * (1 shl (j - 1))) % MOD
                }
            }
        }
    }

    var ans = 0L
    for(j in 0 until B) {
        for(p in 0..1) {
            ans = (ans + dp[0][j][p]) % MOD
        }
    }

    println(ans)
}


@ExperimentalStdlibApi
fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    var str = r.readLine()!!
    val len = str.length
    var upper = true
    for (i in 1..len - 1) {
        if (str[i].toInt() > 96) upper = false
    }
    if (!upper) {
        if (len == 1) println(str.toUpperCase())
        else println(str)
    } else{
        str = str.toLowerCase()
        println(str.capitalize(Locale.ROOT))
    }
}


fun main(args: Array<String>) {
        var str = readLine()!!
        var c1 = str[0]
        str = str.substring(1)

        if (str.toUpperCase() === str) {
            str = str.toLowerCase()
            if (Character.toUpperCase(c1) == c1)
                c1 = Character.toLowerCase(c1)
            else
                c1 = Character.toUpperCase(c1)
        }
        println(c1 + str)
    }

}


fun main(args: Array<String>) {
    val inputStream = System.`in`
    val outputStream = System.out
    val input = InputReader(inputStream)
    val output = PrintWriter(outputStream)
    val solver = Task()
    solver.solve(input, output)
    output.close()
}

private class Task {
    fun solve(input: InputReader, output: PrintWriter) {
        val word = input.next()
        output.print(if (word.all { it.isUpperCase() } || (word.length > 1 && word.first().isLowerCase() && word.substring(1).all { it.isUpperCase() })) {
            word.toLowerCase().capitalize()
        } else {
            word
        })
    }
}

private class InputReader(stream: InputStream) {
    private var reader: BufferedReader = BufferedReader(InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer? = null

    operator fun next(): String {
        while (tokenizer == null || tokenizer?.hasMoreTokens()?.not() == true) {
            try {
                tokenizer = StringTokenizer(reader.readLine())
            } catch (e: IOException) {
                throw RuntimeException(e)
            }

        }
        return tokenizer!!.nextToken()
    }

    fun nextInt(): Int {
        return next().toInt()
    }

}


import java.util.*

fun main(args: Array<String>) {
    val s: Scanner = Scanner(System.`in`)
    val str: String = s.next()
    if (str.length > 1) {
        if (isUpperCase(str.substring(1))) {
            print(invertCase(str))
        } else {
            print(str)
        }
    } else {
        print(str)
    }
}

fun isUpperCase(str: String): Boolean {
    var isUp: Boolean = true;
    str.forEach { c: Char ->
        if (!c.isUpperCase()) {
            isUp = false
            return@forEach
        }
    }
    return isUp
}

fun invertCase(c: Char): Char {
    if (c.isUpperCase()) {
        return c.toLowerCase();
    } else if (c.isLowerCase()) {
        return c.toUpperCase()
    } else {
        return c
    }
}

fun invertCase(str: String): String {
    val sb: StringBuilder = StringBuilder()
    str.forEach { c -> sb.append(invertCase(c)) }
    return sb.toString()
}


import java.io.BufferedReader
import java.io.IOException
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.max
import kotlin.math.min
import kotlin.math.sqrt

fun main(args : Array<String>) {
    Thread { run() }.start()
}

fun run() {
    val scanner = Scanner(System.`in`)
    val a = scanner.nextInt()
    val b = scanner.nextInt()
    val c = scanner.nextInt()
    val res = (a / 3) + (b / 3) + (c / 3) + min(min(a % 3, b % 3), c % 3) + if ((a % 3) * (a % 3) + (b % 3) * (b % 3) + (c % 3) * (c % 3) == 8) 1 else 0
    println(res)

}

class Scanner(s: InputStream) {
    var st: StringTokenizer? = null
    var br: BufferedReader = BufferedReader(InputStreamReader(s))
    @Throws(IOException::class)
    operator fun next(): String {
        while (st == null || !st!!.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st!!.nextToken()
    }
    @Throws(IOException::class)
    fun nextInt(): Int {
        return Integer.parseInt(next())
    }
    @Throws(IOException::class)
    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }
    @Throws(IOException::class)
    fun nextLine(): String {
        return br.readLine()
    }
    @Throws(IOException::class)
    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }
    @Throws(IOException::class)
    fun ready(): Boolean {
        return br.ready()
    }
}
fun IntArray.print() {
    println(Arrays.toString(this))
}
fun Array<IntArray>.print() {
    for (i in this)
        i.print()
}
fun LongArray.print() {
    println(Arrays.toString(this))
}
fun Array<LongArray>.print() {
    for (i in this)
        i.print()
}
fun BooleanArray.print() {
    println(Arrays.toString(this))
}


import java.util.*

/**
 * Created by Hamza on 07/11/2017.
 */
fun main(args: Array<String>) {
    var sc = Scanner(System.`in`)
    var r = sc.nextInt()
    var g = sc.nextInt()
    var b = sc.nextInt()
    println("${r / 3 + g / 3 + b / 3 + (r % 3 + b % 3 + g % 3) / 3}")
}


import java.io.BufferedInputStream
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(BufferedInputStream(System.`in`))

    var r = scanner.nextLong()
    var g = scanner.nextLong()
    var b = scanner.nextLong()

    val ones = Math.min(r, Math.min(g, b))
    var ans  = ones
    r -= ans
    g -= ans
    b -= ans
    ans += r/3 + g/3 + b/3

    if(ones > 0 && (r == 2L || g == 2L || b == 2L)){
        --ans
        r += 1
        g += 1
        b += 1
        ans += r/3 + g/3 + b/3
    }

    print(ans)
}


import java.io.BufferedInputStream
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(BufferedInputStream(System.`in`))

    var r = scanner.nextLong()
    var g = scanner.nextLong()
    var b = scanner.nextLong()

    var ones = Math.min(r, Math.min(g, b))
    var ans = 0L
    r -= ones
    g -= ones
    b -= ones
    ans += r/3 + g/3 + b/3
    r %= 3
    g %= 3
    b %= 3

    while(ones > 0 && (r == 2L || g == 2L || b == 2L)){
        --ones
        r += 1
        g += 1
        b += 1
        ans += r/3 + g/3 + b/3
        r %= 3
        g %= 3
        b %= 3
    }

    //println("$r $g $b")
    print(ans+ones)
}


import java.io.BufferedReader

fun main() = (System.`in`.bufferedReader().run {
    val len = readLong()

    var clen = 1L
    val lens = LongArray(10) { 1 }
    var idx = 0
    while (clen < len) {
        clen /= lens[idx]
        lens[idx]++
        clen *= lens[idx++]
    }

    println(lens.mapIndexed { cidx, it -> "codeforces"[cidx].toString().repeat(it.toInt()) }.joinToString(""))
} to Unit).second

private const val SPACE_INT = ' '.toInt()
private const val ZERO_INT = '0'.toInt()
private const val NL_INT = '\n'.toInt()

@Suppress("DuplicatedCode")
private fun BufferedReader.readInt(): Int {
    var ret = read()
    while (ret <= SPACE_INT) {
        ret = read()
    }
    val neg = ret == '-'.toInt()
    if (neg) {
        ret = read()
    }
    ret -= ZERO_INT
    var read = read()
    while (read >= ZERO_INT) {
        ret *= 10
        ret += read - ZERO_INT
        read = read()
    }
    while (read <= SPACE_INT && read != -1 && read != NL_INT) {
        mark(1)
        read = read()
    }
    if (read > SPACE_INT) {
        reset()
    }
    return if (neg) -ret else ret
}

@Suppress("DuplicatedCode")
private fun BufferedReader.readLong(): Long {
    var ret = read().toLong()
    while (ret <= SPACE_INT) {
        ret = read().toLong()
    }
    val neg = ret == '-'.toLong()
    if (neg) {
        ret = read().toLong()
    }
    ret -= ZERO_INT
    var read = read()
    while (read >= ZERO_INT) {
        ret *= 10
        ret += read - ZERO_INT
        read = read()
    }
    while (read <= SPACE_INT && read != -1 && read != NL_INT) {
        mark(1)
        read = read()
    }
    if (read > SPACE_INT) {
        reset()
    }
    return if (neg) -ret else ret
}

@Suppress("DuplicatedCode")
private fun BufferedReader.readWord(): String {
    var ret = read()
    while (ret <= SPACE_INT && ret != -1) {
        ret = read()
    }
    if (ret == -1) {
        return ""
    }
    var cb = CharArray(32)
    var idx = 0
    while (ret > SPACE_INT) {
        if (idx == cb.size) {
            cb = cb.copyOf(cb.size shl 1)
        }
        cb[idx++] = ret.toChar()
        ret = read()
    }
    while (ret <= SPACE_INT && ret != -1 && ret != NL_INT) {
        mark(1)
        ret = read()
    }
    if (ret > SPACE_INT) {
        reset()
    }
    return String(cb, 0, idx)
}


fun main() {
    val a = readLine()!!.toDouble()
    val stringList = listOf("c", "o", "d", "e", "f", "o", "r", "c", "e", "s")
    val printTimes = MutableList(10) {1}
    var index = 0

    while (printTimes.reduce { acc, i -> acc * i } < a ) {
        printTimes[index%10] += 1
        index += 1
    }

    for (i in 0..stringList.size-1) {
        val str = List(printTimes[i]) {stringList[i]}
        print(str.joinToString(""))
    }
}


import kotlin.math.pow
import kotlin.math.round

fun main() {
    val a = readLine()!!.toDouble()
    var base = 1.0
    while (base.pow(10) < a) {
        base += 1
    }

    val stringList = listOf("c", "o", "d", "e", "f", "o", "r", "c", "e", "s")
    val printTimes = MutableList(10) {base.toInt()}

    val minTime = base.toInt()
    var index = 0
    var acc = base.pow(10)

    while (acc > a ) {
        printTimes[index] -= 1
        acc = acc / (minTime) * (minTime-1)
        index += 1

    }
    printTimes[index-1] = minTime

    for (i in 0..stringList.size-1) {
        val str = List(printTimes[i]) {stringList[i]}
        print(str.joinToString(""))
    }
}


import java.lang.Math.pow
import java.lang.String.format
import java.util.*
import kotlin.math.*
import kotlin.system.exitProcess

private fun readLn() = readLine()!! // string line
private fun readStrings() = readLn().split(" ") // list of strings
private fun readLong() = readLn().toLong()
private fun readLongs() = readStrings().map { it.toLong() } // list of ints
private fun readInt() = readLn().toInt() // single int
private fun readInts() = readStrings().map { it.toInt() } // list of ints

//var graph = Array(0) { mutableListOf<Int>()}
//var n = 0

fun main() {
    val k = readLong()
    var base = 1

    for (i in 1 until 100) {
        if (pow(i.toDouble(), 10.toDouble()) > k) {
            base = i - 1
            break
        }
    }

    val ar = Array(10) {base}

    for (i in 0 until 10) {
        if (i != 0) ar[i] += 1

        var m = 1L
        for (j in 0 until 10) {
            m *= ar[j]
        }
        if (m >= k) {
//            println("$base $i")
            toStr(ar)
            return
        }
    }
}

fun toStr(ar: Array<Int>) {
    var s = "codeforces"
    var ans = mutableListOf<Char>()
    for (i in 0 until 10) {
        for (j in 0 until ar[i]) {
            ans.add(s[i])
        }
    }
    println(ans.joinToString(""))
}


import kotlin.math.floor
import kotlin.math.pow

fun main() {
    val n = readLine()!!.toLong()
    val c = floor(n.toDouble().pow(1 / 10)).toLong()
    val answer = LongArray(10) { c }
    var index = 0
    var number = 1L
    answer.forEach { number *= it }
    while (number < n) {
        answer[index++]++
        number = 1L
        answer.forEach { number *= it }
    }
    val s = "codeforces"
    val out = StringBuilder()
    answer.forEachIndexed { i, it ->
        repeat(it.toInt()) { out.append(s[i]) }
    }
    println(out.toString())
}


import java.io.File
import java.util.*
import kotlin.math.floor

fun doit(scanner: Scanner){
    var k = scanner.nextLong()
    print("codeforce")
    while (k > 0){
        print("s")
        k--
    }
}

fun main(args:Array<String>){
    val mode = 1
    //val file = File("in.txt")
    var scanner =  Scanner(System.`in`) //else Scanner(file)
    //var t = scanner.nextInt()
    //while (t-- > 0){
        doit(scanner)
    //}
}


const val s = "codeforces"
fun main() {
    val k = readLine()!!.toInt()
    var pos = 0
    val a = MutableList(10) { 0 }
    while (a.reduce { x, y -> x * y } < k) {
        a[pos]++
        pos = (pos + 1) % 10
    }
    var res = ""
    for (i in 0 until 10)
        repeat(a[i]) {
            res += s[i]
        }
    println(res)
}


fun readInt() = readLine()!!.toInt()

fun main() {
    val n = readInt()
    val counters = "codeforces".map { 1 }.toMutableList()
    while (counters.product() < n) {
        val idx = counters.indexOf(counters.min())
        counters[idx]++
    }
    println("codeforces".mapIndexed { idx, c -> c.toString().repeat(counters[idx])}.joinToString(separator=""))
}

private fun List<Int>.product(): Int = reduce(Int::times)


fun main(){
    val n = readLine()!!.toInt()
    val l = List(11){0}.toMutableList()
    val m = List(11){0}.toMutableList()
    for (i in 1..10){
        val a = i * (i + 1) / 2
        l[i] = l[i-1] + a
        m[i] = m[i-1] + l[i]
    }
    println("${m[n]}")
}


fun main() {
    val n = readLine()?.toInt() ?: 0
    val a = Array(n) {
        IntArray(n) { 1 }
    }

    println(findMax(a, 1, 1, n))
}

fun findMax(a: Array<IntArray>, startI: Int, startJ: Int, n: Int): Int {
    if (startI == n || startJ == n) {
        return 0
    }
    for (i in startI until n) {
        for (j in startJ until n) {
            a[i][j] = a[i - 1][j] + a[i][j - 1]
            findMax(a, i + 1, j + 1, n)
        }
    }
    return a[n - 1][n - 1]
}


/*
* Name: A. Maximum in Table
* Link: https://codeforces.com/problemset/problem/509/A
*/

fun main() {

    val x: Int = 5 //readLine()!!.toInt()
    val table: MutableList<MutableList<Int>> = mutableListOf()
    val tmp: MutableList<Int> = mutableListOf()

    for (i in 0 until x)
        tmp.add(1)

    for (i in 0 until x)
        table.add(tmp)

    for (i in 1 until x)
        for (j in 1 until x)
            table[i][j] = table[i - 1][j] + table[i][j - 1]

    println(table[x - 1][x - 1])
}


fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    print((n..2*n-2).reduce{prod, e -> prod*e}/(1 until n).reduce{prod, e-> e*prod})
}


fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    if (n==1) print(1)
    else print((n..2*n-2).reduce{prod, e -> prod*e}/(1 until n).reduce{prod, e-> e*prod})
}


import java.io.InputStream
import java.io.PrintStream
import java.math.BigDecimal
import java.math.BigInteger

private val MOD = 1e9.toLong() + 7

val input = FastScanner()

fun main(args: Array<String>) {
    System.setOut(PrintStream(System.out.buffered(), false))

    val (h, m) = input.nextString()!!.split(':').map { it.toInt() }
    val time = h * 60 + m
    var ans = 0
    while (!palindrome(toStr(time + ans))) {
        ans++
    }

    println(ans)

    System.out.flush()
}

fun palindrome(s: String): Boolean {
    return s[0] == s[4] && s[1] == s[3]
}

fun toStr(time: Int): String {
    return String.format("%02d:%02d", time / 60 % 24, time % 60)
}

fun String.toBigInteger() = BigInteger(this)
fun String.toBigDecimal() = BigDecimal(this)

class FastScanner(private val input: InputStream = System.`in`) {
    private val sb = StringBuilder()
    private val buffer = ByteArray(4096)
    private var pos = 0
    private var size = 0

    fun nextString(): String? {
        var c = skipWhitespace()
        if (c < 0) return null

        return sb.run {
            setLength(0)

            do {
                append(c.toChar())
                c = read()
            } while (c > ' '.toInt())

            toString()
        }
    }

    fun nextLine(): String? {
        var c = read()
        if (c < 0) return null

        return sb.run {
            setLength(0)

            while (c >= 0 && c != '\n'.toInt()) {
                append(c.toChar())
                c = read()
            }

            toString()
        }
    }

    fun nextLong(): Long {
        var c = skipWhitespace()

        val sign = if (c == '-'.toInt()) {
            c = read()
            -1
        } else 1

        var ans = 0L

        while (c > ' '.toInt()) {
            ans = ans * 10 + c - '0'.toInt()
            c = read()
        }

        return sign * ans
    }

    fun nextInt() = nextLong().toInt()
    fun nextDouble() = nextString()?.toDouble() ?: 0.0
    fun nextBigInteger(): BigInteger = nextString()?.toBigInteger() ?: BigInteger.ZERO
    fun nextBigDecimal(): BigDecimal = nextString()?.toBigDecimal() ?: BigDecimal.ZERO

    fun nextStrings(n: Int) = Array<String>(n) { nextString() ?: "" }
    fun nextInts(n: Int) = IntArray(n) { nextInt() }
    fun nextLongs(n: Int) = LongArray(n) { nextLong() }
    fun nextDoubles(n: Int) = DoubleArray(n) { nextDouble() }
    fun nextBigIntegers(n: Int) = Array<BigInteger>(n) { nextBigInteger() }
    fun nextBigDecimals(n: Int) = Array<BigDecimal>(n) { nextBigDecimal() }

    fun nextStrings(n: Int, m: Int) = Array(n) { nextStrings(m) }
    fun nextInts(n: Int, m: Int) = Array(n) { nextInts(m) }
    fun nextLongs(n: Int, m: Int) = Array(n) { nextLongs(m) }
    fun nextDoubles(n: Int, m: Int) = Array(n) { nextDoubles(m) }
    fun nextBigIntegers(n: Int, m: Int) = Array(n) { nextBigIntegers(m) }
    fun nextBigDecimals(n: Int, m: Int) = Array(n) { nextBigDecimals(m) }

    private fun skipWhitespace(): Int {
        while (true) {
            val c = read()
            if (c > ' '.toInt() || c < 0) return c
        }
    }

    private fun read(): Int {
        while (pos >= size) {
            if (size < 0) return -1
            size = input.read(buffer, 0, buffer.size)
            pos = 0
        }
        return buffer[pos++].toInt()
    }
}


import java.lang.Math.pow
//***********************
const val threshold = 50

fun brute(x: Long, y: Long): Char {
    val xy = pow(x.toDouble(), y.toDouble())
    val yx = pow(y.toDouble(), x.toDouble())
    return when {
        xy > yx -> '>'
        xy < yx -> '<'
        else -> '='
    }
}

fun solve(): Char {
    val (x, y) = readLine()!!
            .split(" ")
            .map(String::toLong)
    return if (x == y) '='
    else if (x < threshold && y < threshold) brute(x, y)
    else if (x == 1L) '<'
    else if (y == 1L) '>'
    else if (x > y) '<'
    else if (y < x) '>'
    else '='
}

fun main(args: Array<String>) { print(solve()) }


fun myFunction() {
    val input = Scanner(System.`in`)
    val a = input.nextInt()
    val b = input.nextInt()
    if (a == b) {
        System.out.println("=")
    } else {
        if (Math.log(a.toDouble()) > Math.log(b.toDouble())) System.out.println(">") else System.out.println("<")
    }
}


import java.util.*

fun main() {
    val input = Scanner(System.`in`)
    val a = input.nextInt()
    val b = input.nextInt()
    if (a == b) {
        System.out.println("=")
    } else {
        if (Math.log(a.toDouble()) > Math.log(b.toDouble())) System.out.println(">") else System.out.println("<")
    }
}


import java.math.MathContext
import java.util.Scanner

fun main(args: Array<String>) {
    val scan = Scanner(System.`in`)
    val a = scan.nextInt()
    val b = scan.nextInt()
    if (a==b || (a==2 && b==4) || (a==4 && b==2)) print ("=")
    else if (a>b || a==0) print ("<")
    else print (">")
}


package codeforces

import java.util.*

fun main (args: Array<String>) {
    val sc = Scanner(System.`in`)
    val a = sc.nextInt()
    val b = sc.nextInt()

    val v = b * (Math.log10(a.toDouble()) / Math.log10(b.toDouble()))

    if (a == b) {
        println("=")
        return
    }

    when {
        v < a -> println("<")
        v > a -> println(">")
        else -> {
            println("=")
            throw Exception("nope")
        }
    }

}


import java.util.*

fun main (args: Array<String>) {
    val sc = Scanner(System.`in`)
    val a = sc.nextInt()
    val b = sc.nextInt()

    if (a == b) {
        println("=")
        return
    }

    if (b == 1) {
        println(">")
        return
    }

    val v = b * (Math.log10(a.toDouble()) / Math.log10(b.toDouble()))

    when {
        v < a -> println("<")
        v > a -> println(">")
        else -> {
            println("=")
            throw Exception("nope")
        }
    }

}


import kotlin.math.log10

fun main(args: Array<String>) {
    val (x, y) = readLine()!!.split(" ").map { it.toInt() }
    print(when {
        y / log10(y.toDouble()) > x / log10(x.toDouble()) + 1e-9 -> "<"
        y / log10(y.toDouble()) < x / log10(x.toDouble()) - 1e-9 -> "<"
        else -> "="
    })
}


import java.util.Scanner;
import java.lang.Math;
fun log(N:Int):Int
{
 var c:Int=0
 var num=N
 while(num!=1)
 {
 num=num/2
 c++
 }
 return c
 }
fun main()
{
var scan=Scanner(System.`in`)
var a:Int=scan.nextInt()
var b:Int=scan.nextInt()
 var d:Double=Math.log(a*1.00)/a
 var e:Double=Math.log(b*1.00)*1.00/b*1.00
 println("$d $e")
  if(d>e)
  println(">")
  else if(d<e)
  println("<")
  else
  println("=")

 }


import java.io.*
import java.util.*
import kotlin.math.*

fun min(a: Int, b: Int): Int {
    if (a < b) {
        return a
    } else {
        return b
    }
}

fun max(a: Int, b: Int): Int {
    if (a > b) {
        return a
    } else {
        return b
    }
}

fun main(args:Array<String>) {
    val reader = BufferedReader(InputStreamReader(System.`in`))
    val writer = BufferedWriter(OutputStreamWriter(System.out))

    val n = reader.readLine().toLong()
    val mn: Long = 1000000000 + 7

    var ans: Long = 1
    var minus: Long = 1
    for (i in 1..n) {
	ans *= i
	ans %= mn
	if (i.toInt() != 1) {
	    minus *= 2
	    minus %= mn
	}
    }

    ans -= minus

    writer.write("$ans\n")

    writer.flush()
    reader.close()
    writer.close()
}


import java.util.*

fun main(atgs: Array<String>){
    val sc = Scanner(System.`in`)
    val n: Int = 5
    var sum = 0
    var num = Array<Int>(100){0}
    for (i in 0 until n){
        var x = sc.nextInt()
        num[x]++
        sum += x
    }
    var ans = sum
    for (i in 1 until 100){
        if (num[i] > 1){
            if (num[i] == 2) ans = if (ans < sum-2*i) ans else sum-2*i
            else ans = if (ans < sum-3*i) ans else sum-3*i
        }
    }
    println(ans)
}


import java.util.*
import kotlin.collections.ArrayList

fun main() {
    var sc = Scanner(System.`in`)
    var list = ArrayList<Int>()
    list.add(sc.nextInt())
    list.add(sc.nextInt())
    list.add(sc.nextInt())
    list.add(sc.nextInt())
    list.add(sc.nextInt())

    Collections.sort(list)

    var array = Array(100,{0})

    var i = 0
    while (i<list.size){
        array[list[i]]++
        i++
    }
    var j = 0
    var max = Int.MIN_VALUE
    var flag = false
    while (j<array.size){
        var two = 0
        if (array[j]==2){
            flag = true
          two+=j*array[j]
            if (two>max){
                max = two
            }
        }else if (array[j]>=3){
            flag = true
            two+=3*j
            if (two>max){
                max = two
            }
        }
        j++
    }

   if (flag){
       println(list.sum()-max)
   }else{
       println(list.sum())
   }
}


fun main() {
    var (a, b) = readLine()!!.split(' ').map { it.toInt() }
    var count = 0L
    for (i in a..b){
        var digit = i.toString()
        for (i in digit){
            when(i){
                '0'->count+=6
                '1'->count+=2
                '2'->count+=5
                '3'->count+=5
                '4'->count+=4
                '5'->count+=5
                '6'->count+=6
                '7'->count+=3
                '8'->count+=7
                '6'->count+=6
            }
        }
    }
    println(count)
}


import java.util.Scanner;

fun main(args: Array<String>) {
    var scan = Scanner(System.`in`);
    var area: Int = scan.nextInt();

    var sqrt: Int = Math.floor(Math.sqrt(area.toDouble())).toInt();
    var p: Int = sqrt * 4;
    var a: Int = sqrt * sqrt;
    var d: Int = area - a;
    if (area == a) {
        System.out.println(p);
    } else if (d < sqrt) {
        System.out.println(p + 2);
    } else {
        System.out.println(p+4);
    }
}


fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    val n = r.readLine()!!.toInt()
    val v = r.readLine()!!.split(" ").map { it.toInt() }
    if (n == 1) {
        println(-1)
    } else {
        val before = v[n - 2]
        val mid = v[n - 1]
        when {
            mid in (before + 1)..14 -> println("UP")
            mid > before && mid == 15 -> println("DOWN")
            mid in 1 until before -> println("DOWN")
            mid < before && mid == 0 -> println("UP")
        }
    }
}


import java.io.PrintWriter
import java.util.StringTokenizer

fun main() {
    output {
        val n = readInt()

        var ans = ModInt(0)

        var pd = ModInt(1)

        for(i in 0..2*n) {
            ans += pd
            if(i >= n) pd -= C(i, n)
            pd *= 2
        }

        println(ans)
    }
}

private val _factorialMemo = mutableListOf(ModInt(1))

fun Int.factorial() = run {
    while(this > _factorialMemo.lastIndex) {
        _factorialMemo.add(_factorialMemo.last() * _factorialMemo.size)
    }

    _factorialMemo[this]
}

fun P(n: Int, k: Int) = n.factorial() / (n-k).factorial()
fun C(n: Int, k: Int) = n.factorial() / k.factorial() / (n-k).factorial()

const val BILLION7 = 1e9.toInt() + 7
const val MODINT_BASE = BILLION7

infix fun Int.umod(base: Int) =
    (this % base).let { if(it >= 0) it else it + base }

infix fun Long.umod(base: Long) =
    (this % base).let { if(it >= 0) it else it + base }

infix fun Long.umod(base: Int) =
    (this % base).let { if(it >= 0) it else it + base }

fun Int.mulMod(other: Int, mod: Int) = (toLong() * other).umod(mod).toInt()

fun Int.powMod(exponent: Int, mod: Int): Int {
    var res = 1L
    var e = exponent
    var b = umod(mod).toLong()

    while(e > 0) {
        if(e and 1 == 1) {
            res = res * b % mod
        }
        e = e shr 1
        b = b * b % mod
    }
    return res.toInt()
}

inline fun Int.toModInt() = ModInt(this umod MODINT_BASE)
inline fun Long.toModInt() = ModInt((this umod MODINT_BASE).toInt())

/** note: Only use constructor for int within modulo range, otherwise use toModInt **/
inline class ModInt(val int: Int) {
    companion object {
        /** can't seem to make these private or inlined without causing compiler issues */
        @JvmField val _invMemo = HashMap<ModInt, ModInt>()
        fun _invMemoized(m: ModInt) = _invMemo.getOrPut(m) { m.inv_unmemoized() }
    }

    inline operator fun plus(other: ModInt) = plus(other.int) // MODINT_BASE < 2^30
    inline operator fun plus(other: Int) =  (int + other).toModInt() // careful of possible overflow
    inline operator fun inc() = plus(1)

    inline operator fun minus(other: ModInt) = minus(other.int)
    inline operator fun minus(other: Int) = (int - other).toModInt()
    inline operator fun dec() = minus(1)
    operator fun unaryMinus() = if(int == 0) this else ModInt(MODINT_BASE - int)

    inline operator fun times(other: ModInt) = times(other.int)
    inline operator fun times(other: Int) = ModInt(int.mulMod(other, MODINT_BASE))

    fun pow(exponent: Int): ModInt {
        val e = if(exponent < 0) exponent umod MODINT_BASE - 1 else exponent // assumes MODINT_BASE is prime
        return ModInt(int.powMod(e, MODINT_BASE))
    }

    inline fun inverse() = inv_memoized() /** NOTE: Change if necessary */

    fun inv_unmemoized(): ModInt {
        require(int != 0) { "Can't invert/divide by 0" }
        return pow(MODINT_BASE - 2) // assumes MODINT_BASE is prime
    }
    inline fun inv_memoized() = _invMemoized(this)

    operator fun div(other: ModInt) = times(other.inverse())
    inline operator fun div(other: Int) = div(other.toModInt())

    override fun toString() = int.toString()
}

inline class ModIntArray(val intArray: IntArray): Collection<ModInt> {
    inline operator fun get(i: Int) = ModInt(intArray[i])
    inline operator fun set(i: Int, v: ModInt) { intArray[i] = v.int }

    override val size: Int get() = intArray.size
    inline val lastIndex get() = intArray.lastIndex

    override fun contains(element: ModInt): Boolean = any { it == element }

    override fun containsAll(elements: Collection<ModInt>): Boolean = elements.all(::contains)

    override fun isEmpty(): Boolean = intArray.isEmpty()

    override fun iterator(): Iterator<ModInt> = object: Iterator<ModInt> {
        var index = 0
        override fun hasNext(): Boolean = index < size
        override fun next(): ModInt = get(index++)
    }
}
fun ModIntArray(capacity: Int) = ModIntArray(IntArray(capacity))
inline fun ModIntArray(capacity: Int, init: (Int) -> ModInt) =
    ModIntArray(IntArray(capacity) { init(it).int })

fun Iterable<ModInt>.sum() = fold(ModInt(0), ModInt::plus)
fun Sequence<ModInt>.sum() = fold(ModInt(0), ModInt::plus)
fun Iterable<ModInt>.product() = fold(ModInt(1), ModInt::times)
fun Sequence<ModInt>.product() = fold(ModInt(1), ModInt::times)

/** IO code start */
@JvmField val _reader = System.`in`.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }

@JvmField val _writer = PrintWriter(System.out, false)
inline fun output(block: PrintWriter.()->Unit) { _writer.apply(block).flush() }
fun iprintln(o: Any?) { println(o) } // immediate println for interactive, bypasses output{} blocks


import java.io.FileInputStream
import java.math.BigDecimal
import java.util.*
import kotlin.Comparator

object programkt {
  fun S(n0: Long): Long {
    var res = 0L
    var n = n0
    while (n > 0) {
      res += n % 10
      n = n / 10
    }
    return res
  }

  fun solveDumb(n: Long) =
    LongRange(0, n)
      .map { it -> Pair(S(it) + S(n - it), it) }
      .maxWith(
        object : Comparator<Pair<Long, Long>> {
          override fun compare(o1: Pair<Long, Long>, o2: Pair<Long, Long>): Int {
            if (o1.first == o2.first)
              return o1.second.compareTo(o2.second)
            else
              return o1.first.compareTo(o2.first)
          }
        }
      )!!

  fun solve(n: Long): Long {
    if (n < 10)
      return n
    else {
      var n10 = 1L
      while (n10 * 10 <= n) {
        n10 *= 10
      }
      val a = n / n10 * n10 - 1
      val b = n - a
      return S(a) + S(b)
    }
  }

  @JvmStatic fun main(args: Array<String>) {
    if (args.size == 1)
      System.setIn(FileInputStream(args[0]))
    //val sc = Scanner(System.`in`)

    LongRange(0, 100).forEach {
      println("$it " + solveDumb(it))
      assert(solveDumb(it).first == solve(it))
    }

    println(solve(BigDecimal(readLine()).toLong()))
  }
}


fun main(args: Array<String>) {
    val n = readLine()
    val x = "9".repeat(n!!.length - 1)
    val y = (n.toBigInteger() - x.toBigInteger()).toString()
    println(x.map {it -> it.toString().toInt()}.reduce {s, sum -> s + sum}
            + y.map {it -> it.toString().toInt()}.reduce {s, sum -> s + sum})
}


fun nod(a: Long, b: Long): Long =
        if (a % b != 0L) {
            nod(b, a % b)
        } else {
            b
        }

fun main(args: Array<String>) {
    var (a, b, x, y) = readLine()!!.split(" ").map(String::toLong)
    if (a < b) {
        a += b
        b = a - b
        a -= b
    }
    if(x < y) {
        x += y
        y = x - y
        x -= y
    }
    val nodValue = nod(x, y)
    if(nodValue != 1L) {
        x /= nodValue
        y /= nodValue
    }
    println(if (a/x > b/y) b/y else a/x)
}


import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.util.*
import kotlin.math.*
fun main() {
    val fs = CodeForces.FastReader()
    var x = fs.nextInt()
    var y = fs.nextInt()
    var n = fs.nextInt()
    var a:Int=0
    var b:Int=0
    var min:Double = Double.MAX_VALUE
    for (i in 1..n) {
        var l = 0; var p = x
        var value:Double
        while (l <= p) {
            var k = (l+p)/2
            value = abs(x/y.toDouble() - k/i.toDouble())
            if(value < min && min-value > 0.0000000000001){
                min = value.also { a=k;b=i }
            }
            if(value > abs(x/y.toDouble() - (k-1)/i.toDouble())) p = k-1
            else l = k+1
        }
    }
    while (a % 2 == 0 && b % 2 == 0) {
        a /= 2
        b /= 2
    }
    println("$a/$b")
}

class CodeForces {
    internal class FastReader {
        private var br: BufferedReader = BufferedReader(InputStreamReader(System.`in`))
        private var st: StringTokenizer? = null

        operator fun next(): String {
            while (st == null || !st!!.hasMoreElements()) {
                try {
                    st = StringTokenizer(br.readLine())
                } catch (e: IOException) {
                    e.printStackTrace()
                }

            }
            return st!!.nextToken()
        }

        fun nextInt(): Int {
            return Integer.parseInt(next())
        }

        fun nextLong(): Long {
            return java.lang.Long.parseLong(next())
        }

        fun nextDouble(): Double {
            return java.lang.Double.parseDouble(next())
        }

        fun nextLine(): String {
            var str = ""
            try {
                str = br.readLine()
            } catch (e: IOException) {
                e.printStackTrace()
            }
            return str
        }

        fun readIntArray(n: Int): IntArray {
            val a = IntArray(n)
            for (i in 0 until n) a[i] = nextInt()
            return a
        }

        fun readLongArray(n: Int): LongArray {
            val a = LongArray(n)
            for (i in 0 until n) a[i] = nextLong()
            return a
        }

        fun readDoubleArray(n: Int): DoubleArray {
            val a = DoubleArray(n)
            for (i in 0 until n) a[i] = nextDouble()
            return a
        }
    }
}


import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.util.*
import kotlin.math.*

fun main() {
    val fs = CodeForces.FastReader()
    var x = fs.nextInt()
    var y = fs.nextInt()
    var n = fs.nextInt()
    var a:Int=0
    var b:Int=0
    var min:Double = Double.MAX_VALUE
    for (i in 1..n) {
        var last = min
        for (j in x downTo 0) {
            if (min >= abs(x / y.toDouble() - (j / i.toDouble()))) {
                min = abs(x/y.toDouble() - (j/i.toDouble()))
                a=j
                b=i
                if(min < abs(x / y.toDouble() - ((j-1) / i.toDouble()))) break
            }
        }
    }
    while (a % 2 == 0 && b % 2 == 0) {
        a /= 2
        b /= 2
    }
    println("$a/$b")
}

class CodeForces {
    internal class FastReader {
        private var br: BufferedReader = BufferedReader(InputStreamReader(System.`in`))
        private var st: StringTokenizer? = null

        operator fun next(): String {
            while (st == null || !st!!.hasMoreElements()) {
                try {
                    st = StringTokenizer(br.readLine())
                } catch (e: IOException) {
                    e.printStackTrace()
                }

            }
            return st!!.nextToken()
        }

        fun nextInt(): Int {
            return Integer.parseInt(next())
        }

        fun nextLong(): Long {
            return java.lang.Long.parseLong(next())
        }

        fun nextDouble(): Double {
            return java.lang.Double.parseDouble(next())
        }

        fun nextLine(): String {
            var str = ""
            try {
                str = br.readLine()
            } catch (e: IOException) {
                e.printStackTrace()
            }
            return str
        }

        fun readIntArray(n: Int): IntArray {
            val a = IntArray(n)
            for (i in 0 until n) a[i] = nextInt()
            return a
        }

        fun readLongArray(n: Int): LongArray {
            val a = LongArray(n)
            for (i in 0 until n) a[i] = nextLong()
            return a
        }

        fun readDoubleArray(n: Int): DoubleArray {
            val a = DoubleArray(n)
            for (i in 0 until n) a[i] = nextDouble()
            return a
        }
    }
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val R = ni()
    val G = ni()
    var H = 0
    while((H + 1) * (H + 2) / 2 <= R + G) H++
    val N = R
    val dp = Array(H + 1){
      val size = if (it == H) 0
      else H * (H + 1) / 2 - it * (it + 1) / 2
      IntArray(size + 1)
    }
    debug{"N:$N H:$H"}
    dp[H][0] = 1
    for (i in H - 1 downTo 0) {
      for (j in dp[i].indices) {
        if (j < dp[i + 1].size) dp[i][j] += dp[i + 1][j]
        val nj = j - (i + 1)
        if ((dp[i + 1].indices).contains(nj)) {
          dp[i][j] += dp[i + 1][nj]
        }
        if (dp[i][j] > MOD) dp[i][j] -= MOD
      }
      debug(dp[i])
    }
    var ans = 0L
    val remain = R + G - H * (H + 1) / 2
    for (r in 0 .. remain) {
      val j = N - r
      ans += dp[0][j]
    }
    out.println(ans % MOD)
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val R = ni()
    val G = ni()
    var H = 0
    while((H + 1) * (H + 2) / 2 <= R + G) H++
    val N = R
    val dp = Array(H + 1){
      val size = if (it == H) 0
      else H * (H + 1) / 2 - it * (it + 1) / 2
      IntArray(size + 1)
    }
    debug{"N:$N H:$H"}
    dp[H][0] = 1
    for (i in H - 1 downTo 0) {
      for (j in dp[i].indices) {
        if (j < dp[i + 1].size) dp[i][j] += dp[i + 1][j]
        val nj = j - (i + 1)
        if ((dp[i + 1].indices).contains(nj)) {
          dp[i][j] += dp[i + 1][nj]
        }
        if (dp[i][j] > MOD) dp[i][j] -= MOD
      }
      debug(dp[i])
    }
    var ans = 0L
    val remain = R + G - H * (H + 1) / 2
    for (r in 0 .. remain) {
      val j = N - r
      if (dp[0].indices.contains(j)) ans += dp[0][j]
    }
    out.println(ans % MOD)
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val R = ni()
    val G = ni()
    var H = 0
    while((H + 1) * (H + 2) / 2 <= R + G) H++
    val N = min(R, G)
    var cur = IntArray(1_000_000)
    var next = IntArray(1_000_000)
    cur[0] = 1
    var sum = 0L
    for (i in H - 1 downTo 0) {
      val size = min(N, H * (H + 1) / 2 - i * (i + 1) / 2)
      val nsize = min(N, H * (H + 1) / 2 - (i + 1) * (i + 2) / 2)
      for (j in 0 .. size) {
        next[j] = 0
        if (j <= nsize) next[j] += cur[j]
        val nj = j - (i + 1)
        if ((0 .. nsize).contains(nj)) {
          next[j] += cur[nj]
        }
        if (next[j] > MOD) next[j] -= MOD
      }
//      debug(next.take(10).toLongArray())
      val tmp = cur
      cur = next
      next = tmp
      sum += size
    }
    debug{"sum:$sum"}
    var ans = 0L
    val remain = R + G - H * (H + 1) / 2
    for (r in 0 .. remain) {
      val j = N - r
      if (cur.indices.contains(j)) ans += cur[j]
    }
    out.println(ans % MOD)
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}


@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING", "OVERRIDE_BY_INLINE")

import java.io.PrintWriter
import java.util.PriorityQueue
import java.util.SortedMap
import java.util.StringTokenizer
import java.util.TreeMap
import kotlin.math.*
import kotlin.random.*
import kotlin.collections.sort as _sort
import kotlin.collections.sortDescending as _sortDescending
import kotlin.io.println as iprintln

/** @author Spheniscine */
fun main() { _writer.solve(); _writer.flush() }
fun PrintWriter.solve() {
    val r0 = readInt()
    val g0 = readInt()

    var D = HashMap<State, ModInt>()
    D.add(r0, g0, ModInt(1))

    for(h in 1..200000) {
        val Di = HashMap<State, ModInt>()
        for((state, v) in D) {
            var (r, g) = state
            if(r < h) r = 0
            if(g < h) g = 0
            if(r != 0) Di.add(r-h, g, v)
            if(g != 0) Di.add(r, g-h, v)
        }
        if(Di.isEmpty()) break
        D = Di
    }

    val ans = D.values.sum()

    println(ans.int)
}

fun MutableMap<State, ModInt>.add(r: Int, g: Int, v: ModInt) {
    val state = State(r, g)
    this[state] = (this[state] ?: ModInt(0)) + v
}

data class State(val r: Int, val g: Int) {
    val hash = r.bitConcat(g).hash().toInt()
    override fun hashCode(): Int = hash
}

fun splitmix64(seed: Long): Long {
    var x = seed - 7046029254386353131
    x = (x xor (x ushr 30)) * -4658895280553007687
    x = (x xor (x ushr 27)) * -7723592293110705685
    return (x xor (x ushr 31))
}
@JvmField val nonce64 = random.nextLong()
fun Long.hash() = splitmix64(nonce64 xor this)

fun Int.bitConcat(other: Int) = toLong().shl(32) or other.toLong().and(0xffff_ffff)

const val BILLION7 = 1e9.toInt() + 7
const val MODINT_BASE = BILLION7
const val MODINT_TOTIENT = MODINT_BASE - 1 // assumes MODINT_BASE is prime

inline infix fun Int.umod(base: Int) = Math.floorMod(this, base)
inline infix fun Long.umod(base: Long) = Math.floorMod(this, base)
inline infix fun Long.umod(base: Int) = Math.floorMod(this, base.toLong()).toInt()

fun Int.mulMod(other: Int, mod: Int) = (toLong() * other).umod(mod)

fun Int.powMod(exponent: Int, mod: Int): Int {
    if(exponent < 0) error("Inverse not implemented")
    var res = 1L
    var e = exponent
    var b = umod(mod).toLong()

    while(e > 0) {
        if(e and 1 == 1) {
            res = res * b % mod
        }
        e = e shr 1
        b = b * b % mod
    }
    return res.toInt()
}

inline fun Int.toModInt() = ModInt(this umod MODINT_BASE)
inline fun Long.toModInt() = ModInt(this umod MODINT_BASE)

/** note: Only use constructor for int within modulo range, otherwise use toModInt **/
inline class ModInt(val int: Int) {
    companion object {
        /** can't seem to make these private or inlined without causing compiler issues */
        @JvmField val _invMemo = HashMap<ModInt, ModInt>()
        fun _invMemoized(m: ModInt) = _invMemo.getOrPut(m) { m.inv_unmemoized() }
    }

    operator fun plus(other: ModInt) = // MODINT_BASE < 2^30
        (int + other.int).let { if(it >= MODINT_BASE) ModInt(it - MODINT_BASE) else ModInt(it) }
    inline operator fun plus(other: Int) = plus(other.toModInt())
    operator fun inc() = if(int == MODINT_BASE - 1) ModInt(0) else ModInt(int + 1)

    operator fun minus(other: ModInt) =
        (int - other.int).let { if(it < 0) ModInt(it + MODINT_BASE) else ModInt(it) }
    inline operator fun minus(other: Int) = minus(other.toModInt())
    operator fun dec() = if(int == 0) ModInt(MODINT_BASE - 1) else ModInt(int - 1)
    operator fun unaryMinus() = if(int == 0) this else ModInt(MODINT_BASE - int)

    inline operator fun times(other: ModInt) = times(other.int)
    inline operator fun times(other: Int) = ModInt(int.mulMod(other, MODINT_BASE))

    fun pow(exponent: Int): ModInt {
        val e = if(exponent < 0) {
            require(int != 0) { "Can't invert/divide by 0" }
            exponent umod MODINT_TOTIENT
        } else exponent
        return ModInt(int.powMod(e, MODINT_BASE))
    }

    fun pow(exponent: Long) = if(int == 0) when {
        exponent > 0 -> this
        exponent == 0L -> ModInt(1)
        else -> error("Can't invert/divide by 0")
    } else pow(exponent umod MODINT_TOTIENT)

    inline fun inverse() = inv_memoized() /** NOTE: Change if necessary */

    fun inv_unmemoized(): ModInt {
        require(int != 0) { "Can't invert/divide by 0" }
        return pow(MODINT_TOTIENT - 1)
    }
    inline fun inv_memoized() = _invMemoized(this)

    operator fun div(other: ModInt) = times(other.inverse())
    inline operator fun div(other: Int) = div(other.toModInt())

    override inline fun toString() = int.toString()
}

inline class ModIntArray(val intArray: IntArray): Collection<ModInt> {
    inline operator fun get(i: Int) = ModInt(intArray[i])
    inline operator fun set(i: Int, v: ModInt) { intArray[i] = v.int }

    override inline val size: Int get() = intArray.size
    inline val lastIndex get() = intArray.lastIndex
    inline val indices get() = intArray.indices

    override inline fun contains(element: ModInt): Boolean = element.int in intArray

    override fun containsAll(elements: Collection<ModInt>): Boolean = elements.all(::contains)

    override inline fun isEmpty(): Boolean = intArray.isEmpty()

    override fun iterator(): Iterator<ModInt> = object: Iterator<ModInt> {
        var index = 0
        override fun hasNext(): Boolean = index < size
        override fun next(): ModInt = get(index++)
    }

    fun sum() = indices.sumByModInt(::get)
    fun product() = indices.productByModInt(::get)

    fun copyOf(newSize: Int) = ModIntArray(intArray.copyOf(newSize))
    fun copyOf() = copyOf(size)
}
fun ModIntArray(capacity: Int) = ModIntArray(IntArray(capacity))
inline fun ModIntArray(capacity: Int, init: (Int) -> ModInt) =
    ModIntArray(IntArray(capacity) { init(it).int })

inline fun <T> Iterable<T>.sumByModInt(func: (T) -> ModInt) = fold(ModInt(0)) { acc, t -> acc + func(t) }
inline fun <T> Iterable<T>.productByModInt(func: (T) -> ModInt) = fold(ModInt(1)) { acc, t -> acc * func(t) }
inline fun <T> Sequence<T>.sumByModInt(func: (T) -> ModInt) = fold(ModInt(0)) { acc, t -> acc + func(t) }
inline fun <T> Sequence<T>.productByModInt(func: (T) -> ModInt) = fold(ModInt(1)) { acc, t -> acc * func(t) }
fun Iterable<ModInt>.sum() = sumByModInt { it }
fun Sequence<ModInt>.sum() = sumByModInt { it }
fun Iterable<ModInt>.product() = productByModInt { it }
fun Sequence<ModInt>.product() = productByModInt { it }

/** IO code start */
//@JvmField val INPUT = File("input.txt").inputStream()
//@JvmField val OUTPUT = File("output.txt").outputStream()
@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

@JvmField val _reader = INPUT.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readLines(n: Int) = List(n) { readLn() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }

@JvmField val _writer = PrintWriter(OUTPUT, false)

/** shuffles and sort overrides to avoid quicksort attacks */
private inline fun <T> _shuffle(rnd: Random, get: (Int) -> T, set: (Int, T) -> Unit, size: Int) {
    // Fisher-Yates shuffle algorithm
    for (i in size - 1 downTo 1) {
        val j = rnd.nextInt(i + 1)
        val temp = get(i)
        set(i, get(j))
        set(j, temp)
    }
}

@JvmField var _random: Random? = null
val random get() = _random ?: Random(0x594E215C123 * System.nanoTime()).also { _random = it }

fun IntArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun IntArray.sort() { shuffle(); _sort() }
fun IntArray.sortDescending() { shuffle(); _sortDescending() }

fun LongArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun LongArray.sort() { shuffle(); _sort() }
fun LongArray.sortDescending() { shuffle(); _sortDescending() }

fun DoubleArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun DoubleArray.sort() { shuffle(); _sort() }
fun DoubleArray.sortDescending() { shuffle(); _sortDescending() }

fun CharArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
inline fun CharArray.sort() { _sort() }
inline fun CharArray.sortDescending() { _sortDescending() }

inline fun <T: Comparable<T>> Array<out T>.sort() = _sort()
inline fun <T: Comparable<T>> Array<out T>.sortDescending() = _sortDescending()
inline fun <T: Comparable<T>> MutableList<out T>.sort() = _sort()
inline fun <T: Comparable<T>> MutableList<out T>.sortDescending() = _sortDescending()

fun `please stop removing these imports IntelliJ`() {
    iprintln(max(1, 2))
}


import kotlin.math.abs

fun main() {
    val r = System.`in`.bufferedReader()
    //val s = StringBuilder()
    //val n = r.readLine()!!.toInt()
    //val l = r.readLine()!!.split(" ").map { it.toInt() }
    //val n = r.readLine()!!.toInt()
    val (a, b, s) = r.readLine()!!.split(" ").map { it.toLong() }.sorted()
    println(if ((s-a-b)%2==0L && s>= abs(a)+ abs(b)) "Yes" else "No")
}


import kotlin.math.abs

fun main() {
    var (a, b, s) = readLine()!!.split(" ").map { it.toInt() }
    if (abs(a) + abs(b) < s) {
        println("NO")
    } else {
        println("YES")
    }
}


import java.util.*

fun main(args: Array<String>) {
    val s = Scanner(System.`in`)
    val a = IntArray(2, { s.nextInt() }).sum()
    val b = s.nextInt()
    val res = when {
        a == b || (a < b && (b - a).rem(2) == 0) -> "Yes"
        else -> "No"
    }
    print(res)
}


fun main() {
    fun readLongs() = readLine()!!.split(" ").map(String::toLong)

    val (a, b, s) = readLongs()
    print(if (s >= a + b && (s - a - b) % 2 == 0L) "Yes" else "No")
}