Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states: XX   XX   .X   X.X.   .X   XX   XX Bishwocks don't attack any squares and can even occupy on the adjacent squares as long as they don't occupy the same square. Vasya has a board with $$$2\times n$$$ squares onto which he wants to put some bishwocks. To his dismay, several squares on this board are already occupied by pawns and Vasya can't put bishwocks there. However, pawns also don't attack bishwocks and they can occupy adjacent squares peacefully.Knowing the positions of pawns on the board, help Vasya to determine the maximum amount of bishwocks he can put onto the board so that they wouldn't occupy the same squares and wouldn't occupy squares with pawns.

The input contains two nonempty strings that describe Vasya's board. Those strings contain only symbols "0" (zero) that denote the empty squares and symbols "X" (uppercase English letter) that denote the squares occupied by pawns. Strings are nonempty and are of the same length that does not exceed $$$100$$$.

Output a single integer — the maximum amount of bishwocks that can be placed onto the given board.

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.*
fun main(args: Array<String>) {

    val scanner = Scanner(System.`in`)
    val Q = Array<CharArray>(2) { scanner.next().toCharArray() }
    var res = 0
    for (i in 0..Q[0].size - 2) {
        if (Q[0][i] == '0' && Q[1][i] == '0' && Q[0][i + 1] == '0') {
            Q[0][i] = 'X'
            Q[1][i] = 'X'
            Q[0][i + 1] = 'X'
            res++
        }
        if (Q[0][i] == '0' && Q[1][i] == '0' && Q[1][i + 1] == '0') {
            Q[0][i] = 'X'
            Q[1][i] = 'X'
            Q[1][i + 1] = 'X'
            res++
        }
        if (Q[0][i] == '0' && Q[0][i + 1] == '0' && Q[1][i + 1] == '0') {
            Q[0][i] = 'X'
            Q[0][i + 1] = 'X'
            Q[1][i + 1] = 'X'
            res++
        }
        if (Q[1][i] == '0' && Q[1][i + 1] == '0' && Q[0][i + 1] == '0') {
            Q[1][i] = 'X'
            Q[1][i + 1] = 'X'
            Q[0][i + 1] = 'X'
            res++
        }
    }
    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))
}

//class Pair(var a: Int, var b: Int): Comparable<Pair> {
//    override fun compareTo(other: Pair): Int {
//        return b - a - other.b + other.a
//    }
//}

//package codeForces.c491_2

fun main(args: Array<String>) {
    val s1 = (readLine()!! + 'X').toCharArray()
    val s2 = (readLine()!! + 'X').toCharArray()

    val lenght = minOf(s1.size, s2.size)

    var count = 0
    var i = -1
    while (i < lenght - 1) {
        i++
        if (s1[i] == '0' && s2[i] == '0') {
            if (s1[i + 1] == '0') {
                s1[i + 1] = 'X'
                count++
                continue
            } else if (s2[i + 1] == '0') {
                s2[i + 1] = 'X'
                count++
                continue
            }
        }

        if (
                (s1[i] == '0' || s2[i] == '0') &&
                s1[i + 1] == '0' &&
                s2[i + 1] == '0'
        ) {
            count++
            i++
            continue
        }
    }

    print(count)
}

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.*
fun main(args: Array<String>) {

    val scanner = Scanner(System.`in`)
    val Q = Array<String>(2) { "X" + scanner.next() + "X" }
    var last = 0
    var res = 0
    for (i in 0 until Q[0].length) {
        if (Q[0][i] == 'X' && Q[1][i] == 'X') {
            if ((i - last) % 3 == 0)
                res += ((i - last) / 3) * 2
            else if ((i - last) % 3== 2)
                res += ((i - last) / 3) * 2 + 1
            else
                res += ((i - last) / 3) * 2
            last = i + 1
        }
        else if (Q[0][i] == 'X' || Q[1][i] == 'X') {
            if ((i - last) % 3 == 0)
                res += ((i - last) / 3) * 2
            else if ((last - i) % 3 == 2)
                res += ((i - last) / 3) * 2 + 1
            else
                res += (((i - last) / 3) * 2) + 1
            last = i + 1
        }
        else if (Q[0][i] == '0' && Q[1][i] == '0' && ((Q[0][i - 1] == 'X' && Q[1][i - 1] != 'X') || (Q[1][i - 1] == 'X' && Q[0][i - 1] != 'X'))) {
            res++
            last = i + 1
        }
    }
    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))
}

//class Pair(var a: Int, var b: Int): Comparable<Pair> {
//    override fun compareTo(other: Pair): Int {
//        return b - a - other.b + other.a
//    }
//}


Two players play a simple game. Each player is provided with a box with balls. First player's box contains exactly n1 balls and second player's box contains exactly n2 balls. In one move first player can take from 1 to k1 balls from his box and throw them away. Similarly, the second player can take from 1 to k2 balls from his box in his move. Players alternate turns and the first player starts the game. The one who can't make a move loses. Your task is to determine who wins if both players play optimally.

The first line contains four integers n1, n2, k1, k2. All numbers in the input are from 1 to 50. This problem doesn't have subproblems. You will get 3 points for the correct submission.

Output "First" if the first player wins and "Second" otherwise.

NoteConsider the first sample test. Each player has a box with 2 balls. The first player draws a single ball from his box in one move and the second player can either take 1 or 2 balls from his box in one move. No matter how the first player acts, the second player can always win if he plays wisely.

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

class ProblemIO(val rd: BufferedReader, val wr: PrintWriter) {
    companion object {
        fun console() = ProblemIO(BufferedReader(InputStreamReader(System.`in`)), PrintWriter(System.out))
    }

    var tok = StringTokenizer("")

    fun close() { rd.close(); wr.close() }
    fun <T> print(v: T) = wr.print(v)
    fun <T> println(v: T) = wr.println(v)
    fun readToken(): String {
        while (!tok.hasMoreTokens()) tok = StringTokenizer(rd.readLine())
        return tok.nextToken()
    }
    fun readInt() = readToken().toInt()
    fun readLong() = readToken().toLong()
    fun readLine() : String {
        tok = StringTokenizer("")
        return rd.readLine()
    }
}

fun main(args: Array<String>) {
    Thread({ val io = ProblemIO.console(); solve(io) ; io.close() }).start()
}

fun solve(io: ProblemIO) {
    val n = IntArray(2, { io.readInt() })
    val k = IntArray(2, { io.readInt() })
    val res = when {
        n[0] <= n[1] -> "Second"
        else -> "First"
    }
    io.println(res)
}

fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    //val n = r.readLine()!!.toInt()
    //var (n, m) = r.readLine()!!.split(" ").map { it.toInt() }
    val v = r.readLine()!!.split(" ").map { it.toInt() }
    println(if (v[0]-v[1]>0) "First" else "Second")
}

import java.util.Scanner

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    println(if (sc.nextInt() > sc.nextInt()) "First" else "Second")
}

import javafx.util.Pair

import java.util.ArrayList
import java.util.Scanner

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n1 = scanner.nextInt()
    val n2 = scanner.nextInt()
    println(if (n1 > n2) "First" else "Second")

}

import java.util.*

fun main(args: Array<String>) {
    var scan = Scanner(System.`in`)
    var p1 = scan.nextInt()
    var p2 = scan.nextInt()
    if (p1 > p2) {
        println("First")
    } else {
        println("Second")
    }
}

import kotlin.math.abs

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

fun main(args: Array<String>) {
    var (n, m, k, l) = readInts()
    if (n > m) print("First") else print("Second")
}

import org.omg.PortableInterceptor.INACTIVE
import java.util.*

fun main(args: Array<String>) {
    val s = Scanner(System.`in`)
    val a = IntArray(2, { s.nextInt() })
    val b = IntArray(2, { s.nextInt() })
    val res = when {a[0] > a[1] -> "First" else -> "Second"}
    print(res)
}

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

    val (n1, n2, k1, k2) = readInts()
    print(if (n1 > n2) "First" else "Second")
}

fun main(args: Array<String>) {
    val (f,s) = readLine()!!.split(" ").map { it.toInt() }
    println(if (f > s) "First" else "Second")
}


JATC and his friend Giraffe are currently in their room, solving some problems. Giraffe has written on the board an array $$$a_1$$$, $$$a_2$$$, ..., $$$a_n$$$ of integers, such that $$$1 \le a_1 < a_2 < \ldots < a_n \le 10^3$$$, and then went to the bathroom.JATC decided to prank his friend by erasing some consecutive elements in the array. Since he doesn't want for the prank to go too far, he will only erase in a way, such that Giraffe can still restore the array using the information from the remaining elements. Because Giraffe has created the array, he's also aware that it's an increasing array and all the elements are integers in the range $$$[1, 10^3]$$$.JATC wonders what is the greatest number of elements he can erase?

The first line of the input contains a single integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of elements in the array. The second line of the input contains $$$n$$$ integers $$$a_i$$$ ($$$1 \le a_1<a_2<\dots<a_n \le 10^3$$$) — the array written by Giraffe.

Print a single integer — the maximum number of consecutive elements in the array that JATC can erase. If it is impossible to erase even a single element, print $$$0$$$.

NoteIn the first example, JATC can erase the third and fourth elements, leaving the array $$$[1, 3, \_, \_, 6, 9]$$$. As you can see, there is only one way to fill in the blanks.In the second example, JATC can erase the second and the third elements. The array will become $$$[998, \_, \_]$$$. Because all the elements are less than or equal to $$$1000$$$, the array is still can be restored. Note, that he can't erase the first $$$2$$$ elements.In the third example, JATC can erase the first $$$4$$$ elements. Since all the elements are greater than or equal to $$$1$$$, Giraffe can still restore the array. Note, that he can't erase the last $$$4$$$ elements.

import kotlin.math.max

fun main() {
    readLine()
    val array = mutableListOf(0)
    array.addAll(readLine()!!.split(" ").map(String::toInt))
    array.add(1001)
    var sol = 0
    var current = 0
    for (elementPos in 1 until array.size - 1) {
        if (array[elementPos - 1] + 1 == array[elementPos] &&
            array[elementPos] + 1 == array[elementPos + 1]
        )
            current++
        else
            current = 0
        sol = max(sol, current)
    }
    print(sol)
}


Vitya has just started learning Berlanese language. It is known that Berlanese uses the Latin alphabet. Vowel letters are "a", "o", "u", "i", and "e". Other letters are consonant.In Berlanese, there has to be a vowel after every consonant, but there can be any letter after any vowel. The only exception is a consonant "n"; after this letter, there can be any letter (not only a vowel) or there can be no letter at all. For example, the words "harakiri", "yupie", "man", and "nbo" are Berlanese while the words "horse", "king", "my", and "nz" are not.Help Vitya find out if a word $$$s$$$ is Berlanese.

The first line of the input contains the string $$$s$$$ consisting of $$$|s|$$$ ($$$1\leq |s|\leq 100$$$) lowercase Latin letters.

Print "YES" (without quotes) if there is a vowel after every consonant except "n", otherwise print "NO". You can print each letter in any case (upper or lower).

NoteIn the first and second samples, a vowel goes after each consonant except "n", so the word is Berlanese.In the third sample, the consonant "c" goes after the consonant "r", and the consonant "s" stands on the end, so the word is not Berlanese.

fun isVowel(c: Char): Boolean {
    return c in "aeiou"
}

fun main(args: Array<String>) {

    val s = readLine()!!
    val good: Boolean = (0..s.length - 1).none {
        !isVowel(s[it]) &&
                s[it] != 'n' &&
                ((it + 1 < s.length &&
                        !isVowel(s[it + 1]) || it + 1 == s.length))
    }

    if (good) {
        println("YES")
    } else {
        println("NO")
    }
}

import java.io.*
import java.util.*
import kotlin.collections.ArrayList
import kotlin.collections.HashSet
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
fun main(args : Array<String>) {
    Thread { run() }.start()
}

fun run() {

    val scanner = Scanner(System.`in`)
    val str = scanner.next()
    for (i in 1 until str.length) {
        if (!(str[i] in charArrayOf('a', 'o', 'u', 'i', 'e')) && !(str[i - 1] in charArrayOf('a', 'o', 'u', 'i', 'e', 'n'))) {
            println("NO")
            return
        }
    }
    if (str.last() in charArrayOf('a', 'o', 'u', 'i', 'e', 'n'))
        println("YES")
    else
        println("NO")

}

class Parser(`in`: InputStream) {
    private val BUFFER_SIZE = 1 shl 16
    private val din: DataInputStream
    private val buffer: ByteArray
    private var bufferPointer: Int = 0
    private var bytesRead: Int = 0

    init {
        din = DataInputStream(`in`)
        buffer = ByteArray(BUFFER_SIZE)
        bytesRead = 0
        bufferPointer = bytesRead
    }

    fun nextString(maxSize: Int): String {
        val ch = ByteArray(maxSize)
        var point = 0
        try {
            var c = read()
            while (c == ' '.toByte() || c == '\n'.toByte() || c == '\r'.toByte())
                c = read()
            while (c != ' '.toByte() && c != '\n'.toByte() && c != '\r'.toByte()) {
                ch[point++] = c
                c = read()
            }
        } catch (e: Exception) {}

        return String(ch, 0, point)
    }

    fun nextInt(): Int {
        var ret = 0
        val neg: Boolean
        try {
            var c = read()
            while (c <= ' '.toByte())
                c = read()
            neg = c == '-'.toByte()
            if (neg)
                c = read()
            do {
                ret = ret * 10 + c - '0'.toInt()
                c = read()
            } while (c > ' '.toByte())

            if (neg) return -ret
        } catch (e: Exception) {}
        return ret
    }

    fun nextLong(): Long {
        var ret: Long = 0
        val neg: Boolean
        try {
            var c = read()
            while (c <= ' '.toByte())
                c = read()
            neg = c == '-'.toByte()
            if (neg)
                c = read()
            do {
                ret = ret * 10 + c - '0'.toLong()
                c = read()
            } while (c > ' '.toByte())

            if (neg) return -ret
        } catch (e: Exception) {}

        return ret
    }

    fun nextDouble(): Double
            = nextString(10000).toDouble()

    private fun fillBuffer() {
        try {
            bytesRead = din.read(buffer, 0, BUFFER_SIZE)
        } catch (e: Exception) {}
        if (bytesRead == -1) buffer[0] = -1
    }

    private fun read(): Byte {
        if (bufferPointer == bytesRead) fillBuffer()
        return buffer[bufferPointer++]
    }
}
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))
}
fun nod(a: Long, b: Long): Long {
    var a1 = a
    var b1 = b
    while (a1 != 0L && b1 != 0L) {
        if (a1 < b1)
            b1 %= a1
        else
            a1 %= b1
    }
    return a1 + b1
}
fun nok(a: Long, b: Long): Long = a * b / nod(a, b)
fun min(a: Char, b: Char): Int {
    if (a < b)
        return a.toInt()
    return b.toInt()
}
fun max(a: Char, b: Char): Int {
    if (a > b)
        return a.toInt()
    return b.toInt()
}

import javax.print.attribute.IntegerSyntax
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

fun readLn() = readLine()!!
fun readInt() = readLn().toInt()
fun readDouble() = readLn().toDouble()
fun readLong() = readLn().toLong()
fun readStrings() = readLn().split(' ')
fun readInts() = readStrings().map { it.toInt() }
fun readDoubles() = readStrings().map { it.toDouble() }
fun readLongs() = readStrings().map { it.toLong() }

fun isDiverse(s: String): Boolean {
    val sortedSet = s.toSortedSet()
    return sortedSet.size == s.length &&
            sortedSet.last().toInt() - sortedSet.first().toInt() + 1 == sortedSet.size
}

fun fine(s: String): Boolean {
    val vowels = "aeiou"
    val vowelsAndN = "aeioun"

    if(s[s.length-1] !in vowelsAndN) return false

    for (i in 1 until s.length) {
        if (s[i - 1] !in vowelsAndN && s[i] !in vowels) return false
    }

    return true
}

fun main(args: Array<String>) {
    val s = readLn()

    println(if (fine(s)) "YES" else "NO")
}

fun main(args: Array<String>) {
  val str1 = readLine()!!
  val exc = setOf("a", "o", "u", "i", "e")
  var prev = ""

  for (it in str1.split("")) {
    if (prev.isEmpty() || exc.contains(prev) || prev == "n") {
      prev = it
      continue
    }

    if (!exc.contains(it)) {
      println("NO")
      return
    }

    prev = it
  }

  println("YES")
}

fun main() {
    val vowel = listOf<Char>('a', 'o', 'u', 'i', 'e')
    val str = readLine()!!
    var ans = mutableListOf<Int>()
    for (i in str) {
        if (vowel.contains(i)) {
            ans.add(1)
        } else if (i == 'n') {
            ans.add(2)
        } else {
            ans.add(0)
        }
    }
    for (i in 1 until ans.size) {
        if (ans[i] == 0) {
            if (ans[i - 1] != 1 && ans[i - 1] != 2) {
                println("NO")
                return
            }
        } else if (ans[i] == 1) {
            if (ans[i - 1] != 1 && ans[i - 1] != 2 && ans[i - 1] != 0) {
                println("NO")
                return
            }
        } else {
            if (ans[i - 1] == 0) {
                println("NO")
                return
            }
        }
    }

    if (ans[ans.size - 1] != 1 && ans[ans.size - 1] != 2) {
        println("NO")
    } else {
        println("YES")
    }

}

fun main() {
    val s = readLine()!!
    val notConsonant = setOf('a', 'e', 'i', 'o', 'u', 'n')
    val vowel = setOf('a', 'e', 'i', 'o', 'u')
    for ((pos, c) in s.withIndex()) {
        if (c !in notConsonant && pos == s.lastIndex) return print("NO")
        if (c !in notConsonant && s[pos + 1] !in vowel) return print("NO")
    }
    print("YES")
}

import java.util.*
import kotlin.collections.HashSet

public class programkt {

    public companion object {

        private val vowels = HashSet(arrayListOf('a', 'e', 'i', 'o', 'u'))
        private val noRestrictions = HashSet(arrayListOf('a', 'e', 'i', 'o', 'u', 'n'))

        private fun isCorrect(str: String): Boolean {
            str.forEachIndexed() { ind, c ->
                if (!noRestrictions.contains(c)) {
                    if (ind == str.length - 1) return false
                    else if (!vowels.contains(str[ind + 1])) return false
                }
            }

            return true
        }

        @JvmStatic
        public fun main(args: Array<String>) {
            val scan = Scanner(System.`in`)

            val str = scan.nextLine().trim()

            println(if (isCorrect(str)) "YES" else "NO")
        }
    }
}

import java.util.*
import kotlin.collections.HashSet

class ProgramKT {

    companion object {

        private val vowels = HashSet(arrayListOf('a', 'e', 'i', 'o', 'u'))
        private val noRestrictions = HashSet(arrayListOf('a', 'e', 'i', 'o', 'u', 'n'))

        private fun isCorrect(str: String): Boolean {
            str.forEachIndexed() { ind, c ->
                if (!noRestrictions.contains(c)) {
                    if (ind == str.length - 1) return false
                    else if (!vowels.contains(str[ind + 1])) return false
                }
            }

            return true
        }

        @JvmStatic
        fun main(args: Array<String>) {
            val scan = Scanner(System.`in`)

            val str = scan.nextLine().trim()

            println(if (isCorrect(str)) "YES" else "NO")
        }
    }
}

fun main(arg: Array<String>){
	val string = readLine().toString()
	var univ = setOf('a','e','i','o','u','n')
	var glas = setOf('a','e','i','o','u')
	if (string.last() in univ){
		var prev = 'a'
		string.forEach(){
//			println(it)
			if (!(prev in univ) and !(it in glas)){
					println("NO")
					return
			}
			prev = it
		}
		println("YES")
	}else{
		println("NO")
		return
	}
}

fun isVowel(c: Char): Boolean {
    return c in "aeiou"
}

fun main(args: Array<String>) {

    val s = readLine()!!
    val good: Boolean = (0..s.length - 1).none { !isVowel(s[it]) && s[it] != 'n' && it + 1 < s.length && !isVowel(s[it + 1]) }

    if (good) {
        println("YES")
    } else {
        println("NO")
    }
}

import java.io.*
import java.util.*
import kotlin.collections.ArrayList
import kotlin.collections.HashSet
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
fun main(args : Array<String>) {
    Thread { run() }.start()
}

fun run() {

    val scanner = Scanner(System.`in`)
    val str = scanner.next()
    for (i in 1 until str.length) {
        if (!(str[i] in charArrayOf('a', 'o', 'u', 'i', 'e', 'n')) && !(str[i - 1] in charArrayOf('a', 'o', 'u', 'i', 'e', 'n'))) {
            println("NO")
            return
        }
    }
    println("YES")

}

class Parser(`in`: InputStream) {
    private val BUFFER_SIZE = 1 shl 16
    private val din: DataInputStream
    private val buffer: ByteArray
    private var bufferPointer: Int = 0
    private var bytesRead: Int = 0

    init {
        din = DataInputStream(`in`)
        buffer = ByteArray(BUFFER_SIZE)
        bytesRead = 0
        bufferPointer = bytesRead
    }

    fun nextString(maxSize: Int): String {
        val ch = ByteArray(maxSize)
        var point = 0
        try {
            var c = read()
            while (c == ' '.toByte() || c == '\n'.toByte() || c == '\r'.toByte())
                c = read()
            while (c != ' '.toByte() && c != '\n'.toByte() && c != '\r'.toByte()) {
                ch[point++] = c
                c = read()
            }
        } catch (e: Exception) {}

        return String(ch, 0, point)
    }

    fun nextInt(): Int {
        var ret = 0
        val neg: Boolean
        try {
            var c = read()
            while (c <= ' '.toByte())
                c = read()
            neg = c == '-'.toByte()
            if (neg)
                c = read()
            do {
                ret = ret * 10 + c - '0'.toInt()
                c = read()
            } while (c > ' '.toByte())

            if (neg) return -ret
        } catch (e: Exception) {}
        return ret
    }

    fun nextLong(): Long {
        var ret: Long = 0
        val neg: Boolean
        try {
            var c = read()
            while (c <= ' '.toByte())
                c = read()
            neg = c == '-'.toByte()
            if (neg)
                c = read()
            do {
                ret = ret * 10 + c - '0'.toLong()
                c = read()
            } while (c > ' '.toByte())

            if (neg) return -ret
        } catch (e: Exception) {}

        return ret
    }

    fun nextDouble(): Double
            = nextString(10000).toDouble()

    private fun fillBuffer() {
        try {
            bytesRead = din.read(buffer, 0, BUFFER_SIZE)
        } catch (e: Exception) {}
        if (bytesRead == -1) buffer[0] = -1
    }

    private fun read(): Byte {
        if (bufferPointer == bytesRead) fillBuffer()
        return buffer[bufferPointer++]
    }
}
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))
}
fun nod(a: Long, b: Long): Long {
    var a1 = a
    var b1 = b
    while (a1 != 0L && b1 != 0L) {
        if (a1 < b1)
            b1 %= a1
        else
            a1 %= b1
    }
    return a1 + b1
}
fun nok(a: Long, b: Long): Long = a * b / nod(a, b)
fun min(a: Char, b: Char): Int {
    if (a < b)
        return a.toInt()
    return b.toInt()
}
fun max(a: Char, b: Char): Int {
    if (a > b)
        return a.toInt()
    return b.toInt()
}

import javax.print.attribute.IntegerSyntax
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

fun readLn() = readLine()!!
fun readInt() = readLn().toInt()
fun readDouble() = readLn().toDouble()
fun readLong() = readLn().toLong()
fun readStrings() = readLn().split(' ')
fun readInts() = readStrings().map { it.toInt() }
fun readDoubles() = readStrings().map { it.toDouble() }
fun readLongs() = readStrings().map { it.toLong() }

fun isDiverse(s: String): Boolean {
    val sortedSet = s.toSortedSet()
    return sortedSet.size == s.length &&
            sortedSet.last().toInt() - sortedSet.first().toInt() + 1 == sortedSet.size
}

fun fine(s: String): Boolean {
    val vowels = "aeiou"
    val vowelsAndN = "aeioun"

    if(s.length == 1 && s !in vowelsAndN) return false

    for (i in 1 until s.length) {
        if (s[i - 1] !in vowelsAndN && s[i] !in vowels) return false
    }

    return true
}

fun main(args: Array<String>) {
    val s = readLn()

    println(if (fine(s)) "YES" else "NO")
}

import javax.print.attribute.IntegerSyntax
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

fun readLn() = readLine()!!
fun readInt() = readLn().toInt()
fun readDouble() = readLn().toDouble()
fun readLong() = readLn().toLong()
fun readStrings() = readLn().split(' ')
fun readInts() = readStrings().map { it.toInt() }
fun readDoubles() = readStrings().map { it.toDouble() }
fun readLongs() = readStrings().map { it.toLong() }

fun isDiverse(s: String): Boolean {
    val sortedSet = s.toSortedSet()
    return sortedSet.size == s.length &&
            sortedSet.last().toInt() - sortedSet.first().toInt() + 1 == sortedSet.size
}

fun fine(s: String): Boolean {
    val vowels = "aeiou"
    val vowelsAndN = "aeioun"

    for (i in 1 until s.length) {
        if (s[i - 1] !in vowelsAndN && s[i] !in vowels) return false
    }

    return true
}

fun main(args: Array<String>) {
    val s = readLn()

    println(if (fine(s)) "YES" else "NO")
}

fun main(args: Array<String>) {
  val str1 = readLine()!!
  val exc = setOf("a", "o", "u", "i", "e", "n")
  var prev = ""

  for (it in str1.split("")) {
    if (prev.isEmpty() || exc.contains(prev)) {
      prev = it
      continue
    }

    if (!exc.contains(it)) {
      println("NO")
      return
    }

    prev = it
  }

  println("YES")
}

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

fun main() {
    var sc = Scanner(System.`in`)
    var str = sc.next()

    var list = listOf<Char>('a', 'u', 'e', 'o', 'i')

    var array = Array(str.length+2,{true})
    var i = 0
    while (i<str.length){
        if (!list.contains(str[i]) && str[i]!='n'){
            array[i] = false
        }
        i++
    }
    var j = 0
    var flag = false
    while (j<array.size-1){
        if (array[j]==false && array[j+1]==false){
            flag = true
        }
        j++
    }

    if (!array[array.size-1]){
        flag = true
    }

    if (flag){
        println("NO")
    }else{
        println("YES")
    }
}

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

fun main() {
    var sc = Scanner(System.`in`)
    var str = sc.next() + "e"

    var list = listOf<Char>('a', 'u', 'e', 'o', 'i')

    var array = Array(str.length + 2, { true })
    var i = 0
    while (i < str.length) {
        if (!list.contains(str[i]) && str[i] != 'n') {
            array[i] = false
        }
        i++
    }
    var flag = false
    if (str.length == 2 && !list.contains(str[0]) && str[0]!='n') {
        flag = true
    } else {
        var j = 0
        while (j < array.size - 1) {
            if (array[j] == false && array[j + 1] == false) {
                flag = true
            }
            if (array[j] == false && str[j + 1] == 'n') {
                flag = true
            }
            j++
        }
    }
    if (!array[array.size - 3]) {
        flag = true
    }
    if (flag) {
        println("NO")
    } else {
        println("YES")
    }
}

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

fun main() {
    var sc = Scanner(System.`in`)
    var str = sc.next() + "e"

    var list = listOf<Char>('a', 'u', 'e', 'o', 'i')

    var array = Array(str.length + 2, { true })
    var i = 0
    while (i < str.length) {
        if (!list.contains(str[i]) && str[i] != 'n') {
            array[i] = false
        }
        i++
    }
    var j = 0
    var flag = false
    while (j < array.size - 1) {
        if (array[j] == false && array[j + 1] == false) {
            flag = true
        }
        if (array[j] == false && str[j + 1] == 'n') {
            flag = true
        }
        j++
    }
    if (!array[array.size - 3]) {
        flag = true
    }
    if (flag) {
        println("NO")
    } else {
        println("YES")
    }
}

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

fun main() {
    var sc = Scanner(System.`in`)
    var str = sc.next() + "e"

    var list = listOf<Char>('a', 'u', 'e', 'o', 'i')

    var array = Array(str.length + 2, { true })
    var i = 0
    while (i < str.length) {
        if (!list.contains(str[i]) && str[i] != 'n') {
            array[i] = false
        }
        i++
    }
    var flag = false
    if (str.length == 2 && !list.contains(str[0]) && str[0]!='n') {
        flag = true
    } else {
        var j = 0
        while (j < array.size - 1) {
            if (array[j] == false && array[j + 1] == false) {
                flag = true
            }
            if (array[j] == false && str[j + 1] == 'n') {
                flag = true
            }
            j++
        }
    }
    if (!array[array.size - 3]) {
        flag = true
    }
    if (!list.contains(str[str.length-2]) && str[str.length-1]!='n'){
        flag = true
    }
    if (flag) {
        println("NO")
    } else {
        println("YES")
    }
}

fun main() {
    val s = readLine()!!
    val notConsonant = setOf('a', 'e', 'i', 'o', 'u', 'n')
    for ((pos, c) in s.withIndex()) {
        if (c !in notConsonant && pos == s.lastIndex) return print("NO")
        if (c !in notConsonant && s[pos + 1] !in notConsonant) return print("NO")
    }
    print("YES")
}

fun main(arg: Array<String>){
	val string = readLine().toString()
	var univ = setOf('a','e','i','o','u','n')
	var glas = setOf('a','e','i','o','u')
	if (string.last() in univ){
		var prev = 'a'
		string.forEach(){
			println(it)
			if (!(prev in univ) and !(it in glas)){
					println("NO")
					return
			}
			prev = it
		}
		println("YES")
	}else{
		println("NO")
		return
	}
}

fun main(arg: Array<String>){
	val string = readLine().toString()
	var glas = setOf('a','e','i','o','u','n')
	if (string.last() in glas){
		var prev = 'a'
		string.reversed().forEach(){
			if (!(prev in glas)){
				if (!(it in glas)){
					println("NO")
					return
				}
			}
			prev = it
		}
		println("YES")
	}else{
		println("NO")
		return
	}
}

fun main(arg: Array<String>){
	val string = readLine().toString()
	var univ = setOf('a','e','i','o','u','n')
	var glas = setOf('a','e','i','o','u')
	if (string.last() in glas){
		var prev = 'a'
		string.forEach(){
//			println(it)
			if (!(prev in univ) and !(it in glas)){
					println("NO")
					return
			}
			prev = it
		}
		println("YES")
	}else{
		println("NO")
		return
	}
}


InputThe input consists of a single string of uppercase letters A-Z. The length of the string is between 1 and 10 characters, inclusive.OutputOutput "YES" or "NO".ExamplesInput
GENIUS
Output
YES
Input
DOCTOR
Output
NO
Input
IRENE
Output
YES
Input
MARY
Output
NO
Input
SMARTPHONE
Output
NO
Input
REVOLVER
Output
YES
Input
HOLMES
Output
NO
Input
WATSON
Output
YES

GENIUS DOCTOR IRENE MARY SMARTPHONE REVOLVER HOLMES WATSON

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

import java.io.PrintWriter
import java.util.Arrays
import kotlin.math.*
import kotlin.random.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 el = "Ac Ag Al Am Ar As At Au B Ba Be Bh Bi Bk Br C Ca Cd Ce Cf Cl Cm Cn Co Cr Cs Cu Db Ds Dy Er Es Eu F Fe Fl Fm Fr Ga Gd Ge H He Hf Hg Ho Hs I In Ir K Kr La Li Lr Lu Lv Mc Md Mg Mn Mo Mt N Na Nb Nd Ne Nh Ni No Np O Og Os P Pa Pb Pd Pm Po Pr Pt Pu Ra Rb Re Rf Rg Rh Rn Ru S Sb Sc Se Sg Si Sm Sn Sr Ta Tb Tc Te Th Ti Tl Tm Ts U V W Xe Y Yb Zn Zr".toUpperCase().split(' ')

    val s = readLn()
    val n = s.length
    var D = BooleanArray(n + 1)
    D[0] = true

    for(i in s.indices) {
        if(!D[i]) continue
        if(s.substring(i, i+1) in el) D[i+1] = true
        if(i + 2 <= n && s.substring(i, i+2) in el) D[i+2] = true
    }

    println(if(D.last()) "YES" else "NO")
}

/** 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 _ln = ""
@JvmField var _lnPtr = 0
fun read(): String {
    while (_lnPtr >= _ln.length) {
        _ln = readLine() ?: return ""
        _lnPtr = 0
    }
    var j = _ln.indexOf(' ', _lnPtr)
    if(j < 0) j = _ln.length
    val res = _ln.substring(_lnPtr, j)
    _lnPtr = j + 1
    return res
}
fun readRem(): String /* reads remainder of current line */ =
    _ln.substring(min(_lnPtr, _ln.length)).also { _lnPtr = _ln.length }
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 java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.lang.Exception
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val el = "Ac Ag Al Am Ar As At Au B Ba Be Bh Bi Bk Br C Ca Cd Ce Cf Cl Cm Cn Co Cr Cs Cu Db Ds Dy Er Es Eu F Fe Fl Fm Fr Ga Gd Ge H He Hf Hg Ho Hs I In Ir K Kr La Li Lr Lu Lv Mc Md Mg Mn Mo Mt N Na Nb Nd Ne Nh Ni No Np O Og Os P Pa Pb Pd Pm Po Pr Pt Pu Ra Rb Re Rf Rg Rh Rn Ru S Sb Sc Se Sg Si Sm Sn Sr Ta Tb Tc Te Th Ti Tl Tm Ts U V W Xe Y Yb Zn Zr".toUpperCase().split(' ')
    val s = sc.nextLine()
    val n = s.length
    val D = BooleanArray(n + 1)
    D[0] = true

    for(i in s.indices) {
        if(!D[i]) continue
        if(s.substring(i, i+1) in el) D[i+1] = true
        if(i + 2 <= n && s.substring(i, i+2) in el) D[i+2] = true
    }

    println(if(D.last()) "YES" else "NO")
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}

fun main() {
    val periodic = HashSet<String>()
    fun setUp() {
        periodic += "H"
        periodic += "HE"
        periodic += "LI"
        periodic += "BE"
        periodic += "B"
        periodic += "C"
        periodic += "N"
        periodic += "O"
        periodic += "F"
        periodic += "NE"
        periodic += "NA"
        periodic += "MG"
        periodic += "AL"
        periodic += "SI"
        periodic += "P"
        periodic += "S"
        periodic += "CL"
        periodic += "AR"
        periodic += "K"
        periodic += "CA"
        periodic += "SC"
        periodic += "TI"
        periodic += "V"
        periodic += "CR"
        periodic += "MN"
        periodic += "FE"
        periodic += "CO"
        periodic += "NI"
        periodic += "CU"
        periodic += "ZN"
        periodic += "GA"
        periodic += "GE"
        periodic += "AS"
        periodic += "SE"
        periodic += "BR"
        periodic += "KR"
        periodic += "RB"
        periodic += "SR"
        periodic += "Y"
        periodic += "ZR"
        periodic += "NB"
        periodic += "MO"
        periodic += "TC"
        periodic += "RU"
        periodic += "RH"
        periodic += "PD"
        periodic += "AG"
        periodic += "CD"
        periodic += "IN"
        periodic += "SN"
        periodic += "SB"
        periodic += "TE"
        periodic += "I"
        periodic += "XE"
        periodic += "CS"
        periodic += "BA"
        periodic += "LA"
        periodic += "CE"
        periodic += "PR"
        periodic += "ND"
        periodic += "PM"
        periodic += "SM"
        periodic += "EU"
        periodic += "GD"
        periodic += "TB"
        periodic += "DY"
        periodic += "HO"
        periodic += "ER"
        periodic += "TM"
        periodic += "YB"
        periodic += "LU"
        periodic += "HF"
        periodic += "TA"
        periodic += "W"
        periodic += "RE"
        periodic += "OS"
        periodic += "IR"
        periodic += "PT"
        periodic += "AU"
        periodic += "HG"
        periodic += "TL"
        periodic += "PB"
        periodic += "BI"
        periodic += "PO"
        periodic += "AT"
        periodic += "RN"
        periodic += "FR"
        periodic += "RA"
        periodic += "AC"
        periodic += "TH"
        periodic += "PA"
        periodic += "U"
        periodic += "NP"
        periodic += "PU"
        periodic += "AM"
        periodic += "CM"
        periodic += "BK"
        periodic += "CF"
        periodic += "ES"
        periodic += "FM"
        periodic += "MD"
        periodic += "NO"
        periodic += "LR"
        periodic += "RF"
        periodic += "DB"
        periodic += "SG"
        periodic += "BH"
        periodic += "HS"
        periodic += "MT"
        periodic += "DS"
        periodic += "RG"
        periodic += "CN"
        periodic += "NH"
        periodic += "FL"
        periodic += "MC"
        periodic += "LV"
        periodic += "TS"
        periodic += "OG"
    }
    setUp()
    val input = System.`in`.bufferedReader().readLine()

    //    val calced = BooleanArray(input.length)
//    val valid = BooleanArray(input.length)
    fun solve(id: Int): Boolean {
        if (id == input.length) {
            return true
        }
//        if (!calced[id]) {
        var isValid = false
        if (input[id].toString() in periodic) {
            isValid = isValid || solve(id + 1)
        }
        if (id < input.lastIndex && (input[id].toString() + input[id + 1]) in periodic) {
            isValid = isValid || solve(id + 2)
        }
//            valid[id] = isValid
//        }
//        return valid[id]
        return isValid
    }
    print(if (solve(0)) "YES" else "NO")
}

fun main() {
    val periodic = HashSet<String>()
    fun setUp() {
        periodic += "H"
        periodic += "HE"
        periodic += "LI"
        periodic += "BE"
        periodic += "B"
        periodic += "C"
        periodic += "N"
        periodic += "O"
        periodic += "F"
        periodic += "NE"
        periodic += "NA"
        periodic += "MG"
        periodic += "AL"
        periodic += "P"
        periodic += "S"
        periodic += "CL"
        periodic += "AR"
        periodic += "K"
        periodic += "CA"
        periodic += "TI"
        periodic += "V"
        periodic += "CR"
        periodic += "MN"
        periodic += "FE"
        periodic += "ZN"
        periodic += "GA"
        periodic += "GE"
        periodic += "AS"
        periodic += "SE"
        periodic += "BR"
        periodic += "KR"
        periodic += "RB"
        periodic += "SR"
        periodic += "Y"
        periodic += "ZR"
        periodic += "MO"
        periodic += "TC"
        periodic += "RU"
        periodic += "RH"
        periodic += "PD"
        periodic += "AG"
        periodic += "CD"
        periodic += "TE"
        periodic += "I"
        periodic += "XE"
        periodic += "BA"
        periodic += "LA"
        periodic += "CE"
        periodic += "PR"
        periodic += "ND"
        periodic += "PM"
        periodic += "SM"
        periodic += "EU"
        periodic += "GD"
        periodic += "TB"
        periodic += "DY"
        periodic += "ER"
        periodic += "TM"
        periodic += "LU"
        periodic += "TA"
        periodic += "W"
        periodic += "RE"
        periodic += "IR"
        periodic += "PT"
        periodic += "AU"
        periodic += "HG"
        periodic += "TL"
        periodic += "AT"
        periodic += "RN"
        periodic += "FR"
        periodic += "RA"
        periodic += "AC"
        periodic += "TH"
        periodic += "PA"
        periodic += "U"
        periodic += "AM"
        periodic += "CM"
        periodic += "ES"
        periodic += "FM"
        periodic += "MD"
        periodic += "LR"
        periodic += "RF"
        periodic += "DB"
        periodic += "SG"
        periodic += "MT"
        periodic += "DS"
        periodic += "RG"
        periodic += "FL"
        periodic += "MC"
        periodic += "LV"
        periodic += "TS"
        periodic += "OG"
    }
    setUp()
    val input = System.`in`.bufferedReader().readLine()

    //    val calced = BooleanArray(input.length)
//    val valid = BooleanArray(input.length)
    fun solve(id: Int): Boolean {
        if (id == input.length) {
            return true
        }
//        if (!calced[id]) {
        var isValid = false
        if (input[id].toString() in periodic) {
            isValid = isValid || solve(id + 1)
        }
        if (id < input.lastIndex && (input[id].toString() + input[id + 1]) in periodic) {
            isValid = isValid || solve(id + 2)
        }
//            valid[id] = isValid
//        }
//        return valid[id]
        return isValid
    }
    print(if (solve(0)) "YES" else "NO")
}

fun main() {
    val periodic = HashSet<String>()
    fun setUp() {
        periodic += "H"
        periodic += "HE"
        periodic += "LI"
        periodic += "BE"
        periodic += "B"
        periodic += "C"
        periodic += "N"
        periodic += "O"
        periodic += "F"
        periodic += "NE"
        periodic += "NA"
        periodic += "MG"
        periodic += "AL"
        periodic += "SI"
        periodic += "P"
        periodic += "S"
        periodic += "CL"
        periodic += "AR"
        periodic += "K"
        periodic += "CA"
        periodic += "SC"
        periodic += "TI"
        periodic += "V"
        periodic += "CR"
        periodic += "MN"
        periodic += "FE"
        periodic += "CO"
        periodic += "NI"
        periodic += "CU"
        periodic += "ZN"
        periodic += "GA"
        periodic += "GE"
        periodic += "AS"
        periodic += "SE"
        periodic += "BR"
        periodic += "KR"
        periodic += "RB"
        periodic += "SR"
        periodic += "Y"
        periodic += "ZR"
        periodic += "NB"
        periodic += "MO"
        periodic += "TC"
        periodic += "RU"
        periodic += "RH"
        periodic += "PD"
        periodic += "AG"
        periodic += "CD"
        periodic += "IN"
        periodic += "SN"
        periodic += "SB"
        periodic += "TE"
        periodic += "I"
        periodic += "XE"
        periodic += "CS"
        periodic += "BA"
        periodic += "LA"
        periodic += "CE"
        periodic += "PR"
        periodic += "ND"
        periodic += "PM"
        periodic += "SM"
        periodic += "EU"
        periodic += "GD"
        periodic += "TB"
        periodic += "DY"
        periodic += "HO"
        periodic += "ER"
        periodic += "TM"
        periodic += "YB"
        periodic += "LU"
        periodic += "HF"
        periodic += "TA"
        periodic += "W"
        periodic += "RE"
        periodic += "OS"
        periodic += "IR"
        periodic += "PT"
        periodic += "AU"
        periodic += "HG"
        periodic += "TL"
        periodic += "PB"
        periodic += "BI"
        periodic += "PO"
        periodic += "AT"
        periodic += "RN"
        periodic += "FR"
        periodic += "RA"
        periodic += "AC"
        periodic += "TH"
        periodic += "PA"
        periodic += "U"
        periodic += "NP"
        periodic += "PU"
        periodic += "AM"
        periodic += "CM"
        periodic += "BK"
        periodic += "CF"
        periodic += "ES"
        periodic += "FM"
        periodic += "MD"
        periodic += "NO"
        periodic += "LR"
        periodic += "RF"
        periodic += "DB"
        periodic += "SG"
        periodic += "BH"
        periodic += "HS"
        periodic += "MT"
        periodic += "DS"
        periodic += "RG"
        periodic += "CN"
        periodic += "NH"
        periodic += "FL"
        periodic += "MC"
        periodic += "LV"
        periodic += "TS"
        periodic += "OG"
    }
    setUp()
    val input = System.`in`.bufferedReader().readLine()
    val calced = BooleanArray(input.length)
    val valid = BooleanArray(input.length)
    fun solve(id: Int): Boolean {
        if (id == input.length) {
            return true
        }
        if (!calced[id]) {
            var isValid = false
            if (input[id].toString() in periodic) {
                isValid = isValid || solve(id + 1)
            }
            if (id < input.lastIndex && (input[id].toString() + input[id + 1]) in periodic) {
                isValid = isValid || solve(id + 2)
            }
            valid[id] = isValid
        }
        return valid[id]
    }
    print(if (solve(0)) "YES" else "NO")
}

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.lang.StringBuilder
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val s = sc.nextLine()
    val a = arrayOf("GENIUS", "IRENE", "REVOLVER", "WATSON")
    val b = arrayOf("DOCTOR", "MARY", "SMARTPHONE", "HOLMES")
    if (a.contains(s)) {
        println("YES")
    } else if (b.contains(s)) {
        println("NO")
    } else {
        println("YES")
    }
}

fun main(args: Array<String>) {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}


Today Vasya visited a widely known site and learned that the continuation of his favourite game Codecraft II will appear after exactly k months. He looked at the calendar and learned that at the moment is the month number s. Vasya immediately got interested in what month Codecraft III will appear. Help him understand that.All the twelve months in Vasya's calendar are named using their usual English names: January, February, March, April, May, June, July, August, September, October, November, December.

The first input line contains the name of the current month. It is guaranteed that it is a proper English name of one of twelve months. The first letter is uppercase, the rest are lowercase. The second line contains integer k (0 ≤ k ≤ 100) — the number of months left till the appearance of Codecraft III.

Print starting from an uppercase letter the name of the month in which the continuation of Codeforces II will appear. The printed name must be contained in the list January, February, March, April, May, June, July, August, September, October, November, December.

import java.util.Scanner

fun main(args : Array<String>) {

    val reader = Scanner(System.`in`)
    val m = readLine()!!
    var n: Int = reader.nextInt()
    val list = arrayOf("January","February","March","April","May","June","July","August","September","October","November","December")

    var a = 0

    for(i in 0..11){
        if(m==list[i]){
            a = i
            break
        }
    }

    n = n%12

    println(list[(a + n)%12])

}

fun main() {
    val month = readLine()!!
    val nextMonthNumber = readLine()!!

    val monthNumber = months.indexOf(month)
    val result = (monthNumber + nextMonthNumber.toInt() % 12) % 12
    println(months[result])
}

val months = arrayOf(
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
)

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

    val nameToNumber = mapOf("January" to 0, "February" to 1, "March" to 2, "April" to 3, "May" to 4, "June" to 5,
            "July" to 6, "August" to 7, "September" to 8, "October" to 9, "November" to 10, "December" to 11)
    val numberToName = arrayOf("January", "February", "March", "April", "May", "June", "July", "August",
            "September", "October", "November", "December")
    println(numberToName[(nameToNumber[readLine()!!]!! + readInt()) % 12])
}

fun main(args: Array<String>) {
    val month = readLine()
    val cnt = readLine()!!.toInt()

    val allMonths = listOf("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
    var currMonthIndex = allMonths.indexOf(month)

    for (i in 1 .. cnt)
    {
        if (++currMonthIndex > 11)
            currMonthIndex -= 12
    }

    print(allMonths[currMonthIndex])
}


Noora is a student of one famous high school. It's her final year in school — she is going to study in university next year. However, she has to get an «A» graduation certificate in order to apply to a prestigious one.In school, where Noora is studying, teachers are putting down marks to the online class register, which are integers from 1 to k. The worst mark is 1, the best is k. Mark that is going to the certificate, is calculated as an average of all the marks, rounded to the closest integer. If several answers are possible, rounding up is produced. For example, 7.3 is rounded to 7, but 7.5 and 7.8784 — to 8. For instance, if Noora has marks [8, 9], then the mark to the certificate is 9, because the average is equal to 8.5 and rounded to 9, but if the marks are [8, 8, 9], Noora will have graduation certificate with 8.To graduate with «A» certificate, Noora has to have mark k.Noora got n marks in register this year. However, she is afraid that her marks are not enough to get final mark k. Noora decided to ask for help in the internet, where hacker Leha immediately responded to her request. He is ready to hack class register for Noora and to add Noora any number of additional marks from 1 to k. At the same time, Leha want his hack be unseen to everyone, so he decided to add as less as possible additional marks. Please help Leha to calculate the minimal number of marks he has to add, so that final Noora's mark will become equal to k.

The first line contains two integers n and k (1 ≤ n ≤ 100, 1 ≤ k ≤ 100) denoting the number of marks, received by Noora and the value of highest possible mark. The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ k) denoting marks received by Noora before Leha's hack.

Print a single integer — minimal number of additional marks, that Leha has to add in order to change Noora's final mark to k.

NoteConsider the first example testcase.Maximal mark is 10, Noora received two marks — 8 and 9, so current final mark is 9. To fix it, Leha can add marks [10, 10, 10, 10] (4 marks in total) to the registry, achieving Noora having average mark equal to . Consequently, new final mark is 10. Less number of marks won't fix the situation.In the second example Leha can add [5, 5, 5] to the registry, so that making average mark equal to 4.5, which is enough to have 5 in the certificate.

/**
 * Created by seydazimovnurbol on 5/23/17.
 */

import java.util.*
import kotlin.system.exitProcess

fun main(args: Array <String>) {
    var scanner : Scanner = Scanner(System.`in`)
    var n = scanner.nextInt()
    var k = scanner.nextInt()

    var a : ArrayList<Int> = ArrayList<Int>()

    var sum : Double = 0.0
    for (i in 1 .. n) {
        var x = scanner.nextInt()
        a.add(x)
        sum += x
    }
    sum /= n
    var cntK : Int = 0
    for (i in 0 .. n - 1)
        if (a[i] == k) cntK++;

    var need : Int = 0
    for (i in 0 .. n - 1) {
        if (a[i] < k) {
            var cnt : Int = k - 1 - a[i]
            a[i] += Math.min(cnt, cntK)
            cntK -= Math.min(cnt, cntK)
            need += k - 1 - a[i]
        }
    }

    // [A] [B]

    var cntOther : Int = n - cntK
    if (cntK >= cntOther) println(0)
    else if (need == 0) println(cntOther - cntK)
    else println(need + n + need)
}

fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(" ").map { it.toInt() }
    val list = readLine()!!.split(" ").map { it.toInt() }
    var sum = 0
    var count = list.size
    list.forEach { it -> sum += it }
    while (true) {
        if (Math.round(sum.toFloat()/count) == k) {
            break
        }
        sum += k
        count++
    }
    print(count - list.size)
}

fun main(args: Array<String>) {
    val x = readLine()!!.split(" ")
    var courses = x[0].toInt()
    val mark = x[1].toInt()

    var sum = readLine()!!.split(" ").map { it.toInt() }.sum().toDouble()

    var ans = 0
    var curMark =  sum / courses
    while ((curMark + .5).toInt() < mark){
        sum += mark
        courses++
        curMark = sum / courses
        ans++
    }
    println(ans)
}

fun main(args: Array<String>){
    val reg = Regex(" ")
    var s = readLine()!!.split(reg)
    var n = s[0].toInt()
    val k = s[1].toInt()
    s = readLine()!!.split(reg)
    var sum = s.sumBy { it.toInt() }
    val need = (k - 1).toDouble() + 0.5
    var ans = 0
    while (sum.toDouble() / n.toDouble() < need){
        sum += k
        ++n
        ++ans
    }
    print(ans)
}

import java.util.*

/**
 * Created by apple on 2017/5/22.
 */
fun main(args:Array<String>) {
    var scanner:Scanner = Scanner(System.`in`)

    var n = scanner.nextInt()
    var k = scanner.nextInt()

    var sum = 0

    for (i in 0..n-1) {
        var a = scanner.nextInt()
        sum += a
    }

    var ans = 0

    while (!accept(sum, k, n + ans)) {
        sum += k
        ans++
    }
    println(ans)
}

fun accept(sum:Int, k:Int, count:Int) : Boolean{
    if (Math.round(1.0 * sum / count) >= k) {
        return true
    }
    return false
}

import kotlin.math.max

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

    val (numMarks, k) = readInts()
    val arr = readInts()
    print(max(0, ((arr.sum() - numMarks * (k - 0.5)) / -0.5).toInt()))
}

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

fun main(args: Array<String>) = input.run {
    var n = nextInt()
    var k = nextInt()
    var a = nextInts(n)
    var sum = a.sum()
    var ans = 0
    while (2 * sum < 2 * k * n - n) {
        ++ans
        ++n
        sum += k
    }
    println(ans)
}

val input = FastScanner()

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

fun main(args: Array<String>) {

    var x= readLine()?.split(" ")
    var n:Int = Integer.parseInt(x!![0])
    var k:Int = Integer.parseInt(x!![1])
    x= readLine()?.split(" ")
    var sum:Double=0.0
    for(i in 1..n){
        sum+=Integer.parseInt(x!![i-1])
    }
    var avg:Double=sum/n
    if(avg+.5>=k){
        println(0)
        return
    }
    var c=0
    while (true){
        sum+=k
        n++
        c++
        avg=sum/n
        if(avg+.5>=k)break
    }
    println(c)

}

fun main(args: Array<String>) {
    var (n, k) = readLine()!!.split(' ').map(String::toInt)
    var total = 0
    readLine()!!.split(' ').map(String::toInt).forEach {
        total += it
    }
    var ans = 0
    while (true) {
        // print("$n $total\n")
        if (total / n >= k)
            break
        else if (total / n >= k - 1 && total % n >= (n+1) / 2)
            break
        ans++
        n++
        total += k
    }
    print("$ans\n")
}

/**
 * Created by seydazimovnurbol on 5/23/17.
 */

import java.util.*

fun main(args: Array <String>) {

    var scanner : Scanner = Scanner(System.`in`)
    var n = scanner.nextInt()
    var k = scanner.nextInt()

    var a : ArrayList<Int> = ArrayList<Int>()

    for (i in 1 .. n) {
        var x = scanner.nextInt()
        a.add(x)
    }

    var cntK : Int = 0
    for (i in 0 .. n - 1)
        if (a[i] == k) cntK++;

    var need : Int = 0
    for (i in 0 .. n - 1) {
        if (a[i] < k) {
            var cnt : Int = k - 1 - a[i]
            a[i] += Math.min(cnt, cntK)
            cntK -= Math.min(cnt, cntK)
            need += k - 1 - a[i]
        }
    }

    println(n + 2 * need)

}

/**
 * Created by seydazimovnurbol on 5/23/17.
 */

import java.util.*
import kotlin.system.exitProcess

fun main(args: Array <String>) {
    var scanner : Scanner = Scanner(System.`in`)
    var n = scanner.nextInt()
    var k = scanner.nextInt()

    var a : ArrayList<Int> = ArrayList<Int>()

    var sum : Double = 0.0
    for (i in 1 .. n) {
        var x = scanner.nextInt()
        a.add(x)
        sum += x
    }
    sum /= n
    var cntK : Int = 0
    for (i in 0 .. n - 1)
        if (a[i] == k) cntK++;

    var need : Int = 0
    for (i in 0 .. n - 1) {
        if (a[i] < k) {
            var cnt : Int = k - 1 - a[i]
            a[i] += Math.min(cnt, cntK)
            cntK -= Math.min(cnt, cntK)
            need += k - 1 - a[i]
        }
    }

    if (sum + 0.5 >= k) println(0)
    else println(n + 2 * need)
}

/**
 * Created by seydazimovnurbol on 5/23/17.
 */

import java.util.*

fun main(args: Array <String>) {

    var scanner : Scanner = Scanner(System.`in`)
    var n = scanner.nextInt()
    var k = scanner.nextInt()

    var a : ArrayList<Int> = ArrayList<Int>()

    for (i in 1 .. n) {
        var x = scanner.nextInt()
        a.add(x)
    }

    var cntK : Int = 0
    for (i in 0 .. n - 1)
        if (a[i] == k) cntK++;

    var need : Int = 0
    for (i in 0 .. n - 1) {
        if (a[i] < k) {
            var cnt : Int = k - 1 - a[i]
            a[i] += Math.min(cnt, cntK)
            cntK -= Math.min(cnt, cntK)
            need += k - 1 - a[i]
        }
    }

    if (need == 0) println(0);
    else println(n + 2 * need)

}

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

    val (numMarks, k) = readInts()
    val arr = readInts()
    print(((arr.sum() - numMarks * (k - 0.5)) / -0.5).toInt())
}


To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smart Beaver wants to invite only those of his friends who are connected by friendship relations, and not to invite those who dislike each other. Both friendship and dislike are mutual feelings.More formally, for each invited person the following conditions should be fulfilled:   all his friends should also be invited to the party;  the party shouldn't have any people he dislikes;  all people who are invited to the party should be connected with him by friendship either directly or through a chain of common friends of arbitrary length. We'll say that people a1 and ap are connected through a chain of common friends if there exists a sequence of people a2, a3, ..., ap - 1 such that all pairs of people ai and ai + 1 (1 ≤ i < p) are friends. Help the Beaver find the maximum number of acquaintances he can invite.

The first line of input contains an integer n — the number of the Beaver's acquaintances.  The second line contains an integer k  — the number of pairs of friends. Next k lines contain space-separated pairs of integers ui, vi  — indices of people who form the i-th pair of friends. The next line contains an integer m  — the number of pairs of people who dislike each other. Next m lines describe pairs of people who dislike each other in the same format as the pairs of friends were described. Each pair of people is mentioned in the input at most once . In particular, two persons cannot be friends and dislike each other at the same time. The input limitations for getting 30 points are:    2 ≤ n ≤ 14  The input limitations for getting 100 points are:    2 ≤ n ≤ 2000

Output a single number — the maximum number of people that can be invited to the party. If a group of people that meets all the requirements is impossible to select, output 0.

NoteLet's have a look at the example.   Two groups of people can be invited: {1, 2, 3} and {4, 5}, thus the answer will be the size of the largest of these groups. Group {6, 7, 8, 9} doesn't fit, since it includes people 7 and 9 who dislike each other. Group {1, 2, 3, 4, 5} also doesn't fit, because not all of its members are connected by a chain of common friends (for example, people 2 and 5 aren't connected).

import java.util.*
import kotlin.math.exp

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single Int
private fun readInts() = readStrings().map { it.toInt() } // list of Ints
private fun readStrings() = readLn().trim().split(" ") // list of strings

fun dfs(
    start: Int,
    friends: Map<Int, MutableList<Int>>,
    dislike: Map<Int, MutableSet<Int>>,
    seen: MutableSet<Int>
): Pair<Boolean, Int> {
    val visited = mutableSetOf<Int>()
    val stack = ArrayDeque<Int>()
    stack.add(start)
    seen.add(start)
    visited.add(start)
    val bad = dislike[start] ?: mutableSetOf()
    while (stack.isNotEmpty()) {
        val node = stack.pop()
        for (neb in friends[node] ?: mutableListOf()) {
            if (neb in bad) {
                return Pair(false, -1)
            } else if (neb !in visited) {
                visited.add(neb)
                seen.add(neb)
                bad.addAll(dislike[neb] ?: mutableSetOf())
                stack.add(neb)
            }
        }
    }
    return Pair(true, visited.size)
}

fun main(args: Array<String>) {
    val n = readInt()
    val pairs = readInt()
    val friends = mutableMapOf<Int, MutableList<Int>>()
    val dislike = mutableMapOf<Int, MutableSet<Int>>()
    for (i in 0 until pairs) {
        val (u, v) = readInts()
        friends.computeIfAbsent(u) { mutableListOf() }
        friends.computeIfAbsent(v) { mutableListOf() }

        friends[u]!!.add(v)
        friends[v]!!.add(u)
    }
    val x = readInt()
    for (i in 0 until x) {
        val (u, v) = readInts()
        dislike.computeIfAbsent(u) { mutableSetOf() }
        dislike.computeIfAbsent(v) { mutableSetOf() }
        dislike[u]!!.add(v)
    }
    var res = 0
    val seen = mutableSetOf<Int>()
    for (i in 1 until n + 1) {
        if (i !in seen) {
            val p = dfs(i, friends, dislike, seen)
            if (p.first) {
                res = Math.max(res, p.second)
            }
        }
    }
    println(res)
}


PolandBall is a young, clever Ball. He is interested in prime numbers. He has stated a following hypothesis: "There exists such a positive integer n that for each positive integer m number n·m + 1 is a prime number".Unfortunately, PolandBall is not experienced yet and doesn't know that his hypothesis is incorrect. Could you prove it wrong? Write a program that finds a counterexample for any n.

The only number in the input is n (1 ≤ n ≤ 1000) — number from the PolandBall's hypothesis.

Output such m that n·m + 1 is not a prime number. Your answer will be considered correct if you output any suitable m such that 1 ≤ m ≤ 103. It is guaranteed the the answer exists.

NoteA prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.For the first sample testcase, 3·1 + 1 = 4. We can output 1.In the second sample testcase, 4·1 + 1 = 5. We cannot output 1 because 5 is prime. However, m = 2 is okay since 4·2 + 1 = 9, which is not a prime number.

import kotlin.math.sqrt

fun main() {
    val r = System.`in`.bufferedReader()
    val s1 = StringBuilder()
    fun prime(i: Int) = (2..sqrt(i.toDouble()).toInt()).none { i % it == 0 }
    val n = r.readLine()!!.toInt()
    //val v = r.readLine()!!.split(" ").map { it.toInt() }.toSet().toList().sorted()
    var m = 1
    while (prime(m*n+1)){
        m++
    }
    println(m)
}

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

    var m = 1
    while (m <= 1000) {

        if (!isPrime(n * m + 1)) {
            println(m)
            return
        }
        m++
    }

}

fun isPrime(n: Int): Boolean {
    var i = 2

    while (i * i <= n) {

        if (n % i == 0)
            return false

        i++
    }

    return true
}

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

fun main(args : Array<String>) {
  //====== Input preparations ========================================================
//  val fin = BufferedReader(FileReader("a.in"))
  val fin = BufferedReader(InputStreamReader(System.`in`))
  val fout = PrintWriter (System.out)
  var tokenizer = StringTokenizer("")
  fun next() : String {
    while (!tokenizer.hasMoreTokens())
      tokenizer = StringTokenizer(fin.readLine())
    return tokenizer.nextToken()
  }
  fun nextInt() = next().toInt()
  fun nextPair() = nextInt() to nextInt()
  fun nextPairDec() = nextInt()-1 to nextInt()-1
  //====== Solution below ============================================================
  fun gcd (a: Int, b: Int) : Int = if (a == 0) b else gcd(b%a, a)
  fun isprime(a: Int) = (2..a-1).none { a % it == 0 }
  val n = nextInt()
//  for (n in 1..1000) {
  for (i in 2..1000) {
    if (gcd(i, n) == 1 && !isprime(i)) {
      for (j in 1..i - 1) {
        if (j * n % i == i - 1) {
          fout.println(j)
          break
        }
      }
      break
    }
  }
//  }

  fout.close()
  fin.close()
}

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

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
fun main(){
    val reader=Scanner(System.`in`)
    var a=readInt();
    for(i in 1..1000){
        var b=a*i+1
        for(j in 2..b-1){
            if(b%j==0){
                print(i)
                return
            }
        }
    }
}

import kotlin.math.*

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    for (i in 1..1000) {
        val num = n * i + 1
        var flag = false
        for (j in 2..num / 2) {
            if (num % j == 0) {
                flag = true
                break
            }
        }
        if (flag) {
            println(i)
            return
        }
    }
}

import java.lang.StringBuilder
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.max

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

    for (i in 1..10_000) {
        var flag = true

        for (j in 2..i - 1) {
            if (i % j == 0) {
                flag = false
                break
            }
        }
        if (flag) {
            list.add(false)
        } else {
            list.add(true)
        }
    }
    list[0] = true
    list[1] = false
    list.add(true)
    for (i in 1..1000) {
        if (list[n * i]) {
            println(i)
            break
        }
    }

}

import kotlin.math.sqrt

fun checkprime(n:Int):Boolean
{
    if(n<=1)
    {
        return false
    }
    val root = sqrt(n.toDouble())
    for(i in 2 until root.toInt()+1)
    {
        if(n%i==0)
        {
            return false
        }
    }
    return true
}

fun main(args:Array<String>)
{
    val n : Int = readLine()!!.toInt()
    for(i in 1 until 1001) {
        if(!checkprime(n*i+1))
        {
            print(i)
            break
        }
    }
}

fun main() {
    fun sieve(limit: Int): List<Int> {
        val notPrimes = mutableSetOf<Int>()
        val primes = ArrayList<Int>()
        for (num in 2..limit) {
            if (num !in notPrimes) {
                primes.add(num)
                var notPrime = num + num
                while (notPrime <= limit) {
                    notPrimes.add(notPrime)
                    notPrime += num
                }
            }
        }
        return primes
    }

    val primes = sieve(10000).toSet()
    val n = readLine()!!.toInt()
    for (c in 1..10)
        if (n * c + 1 !in primes) {
            print(c)
            return
        }
}

import java.io.BufferedReader
import java.io.File
import java.io.PrintWriter

fun main(args: Array<String>) {
    val onlineJudge = System.getProperty("ONLINE_JUDGE") == "true"
    val input = if (onlineJudge) System.`in`.bufferedReader() else File("input.txt").bufferedReader()
    val output = if (onlineJudge) PrintWriter(System.out.writer(), true) else PrintWriter(File("output.txt"))

    solve(input, output)

    output.flush()
    output.close()
}

private fun String.words() = split(" ")

private fun String.toInts() = split(" ").map(String::toInt)
private fun String.toLongs() = split(" ").map(String::toLong)

fun isPrime(p: Int): Boolean {
    val upb = Math.sqrt(p.toDouble()).toInt()
    for (i in 2..upb) {
        if (p % i == 0)
            return false
    }
    return true
}

private fun solve(input: BufferedReader, output: PrintWriter) {
    val n = input.readLine().toInt()
    for (m in 1..1000) {
        val p = n * m + 1
        if (!isPrime(p)) {
            output.println(m)
            return
        }
    }
}

import kotlin.math.sqrt

fun main() {
    val r = System.`in`.bufferedReader()
    val s1 = StringBuilder()
    fun prime(i: Int) = (2..sqrt(i.toDouble()).toInt()).none { it % i == 0 }
    val n = r.readLine()!!.toInt()
    //val v = r.readLine()!!.split(" ").map { it.toInt() }.toSet().toList().sorted()
    var m = 1
    while (!prime(m*n+1)){
        m++
    }
    println(m)
}

import kotlin.math.*

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    for (i in 1..1000) {
        val num = n * i + 1
        var flag = false
        for (j in 2..num / 2) {
            if (num % i == 0) {
                flag = true
                break
            }
        }
        if (!flag) {
            println(i)
            return
        }
    }
}

import java.lang.StringBuilder
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.max

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

    for (i in 1..1000) {
        var flag = true

        for (j in 2..i - 1) {
            if (i % j == 0) {
                flag = false
                break
            }
        }
        if (flag) {
            list.add(false)
        } else {
            list.add(true)
        }
    }
    list[0] = true
    list[1] = true
    list.add(true)
    for (i in 1..1000) {
        if (list[n * i]) {
            println(i)
            break
        }
    }

}

import java.util.*

fun main(){
    val sc = Scanner(System.`in`)
    val n:Int = sc.nextInt()
    if (n%2==0){
        println(1)
    }else if (n==1){
        println(3)
    }else{
        println(2)
    }
}

import java.util.*

fun main(){
    val sc = Scanner(System.`in`)
    val n:Int = sc.nextInt()
    if (n%2==0){
        println(2)
    }else{
        println(1)
    }
}

import java.util.*

fun main(){
    val sc = Scanner(System.`in`)
    val n:Int = sc.nextInt()
    if (n%2==0){
        println(2)
    }else if (n==1){
        println(3)
    }else{
        println(1)
    }
}


Bob is decorating his kitchen, more precisely, the floor. He has found a prime candidate for the tiles he will use. They come in a simple form factor — a square tile that is diagonally split into white and black part as depicted in the figure below.  The dimension of this tile is perfect for this kitchen, as he will need exactly $$$w \times h$$$ tiles without any scraps. That is, the width of the kitchen is $$$w$$$ tiles, and the height is $$$h$$$ tiles. As each tile can be rotated in one of four ways, he still needs to decide on how exactly he will tile the floor. There is a single aesthetic criterion that he wants to fulfil: two adjacent tiles must not share a colour on the edge — i.e. one of the tiles must have a white colour on the shared border, and the second one must be black.    The picture on the left shows one valid tiling of a $$$3 \times 2$$$ kitchen. The picture on the right shows an invalid arrangement, as the bottom two tiles touch with their white parts. Find the number of possible tilings. As this number may be large, output its remainder when divided by $$$998244353$$$ (a prime number).

The only line contains two space separated integers $$$w$$$, $$$h$$$ ($$$1 \leq w,h \leq 1\,000$$$) — the width and height of the kitchen, measured in tiles.

Output a single integer $$$n$$$ — the remainder of the number of tilings when divided by $$$998244353$$$.

import java.lang.Integer.min
import java.util.*

fun main() {
    var ab = readLine()!!.split(' ').map { it.toInt() }.let { it[0] + it[1] }
    var k = 1
    while (ab > 0) {
        val z = Integer.numberOfLeadingZeros(k)
        val bit = min(ab, z - 1)
        ab -= bit
        k = k.shl(bit).rem(998244353)
    }
    println(k)
    return

    val s = ""//readLine()!!
    val l = s.length
    var lv = -1
    var os = 0
    val mark = LinkedList<Int>()
    for (i in 0 until l) {
        when (s[i]) {
            'v' -> ++lv
            'o' -> {
                if (lv > 0) {
                    mark.add(lv)
                }
                lv = -1
                mark.add(0)
                ++os
            }
            else -> {
                throw Error()
            }
        }
    }
    if (lv > 0) {
        mark.add(lv)
    }

    var w = 0
    val left = IntArray(os)
    val right = IntArray(os)
    var fi = 0
    var ss = 0
    if (os  > 0 ) {

        mark.iterator().forEach {
            if (it == 0) {
                left[fi++] = w
            } else {
                w += it
            }
        }
        w = 0
        mark.descendingIterator().forEach {
            if (it == 0) {
                right[--fi] = w
            } else {
                w += it
            }
        }

    }
    for (i in 0 until os) {
        ss += left[i] * right[i]
    }
    println(ss)
}

fun main() {

    val (w, h) = readInts()

    val prime = 998244353L
    val dp = mutableListOf<MutableList<Long>>()

    for (i in 0 until  h) {
        dp.add(mutableListOf())
        for (j in 0 until w) {
            dp[i].add(0)
        }
    }

    dp[0][0] = 4L
    for (i in 0 until  h) {
        for (j in 0 until w) {
            if (i > 0 && j > 0) dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % prime
            else if (i > 0) dp[i][j] = (dp[i - 1][j] * 2) % prime
            else if (j > 0) dp[i][j] = (dp[i][j - 1] * 2) % prime
        }
    }

    println(dp[h - 1][w - 1])
}

// Input Reader
private fun readLn() = readLine()!!

private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

fun main() {
    val (w, h) = readInts()
    val ans = ModInt(2).pow(w + h)

    println(ans)
}

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 }

/** modint inline class, requires hardcoded mod base **/
const val MODBASE = 998244353

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

/** note: Only use constructor for int within modulo range, otherwise use toModInt **/
inline class ModInt(val int: Int) {
    operator fun plus(other: ModInt) = plus(other.int) // MODBASE < 2^30
    operator fun plus(other: Int) =  (int + other).toModInt() // careful of possible overflow
    operator fun inc() = plus(1)

    operator fun minus(other: ModInt) = minus(other.int)
    operator fun minus(other: Int) = (int - other).toModInt()
    operator fun dec() = minus(1)

    operator fun times(other: ModInt) = times(other.int)
    operator fun times(other: Int) = (int.toLong() * other).toModInt()

    fun pow(exponent: Int): ModInt {
        var res = ModInt(1)
        var e = exponent
        var b = this

        if(e < 0) e = e.umod(MODBASE - 1) // assumes MODBASE is prime

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

    fun inv() = pow(MODBASE - 2) // assumes MODBASE is prime

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

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

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

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

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

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

    override fun isEmpty(): Boolean = size == 0

    override fun iterator(): Iterator<ModInt> = object: AbstractIterator<ModInt>() {
        var index = 0
        override fun computeNext() {
            if(index >= size) done()
            else setNext(get(index++))
        }
    }
}
fun ModIntArray(capacity: Int) = ModIntArray(IntArray(capacity))
inline fun ModIntArray(capacity: Int, init: (Int) -> ModInt) =
    ModIntArray(IntArray(capacity) { init(it).int })

fun readLn() = readLine()!!
fun readInt() = readLn().toInt()
fun readDouble() = readLn().toDouble()
fun readLong() = readLn().toLong()
fun readStrings() = readLn().split(' ')
fun readInts() = readStrings().map { it.toInt() }
fun readDoubles() = readStrings().map { it.toDouble() }
fun readLongs() = readStrings().map { it.toLong() }

class Output {
    private val sb = StringBuilder()
    fun print(o: Any?) { sb.append(o) }
    fun println() { sb.append('\n') }
    fun println(o: Any?) { sb.append(o).append('\n') }
    @JvmName("_print") fun Any?.print() = print(this)
    @JvmName("_println") fun Any?.println() = println(this)
    fun nowPrint() { kotlin.io.print(sb) }
}
inline fun output(block: Output.()->Unit)
    { Output().apply(block).nowPrint() }

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.lang.StringBuilder
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.max

fun main() {
    val sc = Scanner.sysIn

    val n = sc.nextInt()
    val m = sc.nextInt()

    var ans = 1L
    for (i in 1..(n + m)) {
        ans = (ans * 2) % 998244353
    }
    println(ans)

}

class Scanner(s: InputStream) {
    var st: StringTokenizer? = null
    val br: BufferedReader = BufferedReader(InputStreamReader(s))

    operator fun next(): String {
        while (st == null || !st!!.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }
    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }
    fun nextLine(): String {
        return br.readLine()
    }
    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }

    companion object {
        val sysIn = Scanner(System.`in`)
    }

}
fun IntArray.print() {
    println(Arrays.toString(this))
}
fun Array<IntArray>.print() {
    for (i in this)
        i.print()
}

fun BooleanArray.print() {
    println(Arrays.toString(this))
}

import java.util.*

fun main() {
    val jin = Scanner(System.`in`)
    val w = jin.nextInt()
    val h = jin.nextInt()
    println(M2 pow (w + h))
}

val M0 = Mint(0)
val M1 = Mint(1)
val M2 = Mint(2)

val MOD: Long = 998244353
val MOD_TOTIENT = (MOD - 1).toInt()

fun mint(num: Long) = Mint(num % MOD)
fun mint(num: Int) = Mint(num % MOD)

inline class Mint(val num: Long) {

    operator fun plus(k: Mint) = mint(num + k.num)
    operator fun minus(k: Mint) = mint(num + MOD - k.num)
    operator fun times(k: Mint) = mint(num * k.num)
    operator fun div(k: Mint) = this * (k pow -1)

    operator fun unaryMinus() = mint(MOD - num)
    operator fun inc() = this + M1
    operator fun dec() = this - M1

    infix fun pow(power: Int): Mint {
        var e = power
        e %= MOD_TOTIENT
        if (e < 0) {
            e += MOD_TOTIENT
        }
        if (e == 0 && num == 0L) {
            return this
        }
        var b = this
        var res = Mint(1)
        while (e > 0) {
            if (e and 1 != 0) {
                res *= b
            }
            b *= b
            e = e shr 1
        }
        return res
    }

    override fun toString(): String = num.toString()
}

import java.util.*

fun main() {
    val input = Scanner(System.`in`)
    val mod = 998244353L
    val n = input.nextInt() + input.nextInt()
    var result = 1L
    for (i in 1..n) {
        result = (result * 2) % mod
    }
    println(result)
}

import java.math.BigInteger

// Unable to solve it by myself. The tutorial is here: https://codeforces.com/blog/entry/68534
fun main() {
    val (w, h) = readLine()!!.split(" ").map(String::toLong)
    print(BigInteger.valueOf(2L).modPow(BigInteger.valueOf(w + h), BigInteger.valueOf(998244353L)))
}

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

fun main() {
    val (w, h) = readInts()

    val mod = 998244353
    var res = 1L
    repeat(w + h) {
        res *= 2
        res %= mod
    }
    println(res)
}

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

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

fun qpowmod(ta:Long, tb:Long, mod:Long):Long {
	var a = ta
	var b = tb
	var res=1L
	while(b>0) {
		if(b%2==1L)
			res=res*a%mod
		b/=2
		a=a*a%mod
	}
	return res
}

fun main(args: Array<String>) {
	var (n,m) = readInts()
	println(qpowmod(2,(n+m).toLong(), 998244353))
}

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

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

fun qpowmod(ta:Long, tb:Long, mod:Long):Long {
	var a = ta
	var b = tb
	var res=1L
	while(b>0) {
		if(b%2==1L)
			res=res*a
		b/=2
		a=a*a%mod
	}
	return res
}

fun main(args: Array<String>) {
	var (n,m) = readInts()
	println(qpowmod(2,(n+m).toLong(), 998244353))
}