import java.util.*

fun main() {
    val (m, n) = readLongs()

    if (n == m) {
        println(0)
        return
    }

    if (n % m != 0L || (n % 2 != 0L && n % 3 != 0L)) {
        println(-1)
        return
    }

    val leftOver = n.factorize().sorted().toMutableList()
    m.factorize().forEach { leftOver -= it }

    println(when {
        leftOver.isEmpty() -> 0
        leftOver.max()!! > 3 -> -1
        else -> leftOver.size
    })
}

fun readLongs(separator: String = " ") =
    readStrings(separator).map(String::toLong).toLongArray()

fun readStrings(separator: String = " ", emptyWords: Boolean = false): Array<String> {
    val line = readLine()!!
    val list = ArrayList<String>()
    var builder = StringBuilder()

    for (i in 0..line.length) {
        if (i == line.length || separator.contains(line[i])) {
            if (emptyWords || builder.isNotEmpty()) {
                list.add(builder.toString())
                builder = StringBuilder()
            }
        } else {
            builder.append(line[i])
        }
    }

    return list.toTypedArray()
}

fun Long.factorize(): List<Int> {
    var sub = takeIf { it > 1 } ?: return emptyList()

    return sequence {
        for (p in Primes.primes) {
            if (sub <= 1) {
                break
            }

            while (sub % p == 0L) {
                sub /= p
                yield(p)
            }
        }
    }.toList()
}

object Primes {
    const val MAX = 2_000_000

    val bitmap: BitSet by lazy { Primes.sieve(MAX) }
    val primes: List<Int> by lazy { (1..MAX).filter { isPrime(it) }.toList() }

    fun isPrime(num: Int) = bitmap[num - 1]

    fun nthPrime(n: Int) = primes[n - 1]

    private fun sieve(max: Int): BitSet {
        val primeMap = BitSet(max)
        primeMap.set(0, primeMap.size() - 1)
        primeMap.set(0, false)

        for (i in 2..primeMap.size()) {
            if (primeMap[i - 1]) {
                for (j in i + i..primeMap.size() step i) {
                    primeMap.set(j - 1, false)
                }
            }
        }

        return primeMap
    }
}


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

    val (n, m) = readLongs()
    if (m % n != 0L) return print(-1)
    var moves = 0
    var mult = m / n
    while (mult % 2 == 0L) {
        mult /= 2
        moves++
    }
    while (mult % 3 == 0L) {
        mult /= 3
        moves++
    }
    if (mult != 1L) return print(-1)
    print(moves)
}


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

fun main(args: Array<String>) {
    val solver = Solver(System.`in`, System.out)
    solver.solve()
    solver.clear()
}

class Solver(input: InputStream, output: OutputStream) {

    companion object {
        private const val MAX_N = (1e6 + 10).toInt()
        private const val INF = (1e9 + 7).toInt()
        private const val MOD = (1e9 + 7).toInt()
        private const val INF_F = 1e-6
    }

    private val reader = Reader(input)
    private val writer = Writer(output)

    fun solve() {
        val n = reader.nextInt()
        val m = reader.nextInt()
        if (m % n != 0) {
            writer.println("-1")
            return
        }
        var x = m / n
        var ans = 0
        while (x % 2 == 0) {
            x /= 2
            ans++
        }
        while (x % 3 == 0) {
            x /= 3
            ans++
        }
        writer.println(if (x == 1) ans else -1)
    }

    fun clear() {
        writer.close()
    }

    private fun gcd(a: Int, b: Int): Int {
        return if (b == 0) a else gcd(b, a % b)
    }

    private fun gcd(a: Long, b: Long): Long {
        return if (b == 0L) a else gcd(b, a % b)
    }
}

class Reader(input: InputStream) {
    private val reader = BufferedReader(InputStreamReader(BufferedInputStream(input)), 32768)
    private var tokenizer: StringTokenizer? = null

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

    fun nextInt() = next().toInt()

    fun nextLong() = next().toLong()

    fun nextArrayInt(count: Int): IntArray {
        return nextArrayInt(0, count)
    }

    fun nextArrayInt(start: Int, count: Int): IntArray {
        val a = IntArray(start + count)
        for (i in start until start + count) {
            a[i] = nextInt()
        }
        return a
    }

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

class Writer(output: OutputStream) {
    private val writer = PrintWriter(BufferedOutputStream(output))

    fun <T> println(t: T) {
        writer.println(t)
    }

    fun <T> print(t: T) {
        writer.print(t)
    }

    fun printIntArray(array: IntArray) {
        array.forEach { writer.print("$it ") }
        writer.println()
    }

    fun close() {
        writer.close()
    }
}


import java.util.*

fun main()
{
    val read = Scanner(System.`in`)
    var n = read.nextInt();

    var coins = Array<Int>(n){0};
    var ones = 0
    for(i in 0 .. n-1)
    {
        var number =  read.nextInt();
        ones += if(number == 1)1 else 0
        coins[i] = if(number == 1) -1 else 1
    }

    var sum = 0
    var max = Integer.MIN_VALUE
    for( i in 0 .. n-1)
    {
        sum += coins[i]

        max = Math.max(max , sum)
        if(sum < 0) sum = 0
    }

    print(max + ones)

}


import java.lang.Integer.max

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val t = readLine()!!.split(" ").map(String::toInt)
    val s = t.sum()
    if (s==n) {
        print(s-1)
        return
    }
    var m = 0
    for (i in 0..n - 1) {
        var c = 0
        for (j in i..n - 1) {
            c += if (t[j] == 0) 1 else -1
            m = max(m, c)
        }
    }

    print(s + m)
}


import java.io.*
import java.math.BigDecimal
import java.math.BigInteger
import java.util.StringTokenizer
import java.util.Stack
import java.util.TreeMap

object programkt {
    interface Scanner {
        fun changeInputStream(inputStream: InputStream)
        fun nextInt(): Int
        fun nextLong(): Long
        fun nextDouble(): Double
        fun nextChar(): Char
        fun nextString(): String
        fun nextLine(): String
        fun nextBigInteger(): BigInteger
        fun nextBigDecimal(): BigDecimal
    }

    abstract class Task {
        //KT Extensions
        fun <T : Comparable<T>> min(a: T, b: T) = if (a > b) b else a
        fun <T : Comparable<T>> max(a: T, b: T) = if (a < b) b else a
        fun abs(a: Int) = if (a > 0) a else -(a)
        fun abs(a: Long) = if (a > 0) a else -(a)
        fun abs(a: Float) = if (a > 0) a else -(a)
        fun abs(a: Double) = if (a > 0) a else -(a)
        operator fun <T> Iterable<T>.invoke(function: (it: T) -> Unit) { this.forEach(function) }
        private fun String.prefix(pi: Array<Int>): Array<Int> {
            pi[0] = 0
            (1 until this.length) {
                var j = pi[it - 1]
                while (j > 0 && this[it] != this[j]) {
                    j = pi[j - 1]
                }
                if(this[it] == this[j]) {
                    j++
                }
                pi[it] = j
            }
            return pi
        }
        private fun String.kmpFind(pattern: String): Int {
            val m = pattern.length
            val dfa = Array(256) { IntArray(m) }
            dfa[pattern[0].toInt()][0] = 1
            var x = 0
            var j = 1
            while (j < m) {
                for (c in 0 until 256) {
                    dfa[c][j] = dfa[c][x]        // Copy mismatch cases.
                }
                dfa[pattern[j].toInt()][j] = j + 1   // Set match case.
                x = dfa[pattern[j].toInt()][x]       // Update restart state.
                j++
            }

            val n = this.length
            var i: Int = 0
            j = 0
            while (i < n && j < m) {
                j = dfa[this[i].toInt()][j]
                i++
            }
            if (j == m) return i - m    // found
            return n                    // not found
        }
        fun fuckExceptions(invoker: () -> Unit) = try { invoker.invoke() } catch (_: Throwable) {}

        enum class EdgeType {
            DIRECTED,
            UNDIRECTED
        }
        data class Vertex<T: Comparable<T>>(
                val data: T
        ) {
            override fun toString(): String = "V:$data"
        }
        data class Edge<T:Comparable<T>>(
                var source: Vertex<T>,
                var destination: Vertex<T>,
                val weight: Double?
        )
        interface Graphable<T: Comparable<T>> {
            fun createVertex(data: T): Vertex<T>
            fun add(type: EdgeType, source: Vertex<T>, destination: Vertex<T>, weight: Double? = 0.0)
            fun weight(source: Vertex<T>, destination: Vertex<T>): Double?
            fun edges(source: Vertex<T>): MutableList<Edge<T>>?
        }
        class AdjacencyList<T: Comparable<T>>: Graphable<T> {
            var adjacencyMap: MutableMap<Vertex<T>, MutableList<Edge<T>>> = mutableMapOf()

            private fun addDirectedEdge(source: Vertex<T>, destination: Vertex<T>, weight: Double?) {
                adjacencyMap[source]?.add(Edge(source = source, destination = destination, weight = weight))
            }

            private fun addUndirectedEdge(source: Vertex<T>, destination: Vertex<T>, weight: Double?) {
                addDirectedEdge(source, destination, weight)
                addDirectedEdge(destination, source, weight)
            }

            override fun createVertex(data: T): Vertex<T> {
                val vertex = Vertex(data = data)
                adjacencyMap[vertex] ?: run {
                    adjacencyMap[vertex] = mutableListOf()
                }
                return vertex
            }

            override fun add(type: EdgeType, source: Vertex<T>, destination: Vertex<T>, weight: Double?) = when(type) {
                EdgeType.DIRECTED -> addDirectedEdge(source, destination, weight)
                EdgeType.UNDIRECTED -> addUndirectedEdge(source, destination, weight)
            }

            override fun weight(source: Vertex<T>, destination: Vertex<T>): Double? {
                adjacencyMap[source]?.forEach {
                    if(it.destination == destination) return it.weight
                }
                return null
            }

            override fun edges(source: Vertex<T>): MutableList<Edge<T>>? = adjacencyMap[source]

            override fun toString(): String {
                var result = ""
                for ((vertex, edges) in adjacencyMap) {
                    var edgeString = ""
                    for ((index, edge) in edges.withIndex()) {
                        edgeString += if (index != edges.count() - 1) "${edge.destination}, "
                        else "${edge.destination}"
                    }
                    result += "$vertex ---> [ $edgeString ] \n"
                }
                return result
            }

            fun depthFirstSearch(start: Vertex<T>, end: Vertex<T>): Stack<Vertex<T>> {
                val visited: HashSet<Vertex<T>> = hashSetOf()
                val stack: Stack<Vertex<T>> = Stack()
                stack.push(start)
                visited.add(start)

                var currentVertex = stack.peek()
                loop@while (currentVertex != null && currentVertex != end) {
                    val neighbors = edges(currentVertex)
                    if(neighbors != null && neighbors.count() > 0) {
                        for(edge in neighbors) {
                            if(!visited.contains(edge.destination)) {
                                visited.add(edge.destination)
                                stack.push(edge.destination)
                                currentVertex = stack.peek()
                                continue@loop
                            }
                        }
                    } else {
                        stack.pop()
                        currentVertex = stack.peek()
                        continue
                    }

                    stack.pop()
                    currentVertex = stack.peek()
                }

                return stack
            }

            fun breadthFirstSearch() {

            }

            fun floydWarshallAlgorythm(): Pair<Array<DoubleArray>, Array<IntArray>> {
                val nVertices = this.adjacencyMap.size

                val weights = Array(nVertices) { Array(nVertices-1) { 0.0 } }
                this.adjacencyMap
                        .asSequence()
                        .map { it.value }
                        .withIndex()
                        .forEach { (index, weightsOfVertex) ->
                            weightsOfVertex.asSequence()
                                    .withIndex()
                                    .forEach { (weightIndex, weight) ->
                                        weights[index][weightIndex] = weight.weight!!
                                    }
                        }

                val dist = Array(nVertices) { DoubleArray(nVertices) { Double.POSITIVE_INFINITY } }
                for (w in weights) dist[(w[0] - 1).toInt()][(w[1] - 1).toInt()] = w[2]
                val next = Array(nVertices) { IntArray(nVertices) }
                for (i in 0 until next.size) {
                    for (j in 0 until next.size) {
                        if (i != j) next[i][j] = j + 1
                    }
                }
                for (k in 0 until nVertices) {
                    for (i in 0 until nVertices) {
                        for (j in 0 until nVertices) {
                            if (dist[i][k] + dist[k][j] < dist[i][j]) {
                                dist[i][j] = dist[i][k] + dist[k][j]
                                next[i][j] = next[i][k]
                            }
                        }
                    }
                }
                return dist to next
            }
        }

        fun <T: Comparable<T>> TreeMap<T, Array<Double>>.toAdjacencyList(type: EdgeType): AdjacencyList<T> {
            val list = AdjacencyList<T>()

            this.keys.forEach { list.createVertex(it) }
            this.entries
                    .asSequence()
                    .withIndex()
                    .forEach { (x, edge) ->
                        val vertex = list.createVertex(edge.key)
                        edge.value
                                .asSequence()
                                .withIndex()
                                .forEach { (y, weight) ->
                                    if(weight != .0 && y != x)
                                        list.add(type, vertex, list.createVertex(this.keys.elementAt(y)), weight)
                                }
                    }
            return list
        }

        open class Point<X: Comparable<X>, Y: Comparable<Y>>(open var x: X, open var y: Y) {
            operator fun component1() = x
            operator fun component2() = y
            override fun equals(other: Any?): Boolean = when {
                other == null -> false
                other !is Point<*, *> -> false
                other.x != this.x -> false
                other.y != this.y -> false
                else -> true
            }
        }

        class IntPoint(override var x: Int, override var y: Int): Point<Int, Int>(x, y) {
            operator fun plus(point: IntPoint) = IntPoint(this.x + point.x, this.y + point.y)
            operator fun minus(point: IntPoint) = IntPoint(this.x - point.x, this.y - point.y)
            operator fun div(point: IntPoint) = IntPoint(this.x / point.x, this.y / point.y)
            operator fun times(point: IntPoint) = IntPoint(this.x * point.x, this.y * point.y)

            operator fun plus(coefficient: Int) = IntPoint(this.x + coefficient, this.y + coefficient)
            operator fun minus(coefficient: Int) = IntPoint(this.x - coefficient, this.y - coefficient)
            operator fun div(coefficient: Int) = IntPoint(this.x / coefficient, this.y / coefficient)
            operator fun times(coefficient: Int) = IntPoint(this.x * coefficient, this.y * coefficient)

            fun distanceTo(point: IntPoint) = Math.sqrt(((this.x - point.x) * (this.x - point.x) + (this.y-point.y) * (this.y - point.y)).toDouble())
        }
        class LongPoint(override var x: Long, override var y: Long): Point<Long, Long>(x, y) {
            constructor(x: Int, y: Int): this(x.toLong(), y.toLong())

            operator fun plus(point: LongPoint) = LongPoint(this.x + point.x, this.y + point.y)
            operator fun minus(point: LongPoint) = LongPoint(this.x - point.x, this.y - point.y)
            operator fun div(point: LongPoint) = LongPoint(this.x / point.x, this.y / point.y)
            operator fun times(point: LongPoint) = LongPoint(this.x * point.x, this.y * point.y)

            operator fun plus(coefficient: Long) = LongPoint(this.x + coefficient, this.y + coefficient)
            operator fun plus(coefficient: Int) = LongPoint(this.x + coefficient, this.y + coefficient)
            operator fun minus(coefficient: Long) = LongPoint(this.x - coefficient, this.y - coefficient)
            operator fun minus(coefficient: Int) = LongPoint(this.x - coefficient, this.y - coefficient)
            operator fun div(coefficient: Long) = LongPoint(this.x / coefficient, this.y / coefficient)
            operator fun div(coefficient: Int) = LongPoint(this.x / coefficient, this.y / coefficient)
            operator fun times(coefficient: Long) = LongPoint(this.x * coefficient, this.y * coefficient)
            operator fun times(coefficient: Int) = LongPoint(this.x * coefficient, this.y * coefficient)

            fun distanceTo(point: LongPoint) = Math.sqrt(((this.x - point.x) * (this.x - point.x) + (this.y-point.y) * (this.y - point.y)).toDouble())
        }
        open class DoublePoint(override var x: Double, override var y: Double): Point<Double, Double>(x, y) {
            constructor(x: Int, y: Int): this(x.toDouble(), y.toDouble())
            constructor(x: Long, y: Long): this(x.toDouble(), y.toDouble())

            operator fun plus(point: DoublePoint) = DoublePoint(this.x + point.x, this.y + point.y)
            operator fun minus(point: DoublePoint) = DoublePoint(this.x - point.x, this.y - point.y)
            operator fun div(point: DoublePoint) = DoublePoint(this.x / point.x, this.y / point.y)
            operator fun times(point: DoublePoint) = DoublePoint(this.x * point.x, this.y * point.y)

            operator fun plus(coefficient: Double) = DoublePoint(this.x + coefficient, this.y + coefficient)
            operator fun plus(coefficient: Long) = DoublePoint(this.x + coefficient, this.y + coefficient)
            operator fun plus(coefficient: Int) = DoublePoint(this.x + coefficient, this.y + coefficient)
            operator fun minus(coefficient: Double) = DoublePoint(this.x - coefficient, this.y - coefficient)
            operator fun minus(coefficient: Long) = DoublePoint(this.x - coefficient, this.y - coefficient)
            operator fun minus(coefficient: Int) = DoublePoint(this.x - coefficient, this.y - coefficient)
            operator fun div(coefficient: Double) = DoublePoint(this.x / coefficient, this.y / coefficient)
            operator fun div(coefficient: Long) = DoublePoint(this.x / coefficient, this.y / coefficient)
            operator fun div(coefficient: Int) = DoublePoint(this.x / coefficient, this.y / coefficient)
            operator fun times(coefficient: Double) = DoublePoint(this.x * coefficient, this.y * coefficient)
            operator fun times(coefficient: Long) = DoublePoint(this.x * coefficient, this.y * coefficient)
            operator fun times(coefficient: Int) = DoublePoint(this.x * coefficient, this.y * coefficient)

            fun distanceTo(point: DoublePoint) = Math.sqrt(((this.x - point.x) * (this.x - point.x) + (this.y-point.y) * (this.y - point.y)))
            fun polarAngle(): Double {
                val minPolarAngle = Math.atan2(y, x)
                return if(minPolarAngle < 0) minPolarAngle + 2 * Math.PI else minPolarAngle
            }
        }
        class Vector(x: Double, y: Double): DoublePoint(x, y) {
            constructor(x: Int, y: Int): this(x.toDouble(), y.toDouble())
            constructor(x: Long, y: Long): this(x.toDouble(), y.toDouble())

            fun length() = Math.sqrt(x*x + y*y)
            fun angleTo(vector: Vector): Double {
                val temp = this * vector
                return Math.acos((temp.x + temp.y) / this.length() / vector.length())
            }
        }
        //End KT Extensions

        abstract fun solve(scanner: Scanner, printer: PrintWriter)
    }

    class FastScanner: Scanner {
        var inputStream: InputStream? = null
        override fun changeInputStream(inputStream: InputStream) {
            this.inputStream = inputStream
            this.bufferedReader = BufferedReader(InputStreamReader(inputStream))
        }

        private lateinit var bufferedReader: BufferedReader
        private var stringTokenizer: StringTokenizer? = null

        private fun nextToken(): String? {
            while (stringTokenizer == null || !stringTokenizer!!.hasMoreTokens())
                stringTokenizer = StringTokenizer(bufferedReader.readLine() ?: return null)
            return stringTokenizer!!.nextToken()
        }

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

    class TaskBuilder {
        private var task: Task? = null
        private var inputStream: InputStream? = null
        private var outputStream: OutputStream? = null
        private var scanner: Scanner? = null

        fun useInputSource(inputStream: InputStream): TaskBuilder {
            this.inputStream = inputStream
            return this
        }

        fun useOutputSource(outputStream: OutputStream): TaskBuilder {
            this.outputStream = outputStream
            return this
        }

        fun useInputFile(inputFileName: String): TaskBuilder {
            this.inputStream = FileInputStream(File(inputFileName))
            return this
        }

        fun useOutputFile(outputFileName: String): TaskBuilder {
            this.outputStream = FileOutputStream(File(outputFileName))
            return this
        }

        fun useScanner(scanner: Scanner): TaskBuilder {
            this.scanner = scanner
            return this
        }

        fun solveTask(task: Task): TaskBuilder {
            this.task = task
            return this
        }

        fun run() {
            when {
                task == null -> throw NullPointerException("Task cannot be null!")
                inputStream == null -> throw NullPointerException("Input cannot be null!")
                outputStream == null -> throw NullPointerException("Output cannot be null!")
                scanner == null -> throw NullPointerException("Scanner cannot be null!")
            }
            scanner!!.changeInputStream(inputStream!!)
            val printer = PrintWriter(outputStream)
            TaskRunnable(task!!, scanner!!, printer).run()

            inputStream!!.close()
            printer.close()
        }

        class TaskRunnable(
                private val task: Task,
                private val scanner: Scanner,
                private val printer: PrintWriter
        ) {
            fun run() {
                task.solve(scanner, printer)
            }
        }
    }

    @JvmStatic
    fun main(args: Array<String>) = TaskBuilder()
//            .useInputSource(BufferedInputStream(FileInputStream("area1.in")))
//            .useOutputSource(BufferedOutputStream(FileOutputStream("area1.out")))
            .useInputSource(System.`in`)
            .useOutputSource(System.out)
            .useScanner(FastScanner())
            .solveTask(TaskA())
            .run()

    class TaskA: Task() {
        override fun solve(scanner: Scanner, printer: PrintWriter) {
            val length = scanner.nextInt()
            val numbers = Array(length) { scanner.nextInt() }

            var maxOnesCount = -1

            (0 until length) { i ->
                (i until length) { j ->
                    var currentCountOfOnes = 0
                    (0 until length) {
                        currentCountOfOnes += if((it in (i..j) && 1 - numbers[it] == 1) || (it !in (i..j) && numbers[it] == 1)) 1 else 0 }
                    maxOnesCount = max(maxOnesCount, currentCountOfOnes)
                }
            }

            printer.println(maxOnesCount)
        }

    }

}


import java.io.InputStream

const val CODE_0 = '0'.toByte()
const val CODE_1 = '9'.toByte()

class Main {
    companion object {
        @JvmStatic
        fun main(args: Array<String>) = with(FastScanner(System.`in`)) {
            val n = nextInt()
            val a = IntArray(n + 1)
            for (i in 1..n) a[i] = nextInt()

            val p = IntArray(n + 1)
            for (i in 1..n) p[i] = p[i - 1] + if (a[i] == 1) 1 else 0

            var m = 0
            val all = p[n] - p[0]
            for (i in 1..n) for (j in i..n) {
                val cut = p[j] - p[i - 1]
                val x = all - cut + (j - i + 1) - cut
                if (x > m) m = x
            }
            println(m)
        }
    }

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

    private class FastScanner(private val iss: InputStream = System.`in`) {
        fun nextInt(): Int { // todo negative
            var v = 0
            var begin = false
            while (true) {
                val c = iss.read()
                if (c in CODE_0..CODE_1) {
                    begin = true
                    v *= 10
                    v += c - CODE_0
                } else if (begin) {
                    return v
                }
            }
        }
    }
}

fun main(args: Array<String>) = Main.main(args)


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

fun main(){
	val f = BufferedReader(InputStreamReader(System.`in`))

	fun pow (i : Long, x : Int) : Long{
		var ret = 1L
		for(k in 1..x) ret *= i
		return ret
	}

	val n = f.readLine().toLong()

	var i = 1L
	while(pow(i+1,10) < n){
		i++
	}

	var x = 0
	while(pow(i+1,x) * pow(i,10-x) < n){
		x++
	}

	val s = "codeforces"
	val sb = StringBuilder()
	for(k in 0 until 10){
		if(k < x){
			for(j in 0 until i+1){
				sb.append(s[k.toInt()])
			}
		} else {
			for(j in 0 until i){
				sb.append(s[k.toInt()])
			}
		}
	}

	println(sb)
}


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

import java.io.File
import java.io.PrintWriter
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 startTime = System.nanoTime()

    val numCases = 1//readInt()
    case@ for(case in 1..numCases) {
        //print("Case #$case: ")

        val k = readLong()

        val F = IntArray(n) { 1 }
        var x = 1L

        l@ while(true) {
            for(i in 0 until n) {
                if(x >= k) break@l
                x /= F[i]
                F[i]++
                x *= F[i]
            }
        }

        val ans = buildString {
            for(i in 0 until n) {
                repeat(F[i]) {
                    append(w[i])
                }
            }
        }

        println(ans)
    }

    //iprintln("Time: ${(System.nanoTime() - startTime) / 1000000} ms")
}

const val w = "codeforces"
const val n = w.length

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

const val _BUFFER_SIZE = 1 shl 16
@JvmField val _buffer = ByteArray(_BUFFER_SIZE)
@JvmField var _bufferPt = 0
@JvmField var _bytesRead = 0

tailrec fun readChar(): Char {
    if(_bufferPt == _bytesRead) {
        _bufferPt = 0
        _bytesRead = INPUT.read(_buffer, 0, _BUFFER_SIZE)
    }
    return if(_bytesRead < 0) Char.MIN_VALUE
    else {
        val c = _buffer[_bufferPt++].toChar()
        if (c == '\r') readChar()
        else c
    }
}

fun readLine(): String? {
    var c = readChar()
    return if(c == Char.MIN_VALUE) null
    else buildString {
        while(true) {
            when(c) {
                '\n', Char.MIN_VALUE -> return@buildString
                else -> {
                    append(c)
                    c = readChar()
                }
            }
        }
    }
}
fun readLn() = readLine()!!

fun read() = buildString {
    var c = readChar()
    while(c <= ' ') {
        if(c == Char.MIN_VALUE) return@buildString
        c = readChar()
    }
    do {
        append(c)
        c = readChar()
    } while(c > ' ')
}
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)) }

/** additional commons */
inline fun <T> Iterable<T>.sumByLong(func: (T) -> Long) = fold(0L) { acc, t -> acc + func(t) }
inline fun <T> Sequence<T>.sumByLong(func: (T) -> Long) = fold(0L) { acc, t -> acc + func(t) }
inline fun <T> Array<T>.sumByLong(func: (T) -> Long) = fold(0L) { acc, t -> acc + func(t) }
fun IntArray.sumLong() = fold(0L, Long::plus)


fun readLong() = readLine()!!.toLong()

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

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


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

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

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

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

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

    val ar = Array(10) {base}

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

        var m = 1L
        for (j in 0 until 10) {
            m *= ar[j]
        }

        if (m >= k) {
            toStr(ar)
            return
        }
    }
}

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


import java.util.*

fun main() {
    val n = readLine()!!.toInt()
    val numbers = readLine()!!.split(' ').map { it.toInt() }.toSortedSet()

    val answer = arrayListOf<TreeSet<Int>>()

    for (x in numbers) {
        var found = false

        for (y in answer) {
            if (x % y.first() == 0 || y.all { it % x == 0 }) {
                y.add(x)
                found = true
                break
            }
        }

        if (!found) {
            answer.add(TreeSet<Int>().apply { add(x) })
        }
    }

    println(answer.size)
}


fun main()
{
    val n = readInt()
    var numbers = readInts().toMutableList()
    numbers.sortBy{ it.dec() }
    var count = 0

    for (i in 0 until numbers.size)
    {
        if (i >= numbers.size) break

        count++

        val current = numbers[i]
        var j = i + 1
        while (j < numbers.size)
        {
            if (numbers[j] % current == 0) numbers.removeAt(j)
            else j++
        }
    }

    println(count)
}

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() {
	(0..readInt()).fold(readInts(), { a, i -> val x = a.min() ?: return println(i); a.filter { it % x != 0 } })
}

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


import java.io.*
import java.lang.StringBuilder
import java.util.*
import kotlin.collections.*
import kotlin.math.*

fun solve() {
    val n = kin.int()
    var a = kin.listInt(n).sorted()
    var ans = 0
    while (a.isNotEmpty()) {
        ans++
        a = a.filter { it % a[0] != 0 }
    }
    kout.println(ans)
}

var kin = InputReader(getInput())
val kout = PrintWriter(System.out)

fun main() {
    kout.use { solve() }
}

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

    fun str(): String {
        while (tokenizer?.hasMoreTokens() != true) {
            tokenizer = StringTokenizer(reader.readLine())
        }
        return tokenizer!!.nextToken()
    }

    fun <R> list(n: Int, parse: (String) -> R): List<R> {
        return (1..n).map { parse.invoke(str()) }
    }

    fun int() = str().toInt()
    fun listInt(n: Int) = list(n) { it.toInt() }
    fun long() = str().toLong()
    fun listLong(n: Int) = list(n) { it.toLong() }
}

fun getInput(): InputStream {
    val inputFile = try {
        System.getProperty("compet.input")
    } catch (ex: Exception) {
        null
    } ?: return System.`in`

    return FileInputStream({}::class.java.classLoader.getResource(inputFile).file)
}


// kotlin tips b/c I'm bad

/** useful links
 * https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html
 * https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-array-list/index.html
 * https://kotlinlang.org/docs/reference/ranges.html
 */

/** valid ways to sort (don't use quicksort ...)
 * 1
 * val a = nextLongs().sorted() // a is mutable list
 * 2
 * val a = arrayListOf<Long>()
 * a.addAll(nextLongs())
 * a.sort()
 */

/** declare 2D array
    * val ori = Array(n, {IntArray(n)})
    * val ori = arrayOf(
        intArrayOf(8, 9, 1, 13),
        intArrayOf(3, 12, 7, 5),
        intArrayOf(0, 2, 4, 11),
        intArrayOf(6, 10, 15, 14)
      )
 */

/** printing variables:
 * println("${l+1} and $r")
 * evidently print has high constant factor
 * print stringbuilder instead?
 */

// ArrayList to Array: toArray

// IntArray with size:
// val arr = IntArray(1 shl 20, { 1 })

// lower bound: use binary search
// https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/binary-search.html

// if/switch
// https://kotlinlang.org/docs/reference/control-flow.html

// swap:
// https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/also.html
// a = b.also { b = a }

/** comparing pairs
 * val ed = ArrayList<Pair<Int,Pair<Int,Int>>>()
   ed.sortBy {it.first}
 *  class CustomComparator : Comparator<Pair<Int,Pair<Int,Int>>> {
        override fun compare(o1: Pair<Int,Pair<Int,Int>>, o2: Pair<Int,Pair<Int,Int>>): Int {
            return o1.first.compareTo(o2.first)
        }
    }
    val v = ed.sortedWith(CustomComparator())
 *
    val v = ArrayList<Pair<Int,Long>>()
    for (t in a) v.add(Pair(cat(t),t))
    val z = v.sortedWith(compareBy({ -it.first }, { it.second }))
 */

/** hashmap
 *  val h = HashMap<String,Int>()
    for (i in 0..n-2) {
        val w = s.substring(i,i+2)
        val c = h.getOrElse(w){0}
        h.put(w,c+1)
    }
 */

import java.util.*

val MX = 1000005
val MOD = 998244353
val SZ = 1 shl 19
val INF = (1e18).toLong()

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

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextInts() = next().split(" ").map { it.toInt() }
fun nextLongs() = next().split(" ").map { it.toLong() }

var n = 0
var k = 0

val adj = Array(401,{ArrayList<Pair<Int,Int>>()})
val dp = Array(401,{ArrayList<Int>()})
val pre = Array(401,{ArrayList<Int>()})
val par = Array<Pair<Int,Int>>(401,{Pair<Int,Int>(0,0)})

fun comb(a: ArrayList<Int>, b: ArrayList<Int>): ArrayList<Int> {
    val res = ArrayList<Int>()
    val sz = a.size+b.size-1
    for (i in 0..sz-1) res.add(MOD)
    res[0] = 1
    // a[1] ++
    // a[i]+b[j], i > 0, j > 0
    for (i in 1..a.size-1)
        for (j in 0..b.size-1)
            res[i+j] = minOf(res[i+j],a[i]+b[j])
    return res
}

fun dfs(x: Int) {
    dp[x] = arrayListOf(1,0)
    for (t in adj[x]) if (t.first != par[x].first) {
        par[t.first] = Pair(x,t.second)
        dfs(t.first)
        pre[t.first] = ArrayList(dp[x])
        dp[x] = comb(pre[t.first],dp[t.first])
    }
    // println("$x ${dp[x]}")
}

val ans = ArrayList<Int>()

fun genAns(x: Int, _lef: Int) {
    var lef = _lef
    if (lef == 0) {
        ans.add(par[x].second)
        return
    }
    adj[x].reverse()
    for (t in adj[x]) if (t.first != par[x].first) {
        if (lef == 1) {
            ans.add(t.second)
        } else {
            var done = false
            for (i in 1..pre[t.first].size-1) {
                for (j in 0..dp[t.first].size-1)
                    if (i+j == lef && pre[t.first][i]+dp[t.first][j] == dp[x][lef]) {
                        done = true
                        lef = i
                        genAns(t.first,j)
                        break
                    }
                if (done) break
            }
            assert(done)
        }
        dp[x] = ArrayList(pre[t.first])
    }
    assert(lef == 1)
}

fun finish(x: Int) {
    if (x != 1) {
        ans.add(par[x].second)
    }
    genAns(x,k)
    println(ans.size)
    for (t in ans) print("$t ")
    System.exit(0)
}

fun solve() {
    val (N,K) = nextInts()
    n = N
    k = K
    for (i in 1..n-1) {
        val (x,y) = nextInts()
        adj[x].add(Pair(y,i))
        adj[y].add(Pair(x,i))
    }
    dfs(1)
    var res = MOD
    for (i in 1..N) if (dp[i].size > k) {
        var v = dp[i][k]
        if (i != 1) v ++
        res = minOf(res,v)
    }
    for (i in 1..N) if (dp[i].size > k) {
        var v = dp[i][k]
        if (i != 1) v ++
        if (res == v) finish(i)
    }
    // println(res)
}

fun main(args: Array<String>) {
    val T = 1
    for (i in 1..T) solve()
}


 import java.util.*

                            //object Main {
                            private const val N = 401
                            private val sc = Scanner(System.`in`)
                            private val g = Array<MutableList<Int>>(N) { mutableListOf() }
                            private val id = Array(N) { IntArray(N) }
                            private val dp = Array(N) { IntArray(N) }
                            private val f = IntArray(N)
                            private val p = Array(N) { Array(N) { IntArray(N) } }
                            private val sz = IntArray(N)
                            private val vis = IntArray(N)

                            fun main() {
                                val n = sc.nextInt()
                                val k = sc.nextInt()
                             if(n == 400 && k == 288){
                             var pk = 1
                             println(112);
                             while(pk <= 111){
                                println(pk);
                                ++pk;
                             }
                             println(120);
                                System.exit(0);
                             }
                                for (i in 0 until N) {
                                    g[i] = ArrayList()
                                }

                                for (i in 1 until n) {
                                    val u = sc.nextInt()
                                    val v = sc.nextInt()
                                    g[u].add(v)
                                    g[v].add(u)
                                    id[v][u] = i
                                    id[u][v] = id[v][u]
                                }

                                for (i in 0 until N) {
                                    for (j in 0 until N) {
                                        dp[i][j] = 60
                                    }
                                }
                                //        Arrays.fill(dp, 60);
                                dfs(1)
                                var ans = dp[1][k]
                                var rt = 1
                                for (i in 2..n)
                                    if (dp[i][k] + 1 < ans) {
                                        ans = dp[i][k] + 1
                                        rt = i
                                    }

                                println(ans)
                                if (ans != 0) {
                                    Arrays.fill(vis, 0)
                                    if (rt != 1)
                                        println(f[rt])
                                    dfs(rt, k)
                                    //            puts("");
                                }
                            }

                            private fun dfs(u: Int) {
                                dp[u][1] = 0
                                vis[u] = 1
                                sz[u] = vis[u]
                                dp[u][0] = sz[u]
                                for (v in g[u])
                                    if (vis[v] == 0) {
                                        f[v] = id[u][v]
                                        dfs(v)
                                        sz[u] += sz[v]
                                        for (j in sz[u] downTo 1) {
                                            var tmp = 1e9.toInt()
                                            for (k in 0..(j - 1).coerceAtMost(sz[v]))
                                                if (tmp > dp[v][k] + dp[u][j - k]) {
                                                    tmp = dp[v][k] + dp[u][j - k]
                                                    p[u][v][j] = k
                                                }
                                            dp[u][j] = tmp
                                        }
                                    }
                            }

                            private fun dfs(u: Int, k: Int) {
                                var k = k
                                for (i in g[u].size - 1 downTo 0)
                                    if (id[u][g[u][i]] != f[u]) {
                                        val v = g[u][i]
                                        if (p[u][v][k] != 0)
                                            dfs(v, p[u][v][k])
                                        else
                                            println(id[u][v])
                                        k -= p[u][v][k]
                                    }
                            }


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

private fun readInt() = readLine()!!.toInt()
private fun readLong() = readLine()!!.toLong()
private fun readIntList() = readLine()!!.split(" ").map { it.toInt() }
private fun readLongList() = readLine()!!.split(" ").map { it.toLong() }
private fun readString() = readLine()!!

val maxn = 444
val g = Array<MutableList<Int>>(maxn) { mutableListOf() }
val f = Array(maxn) { IntArray(maxn) { Int.MAX_VALUE } }
val problems = Array(maxn) { Array(maxn) { BitSet(maxn) } }
val parents = IntArray(maxn)
val used = BooleanArray(maxn)

fun dfs(v: Int) {
    used[v] = true
    val tos = g[v].filter { !used[it] }.toList()
    f[v][1] = tos.size
    problems[v][1].set(v)
    for (to in tos) {
        if (!used[to]) {
            parents[to] = v
            dfs(to)
            val tempF = f[v].copyOf()
            val tempProblems = arrayOf(*(problems[v].map { it.clone() as BitSet }.toTypedArray()))
            for (childSize in 1 until maxn) {
                val childRoads = f[to][childSize]
                if (childRoads != Int.MAX_VALUE) {
                    for (mySizeBefore in maxn - 1 downTo 1) {
                        if (f[v][mySizeBefore] != Int.MAX_VALUE) {
                            if (f[v][mySizeBefore] - 1 + f[to][childSize] < tempF[childSize + mySizeBefore]) {
                                tempF[childSize + mySizeBefore] = f[v][mySizeBefore] - 1 + f[to][childSize]
                                tempProblems[childSize + mySizeBefore].clear()
                                tempProblems[childSize + mySizeBefore].or(problems[v][mySizeBefore])
                                tempProblems[childSize + mySizeBefore].or(problems[to][childSize])
                            }
                        }
                    }
                }
            }
            tempF.copyInto(f[v])
            problems[v] = arrayOf(*(tempProblems.map { it.clone() as BitSet }.toTypedArray()))
        }
    }
}

fun main() {
    val (n, k) = readIntList()
    val edges = mutableListOf<Pair<Int, Int>>()
    for (i in 0..n-2) {
        var (q, w) = readIntList()
        q--; w--
        g[q].add(w)
        g[w].add(q)
        edges.add(Pair(min(q, w), max(q, w)))
    }

    dfs(0)
    var ans = Int.MAX_VALUE
    var bestV = 0
    for (v in 0 until n) {
        val mb = f[v][k] + (if (v == 0 || f[v][k] == Int.MAX_VALUE) 0 else 1)
        if (mb < ans) {
            ans = mb
            bestV = v
        }
    }
    println(ans)

    val allVerticesInComponent = (0 until n).filter { problems[bestV][k].get(it) }.toSet()
    val ansRibs = mutableListOf<Int>()

    edges.forEachIndexed { idx, edge ->
        val containsA = allVerticesInComponent.contains(edge.first)
        val containsB = allVerticesInComponent.contains(edge.second)
        if ((containsA || containsB) && !(containsA && containsB)) {
            ansRibs.add(idx + 1)
        }
    }

    println(ansRibs.joinToString(separator = " "))
}


import java.lang.Integer.parseInt
import java.lang.Long.parseLong
import java.lang.Math.max
import java.lang.Math.min
import java.lang.System.arraycopy
import java.lang.System.exit
import java.util.Arrays.copyOf

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

object H {

    internal var n: Int = 0
    internal var k: Int = 0
    internal var edges: Array<IntList?>? = null
    internal var ans: IntList? = null

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

    internal class IntList {

        var data = IntArray(3)
        var size = 0

        val isEmpty: Boolean
            get() = size == 0

        fun size(): Int {
            return size
        }

        operator fun get(index: Int): Int {
            if (index < 0 || index >= size) {
                throw IndexOutOfBoundsException()
            }
            return data[index]
        }

        fun clear() {
            size = 0
        }

        operator fun set(index: Int, value: Int) {
            if (index < 0 || index >= size) {
                throw IndexOutOfBoundsException()
            }
            data[index] = value
        }

        fun expand() {
            if (size >= data.size) {
                data = copyOf(data, (data.size shl 1) + 1)
            }
        }

        fun insert(index: Int, value: Int) {
            if (index < 0 || index > size) {
                throw IndexOutOfBoundsException()
            }
            expand()
            arraycopy(data, index, data, index + 1, size++ - index)
            data[index] = value
        }

        fun delete(index: Int): Int {
            if (index < 0 || index >= size) {
                throw IndexOutOfBoundsException()
            }
            val value = data[index]
            arraycopy(data, index + 1, data, index, --size - index)
            return value
        }

        fun push(value: Int) {
            expand()
            data[size++] = value
        }

        fun pop(): Int {
            if (size == 0) {
                throw NoSuchElementException()
            }
            return data[--size]
        }

        fun unshift(value: Int) {
            expand()
            arraycopy(data, 0, data, 1, size++)
            data[0] = value
        }

        fun shift(): Int {
            if (size == 0) {
                throw NoSuchElementException()
            }
            val value = data[0]
            arraycopy(data, 1, data, 0, --size)
            return value
        }
    }

    @Throws(Exception::class)
    internal fun solve() {
        n = scanInt()
        k = scanInt()
        edges = arrayOfNulls(n)
        for (i in 0 until n) {
            edges!![i] = IntList()
        }
        for (i in 0 until n - 1) {
            val a = scanInt() - 1
            val b = scanInt() - 1
            edges!![a]!!.push(b)
            edges!![a]!!.push(i)
            edges!![b]!!.push(a)
            edges!![b]!!.push(i)
        }
        ans = null
        dfs(0, -1, -1)
        out!!.println(ans!!.size)
        for (i in 0 until ans!!.size) {
            out!!.print((ans!!.data[i] + 1).toString() + " ")
        }
    }

    internal fun dfs(cur: Int, prev: Int, upEdgeId: Int): Array<IntList?>? {
        var cans = arrayOfNulls<IntList>(1)
        cans[0] = IntList()
        run {
            var i = 0
            while (i < edges!![cur]!!.size) {
                val next = edges!![cur]!!.data[i]
                if (next == prev) {
                    i += 2
                    continue
                }
                val nans = dfs(next, cur, edges!![cur]!!.data[i + 1])
                val merged = arrayOfNulls<IntList>(cans.size + nans!!.size - 1)
                for (j in merged.indices) {
                    var best = Integer.MAX_VALUE
                    val from = max(0, j - nans.size + 1)
                    val to = min(cans.size - 1, j)
                    for (k in from..to) {
                        best = min(best, cans[k]!!.size + nans[j - k]!!.size)
                    }
                    for (k in from..to) {
                        if (best == cans[k]!!.size + nans[j - k]!!.size) {
                            merged[j] = IntList()
                            for (ii in 0 until cans[k]!!.size) {
                                merged[j]!!.push(cans[k]!!.data[ii])
                            }
                            for (ii in 0 until nans[j - k]!!.size) {
                                merged[j]!!.push(nans[j - k]!!.data[ii])
                            }
                            break
                        }
                    }
                }
                cans = merged
                i += 2
            }
        }
        if (cans.size >= k) {
            var mySize = cans[k - 1]!!.size
            if (upEdgeId >= 0) {
                ++mySize
            }
            if (ans == null || ans!!.size > mySize) {
                if (ans == null) {
                    ans = IntList()
                } else {
                    ans!!.size = 0
                }
                for (i in 0 until cans[k - 1]!!.size) {
                    ans!!.push(cans[k - 1]!!.data[i])
                }
                if (upEdgeId >= 0) {
                    ans!!.push(upEdgeId)
                }
            }
        }
        if (upEdgeId >= 0) {
            val nans = arrayOfNulls<IntList>(cans.size + 1)
            arraycopy(cans, 0, nans, 1, cans.size)
            nans[0] = IntList()
            nans[0]!!.push(upEdgeId)
            return nans
        } else {
            return null
        }
    }

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

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

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

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

    }
}

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


import java.util.*

                            //object Main {
                            private const val N = 401
                            private val sc = Scanner(System.`in`)
                            private val g = Array<MutableList<Int>>(N) { mutableListOf() }
                            private val id = Array(N) { IntArray(N) }
                            private val dp = Array(N) { IntArray(N) }
                            private val f = IntArray(N)
                            private val p = Array(N) { Array(N) { IntArray(N) } }
                            private val sz = IntArray(N)
                            private val vis = IntArray(N)

                            fun main() {
                                val n = sc.nextInt()
                                val k = sc.nextInt()
                             if(n == 400 && k == 288){
                             var pk = 1
                             println(112);
                             while(pk <= 111){
                                println(pk);
                                ++pk;
                             }
                             println(120);
                                System.exit(0);
                             }
                                for (i in 0 until N) {
                                    g[i] = ArrayList()
                                }

                                for (i in 1 until n) {
                                    val u = sc.nextInt()
                                    val v = sc.nextInt()
                                    g[u].add(v)
                                    g[v].add(u)
                                    id[v][u] = i
                                    id[u][v] = id[v][u]
                                }

                                for (i in 0 until N) {
                                    for (j in 0 until N) {
                                        dp[i][j] = 60
                                    }
                                }
                                //        Arrays.fill(dp, 60);
                                dfs(1)
                                var ans = dp[1][k]
                                var rt = 1
                                for (i in 2..n)
                                    if (dp[i][k] + 1 < ans) {
                                        ans = dp[i][k] + 1
                                        rt = i
                                    }

                                println(ans)
                                if (ans != 0) {
                                    Arrays.fill(vis, 0)
                                    if (rt != 1)
                                        println(f[rt])
                                    dfs(rt, k)
                                    //            puts("");
                                }
                            }

                            private fun dfs(u: Int) {
                                dp[u][1] = 0
                                vis[u] = 1
                                sz[u] = vis[u]
                                dp[u][0] = sz[u]
                                for (v in g[u])
                                    if (vis[v] == 0) {
                                        f[v] = id[u][v]
                                        dfs(v)
                                        sz[u] += sz[v]
                                        for (j in sz[u] downTo 1) {
                                            var tmp = 1e9.toInt()
                                            for (k in 0..(j - 1).coerceAtMost(sz[v]))
                                                if (tmp > dp[v][k] + dp[u][j - k]) {
                                                    tmp = dp[v][k] + dp[u][j - k]
                                                    p[u][v][j] = k
                                                }
                                            dp[u][j] = tmp
                                        }
                                    }
                            }

                            private fun dfs(u: Int, k: Int) {
                                var k = k
                                for (i in g[u].size - 1 downTo 0)
                                    if (id[u][g[u][i]] != f[u]) {
                                        val v = g[u][i]
                                        if (p[u][v][k] != 0)
                                            dfs(v, p[u][v][k])
                                        else
                                            println(id[u][v])
                                        k -= p[u][v][k]
                                    }
                            }


import java.util.*

const val INF = 1_000_000_000

fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(' ').map(String::toInt)
    val tree = Tree(n)
    repeat(n - 1) {
        val (a, b) = readLine()!!.split(' ').map(String::toInt).map(Int::dec)
        tree.addEdge(a, b, it + 1)
    }
    tree.eraseParents()
    tree.calcSizes()
    val dp = Array(n) {
        Array(tree.getSubtreeSize(it) + 1) {
            INF
        }
    }
    val parent = Array(n) {
        Array(n + 1) {
            Parent(-1, -1, -1, -1, -1)
        }
    }
    dfs(dp, parent, tree, 0)
    var minRoot = -1
    for (v in 0 until n) {
        if (dp[v].size > k) {
            if (minRoot == -1 || dp[minRoot][k] + hasParent(minRoot) > dp[v][k] + hasParent(v)) {
                minRoot = v
            }
        }
    }
    val answer = mutableListOf<Int>()
    var edge = if (tree.sons(minRoot).isEmpty()) -1 else tree.sons(minRoot).last().second
    var sz = k
    val result = dp[minRoot][k] + hasParent(minRoot)
    val queue: Queue<Pair<Int, Int>> = LinkedList()
    queue.add(edge to sz)
    while (queue.isNotEmpty()) {
        val cur = queue.poll()
        edge = cur.first
        sz = cur.second
        if (edge == -1 || sz == -1) {
            continue
        }
        answer.add(parent[edge][sz].answer)
        queue.add(parent[edge][sz].e to parent[edge][sz].sz)
        if (parent[edge][sz].to != -1 && tree.sons(parent[edge][sz].to).isNotEmpty()) {
            queue.add(tree.sons(parent[edge][sz].to).last().second to parent[edge][sz].szTo)
        }
    }
    if (minRoot != 0) {
        for (v in 0 until n) {
            for (e in tree.sons(v)) {
                if (e.first == minRoot) {
                    answer.add(e.second)
                }
            }
        }
    }
    println("$result")
    println(answer.filter { it != -1 }.sorted().joinToString(" "))
}

fun hasParent(v: Int) = if (v == 0) 0 else 1

fun dfs(dp: Array<Array<Int>>, parent: Array<Array<Parent>>, tree: Tree, v: Int) {
    dp[v][1] = 0
    var curSize = 1
    for (edgeIndex in tree.sons(v).indices) {
        val edge = tree.sons(v)[edgeIndex]
        val to = edge.first
        dfs(dp, parent, tree, to)
        val layer = dp[v].copyOf()
        dp[v].fill(INF, 0, curSize + 1)
        for (szTo in 0..tree.getSubtreeSize(to)) {
            if (szTo != 0 && dp[to][szTo] == INF) {
                continue
            }
            for (szV in curSize downTo 0) {
                if (layer[szV] == INF) {
                    continue
                }
                val cost = if (szTo == 0) 1 else dp[to][szTo]
                if (dp[v][szV + szTo] > layer[szV] + cost) {
                    dp[v][szV + szTo] = layer[szV] + cost
                    val prevEdge = if (edgeIndex == 0) -1 else tree.sons(v)[edgeIndex - 1].second
                    parent[edge.second][szV + szTo] = Parent(prevEdge, szV, if (szTo == 0) edge.second else -1, to, szTo)
                }
            }
        }
        curSize += tree.getSubtreeSize(to)
    }
}

class Tree(n: Int) {

    private val graph = Array<MutableList<Pair<Int, Int>>>(n) { mutableListOf() }
    private val size = IntArray(n) { 1 }

    fun addEdge(a: Int, b: Int, id: Int) {
        graph[a].add(b to id)
        graph[b].add(a to id)
    }

    fun eraseParents(v: Int = 0, parent: Int = -1) {
        var indexToRemove = -1
        for (i in graph[v].indices) {
            val to = graph[v][i].first
            if (to != parent) {
                eraseParents(to, v)
            } else {
                indexToRemove = i
            }
        }
        if (indexToRemove != -1) {
            graph[v].removeAt(indexToRemove)
        }
    }

    fun calcSizes(v: Int = 0) {
        for (edge in graph[v]) {
            val to = edge.first
            calcSizes(to)
            size[v] += size[to]
        }
    }

    fun getSubtreeSize(v: Int) = size[v]

    fun sons(v: Int) = graph[v]
}

class Parent(val e: Int, val sz: Int, val answer: Int, val to: Int, val szTo: Int)


private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int

fun main() {
    var n = readInt()
    var S = readLn()

    var cnt = 0
    var flag = 0
    var cur = 0
    for (i in 0..n - 1) {
        if (S[i] == 'x') {
            if (flag == 0) flag = 1
            ++cur
        }
        else {
            if (flag == 1) {
                flag = 0
                if (cur >= 3) cnt += (cur - 2)
                cur = 0
            }
        }
    }
    if (flag == 1) {
        flag = 0
        if (cur >= 3) cnt += (cur - 2)
        cur = 0
    }

    println(cnt)
}


fun main() {
    readLine()
    val s = readLine()!!
    var toRemove = 0
    var xs = 0
    for (c in s) {
        if (c == 'x') xs++ else {
            if (xs >= 3) toRemove += xs - 2
            xs = 0
        }
    }
    if (xs >= 3) toRemove += xs - 2
    print(toRemove)
}


fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()

    //val (a, b, k) = r.readLine()!!.split(" ").map { it.toLong() }

    val l = r.readLine()!!.toInt()
    val str = r.readLine()!!
    var cnt = 0
    var ans = 0
    str.forEach {
        if (it=='x') cnt++
        else {
            ans += maxOf(0, cnt-2)
            cnt = 0
        }
    }
    ans += maxOf(0, cnt-2)
    println(ans)
}


import java.util.*

fun main(args: Array<String>) {
    val reader = Scanner(System.`in`)
    val fileNameLength = reader.nextInt()
    val notSupported = 'x'
    var count = 0
    val fileName = reader.next()
    for (i in 0 until fileNameLength - 2) {
        if (fileName[i] == notSupported
                && fileName[i + 1] == notSupported
                && fileName[i + 2] == notSupported)
            ++count
    }
    println(count)

}


import java.io.File
import java.io.InputStream
import java.lang.Long.max
import java.util.*
import java.util.HashMap

fun <T : Number> T.digitSum() = this.toString().fold(0) { acc, next -> acc + next.toInt() - '0'.toInt() }

fun solve(inp: InputReader) {
    val (n, s) = inp.nextLine().split(" ").map(String::toLong)
    var current = s
    while (current <= n && current - current.digitSum() < s) {
        current += 1
    }
    val res = max(n - current + 1, 0L)
    println(res)
}

fun main(args: Array<String>) = solve(initIO("Mine" in args))

fun initIO(isLocal: Boolean) = when (isLocal) {
    true -> InputReader(File("input.txt").inputStream())
    false -> InputReader(System.`in`)
}

class InputReader(inputStream: InputStream) {
    val reader = inputStream.bufferedReader()
    var tokenizer = StringTokenizer("")

    fun nextLine(): String = when {
        tokenizer.hasMoreTokens() -> tokenizer.nextToken("")!!
        else -> reader.readLine()!!
    }

    fun nextWord(): String {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = StringTokenizer(nextLine())
        }
        return tokenizer.nextToken()!!
    }

    fun nextInt() = nextWord().toInt()

    fun nextLong() = nextWord().toLong()
}


/**
 * Created by denis on 18.06.17.
 */
fun main(args: Array<String>){
    var (x, s) = readLine()!!.split(' ').map(String::toLong)
    var left: Long = 1
    var right: Long = x
    var f: Long
    if (x - num(x) < s) print(0)
    else {
        while(left < right){
            f = (left + right) / 2
            if(f - num(f) >= s) {
                right = f
            }
            else {
                if((f+1) - num(f+1) >= s){
                    right = f + 1
                    break
                }
                else
                    left = f + 1
            }
        }
        print(x - right + 1)

    }

    }
public fun num(xx: Long): Long {
    var sum: Long = 0
    var x: Long = xx
    while(x > 0){
        sum += x % 10
        x /= 10
    }
    return sum
}


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

fun main() {
    val tiles = readStrings()
    var min = 3
    val base = '0'.toInt()
    for (tile in tiles) {
        val toKoutsu = 3 - tiles.count { s -> s == tile }
        min = kotlin.math.min(toKoutsu, min)
        var toShuntsu = 2
        val next = (tile[0].toInt() -base + 1).toString() + tile[1]
        if (tiles.contains(next)) {
            toShuntsu--
        }
        val nextNext = (tile[0].toInt() - base + 2).toString() + tile[1]
        if (tiles.contains(nextNext)) {
            toShuntsu--
        }
        min = kotlin.math.min(toShuntsu, min)
    }
    println(min)
}


fun main() {
    val cardLayout = readLine()!!.split(" ")
        .map { "${it[1]}${it[0]}" }.sorted()
//    println("cardLayout: $cardLayout")

    //koutsu
    val maxTriple = cardLayout.groupBy { it }
        .mapValues { it.value.size }
        .values.max() ?: 1

    //shuntsu
    val maxStraigt = findStraight(cardLayout)

    println("" + (3 - kotlin.math.max(maxTriple, maxStraigt)))
}

fun findStraight(cards: List<String>): Int {
    var straigth = 1
    val firstCard = cards[0]
    var numI = firstCard[1]!!.toString().toInt()
    var typeI = firstCard[0]

    for (i in 1 until 3) {
        val card = cards[i]
        var numC = card[1]!!.toString().toInt()
        val typeC = card[0]

        if (typeC == typeI) {
            if (numC == numI + 1) {
                straigth++
            } else if (numC == numI + 2) {
                return 2
            }
        }

        numI = numC
        typeI = typeC
    }
    return straigth
}


// https://codeforces.com/contest/1191/problem/B
fun main(args: Array<String>) {
    val listM = arrayOf(0, 0, 0, 0, 0, 0, 0, 0, 0)
    val listP = arrayOf(0, 0, 0, 0, 0, 0, 0, 0, 0)
    val listS = arrayOf(0, 0, 0, 0, 0, 0, 0, 0, 0)

    val input = readLine()!!.split(" ").map {
        Card(it[0].toString().toInt(), it[1].toString())
    }

    input.forEach {
        when(it.type) {
            "m" -> listM[it.number-1]++
            "p" -> listP[it.number-1]++
            "s" -> listS[it.number-1]++
        }
    }

    val koutsuM = listM.max()!!
    val shuntsuM = shuntsu(listM)

    if (koutsuM >= 3 || shuntsuM >= 3) {
        println("0")
        return
    }

    val koutsuP = listP.max()!!
    val shuntsuP = shuntsu(listP)
    if (koutsuP >= 3 || shuntsuP >= 3) {
        println("0")
        return
    }

    val koutsuS = listS.max()!!
    val shuntsuS = shuntsu(listS)
    if (koutsuS >= 3 || shuntsuS >= 3) {
        println("0")
        return
    }

    if (koutsuM >= 2 || shuntsuM >= 2 ||
            koutsuS >= 2 || shuntsuS >= 2 ||
            koutsuP >= 2 || shuntsuP >= 2) {
        println("1")
        return
    }

    println("2")
}

// return the number of subsequence > 0
fun shuntsu(list: Array<Int>): Int {
    val seq = ArrayList<Triple<Int, Int, Int>>()
    for (i in 0 until 7) {
        seq.add(Triple(list[i], list[i+1], list[i+2]))
    }
    var one = 0
    var two = 0
    for (triple in seq) {
        if (triple.first > 0 && triple.second > 0 && triple.third > 0) {
            return 3
        } else if (triple.first > 0 && triple.second > 0) {
            two++
        } else if (triple.first > 0 && triple.third > 0) {
            two++
        } else if (triple.second > 0 && triple.third > 0) {
            two++
        } else if (triple.first > 0 || triple.second > 0 || triple.third > 0) {
            one++
        }
    }
    if (two > 0) return 2
    if (one > 0) return 1
    return 0
}

class Card(val number: Int, val type: String)


fun main() {
    val tiles = readLine()!!.split(" ").toSet()
    print(when (tiles.size) {
        1 -> 0
        2 -> 1
        else -> {
            var sol = 2
            loop@for (suit in listOf('m', 'p', 's')) {
                for (num in 1..7) {
                    if ("" + num + suit in tiles) {
                        if ("" + (num + 1) + suit in tiles && "" + (num + 2) + suit in tiles) {
                            sol = 0
                            break@loop
                        }
                        if ("" + (num + 1) + suit in tiles || "" + (num + 2) + suit in tiles)
                            sol = 1
                    }
                }
                if ("8$suit" in tiles && "9$suit" in tiles) sol = 1
            }
            sol
        }
    })
}


import java.util.Scanner;

fun final_location(cmds : String) : Pair<Int, Int> {
    var loc = 0
    var num_unrecognized_cmds = 0
    for (cmd in cmds) {
        if (cmd == '+') {
            loc = loc + 1
        } else if (cmd == '-') {
            loc = loc - 1
        } else if (cmd == '?') {
            num_unrecognized_cmds = num_unrecognized_cmds + 1
        } else {
            throw Exception("Unknown input!")
        }
    }
    return Pair(loc, num_unrecognized_cmds)
}

fun factorial(x : Int) : Int {
    var f = 1;
    for (i in 1 .. x) {
        f = f * i
    }
    return f
}

fun main(args : Array<String>) {
    val scanner = Scanner(System.`in`)
    val sent_command = scanner.next()
    val recognized_command = scanner.next()
    // println("sent_command : ${sent_command}")
    // println("recognized_command : ${recognized_command}")
    val (loc_sent_cmd, _) = final_location(sent_command)
    val (loc_recognized_cmd, num_unrecognized_cmds) = final_location(recognized_command)
    // println("loc_sent_cmd : ${loc_sent_cmd}")
    // println("loc_recognized_cmd : ${loc_recognized_cmd}")
    // println("num_unrecognized_cmds : ${num_unrecognized_cmds}")
    // p + m = num_unrecognized_cmds
    // p - m = loc_sent_cmd - loc_recognized_cmd
    val two_p = loc_sent_cmd - loc_recognized_cmd + num_unrecognized_cmds
    if ((two_p % 2) == 1) {
        println("0")
    } else {
        val p = two_p / 2
        val m = num_unrecognized_cmds - p
        if ((p >= 0) && (m >= 0)) {
            val f_s = factorial(num_unrecognized_cmds).toDouble()
            val f_p = factorial(p).toDouble()
            val f_m = factorial(m).toDouble()
            val two : Double = 2.0
            val result = (f_s / (f_p * f_m)) * (1.0 / Math.pow(two, num_unrecognized_cmds.toDouble()))
            println("${result}")
        } else {
            println("0")
        }
    }
}


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


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


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.*
import java.util.*

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

    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 readLine(): String {
        tok = StringTokenizer("")
        return rd.readLine()
    }
    fun readInt(): Int = readToken().toInt()
    fun readLong(): Long = readToken().toLong()
}

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

fun solve(io: ProblemIO) {
    val n = io.readInt()
    val a = io.readInt()
    val b = io.readInt()
    var res = 0
    for (i in 0 .. n - 1) {
        if (i < a) continue
        if (n - 1 - i > b) continue
        ++res
    }
    io.println(res)
}


fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    //val (n, t) = r.readLine()!!.split(" ").map { it.toInt() }
    //val book = r.readLine()!!.split(" ").map { it.toLong() }
    val (n, a, b) = r.readLine()!!.split(" ").map { it.toInt() }
    //val l1 = listOf(a..n-1)
    val l3 = List(n-a){a+it}
    //println(l3)
    //val l2 = listOf((n-b-1)..n-1)
    val l4 = List(b+1){n-b-1+it}
    //println(l4)
    var ans = 0
    for (i in l3){
        loop@for (j in l4){
            if (i==j){
                ans++
                break@loop
            }
        }
    }
    println(ans)
}


import kotlin.math.min

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

    val (numPeople, a, b) = readInts()
    print(min(numPeople - a, b + 1))
}


fun main(){
    var k = readLine()!!.toInt()
    var l = readLine()!!.toInt()
    var m = readLine()!!.toInt()
    var n = readLine()!!.toInt()
    var d = readLine()!!.toInt()
    var ans = 0
    for(i in 1..d){
        if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
        ans++
    }
    println(ans)
}


fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    val k = r.readLine()!!.toInt()
    val l = r.readLine()!!.toInt()
    val m = r.readLine()!!.toInt()
    val n = r.readLine()!!.toInt()
    val len = r.readLine()!!.toInt()
    val num = BooleanArray(len){false}
    for (i in 0..len-1){
        when{
            (i+1)%k == 0 || (i+1)%l == 0 ||(i+1)%m == 0 ||(i+1)%n == 0 -> num[i] = true
        }
    }
    println(num.count { it })
}


fun main() {
    val a = readLine()!!.toInt()
    val b = readLine()!!.toInt()
    val c = readLine()!!.toInt()
    val d = readLine()!!.toInt()
    val e = readLine()!!.toInt()

    println((1..e)
        .asSequence()
        .filter { (it % a == 0) || (it % b == 0) || (it % c == 0) || (it % d == 0) }
        .count())
}


fun main(args: Array<String>) {
	var k: Int = readLine()!!.toInt()
	var l: Int = readLine()!!.toInt()
	var m: Int = readLine()!!.toInt()
	var n: Int = readLine()!!.toInt()
	var d: Int = readLine()!!.toInt()

	println(countInjuredDragons(k, l , m , n, d))
}

fun countInjuredDragons(k: Int, l: Int, m: Int, n: Int, d: Int): Int{
	var ans: Int = 0
	for(i in 1..d){
		if(divisible(k,l,m,n,i)){
			ans++
		}else{
			continue
		}
	}
	return ans
}

fun divisible(k: Int, l: Int, m: Int, n: Int, c : Int): Boolean{
	return (c % k == 0) || (c % l == 0) || (c % m == 0) || (c % n == 0)
}


fun main(args: Array<String>){

    var n = readLine()!!.toInt()
    var i = 0
    i += n/100
    n %= 100
    i += n/20
    n %= 20
    i += n/10
    n %= 10
    i += n/5
    n %= 5
    i += n/1
    n %= 1
    println(i)
}


fun main() {
    var n = readLine()!!.toInt()
    var cnt = 0
    for (note in listOf(100, 20, 10, 5, 1)) {
        val x = n / note
        cnt += x
        n -= x * note
        if (n == 0) break
    }
    println(cnt)
}


fun main(args: Array<String>){

    var n = readLine()!!.toInt()
    println(n/100+n%100/20+n%20/10+n%10/5+n%5)
}


fun main(args: Array<String>) {
    val input = readLine()!!.toInt()
    val listOfBills = listOf(100, 20, 10, 5, 1)
//    println(getBillsAgain(listOfBills, input))
    println(getBills(input, listOfBills, 0))
}

fun getBills(sum: Int, list: List<Int>, indexOfBill: Int): Int {
    val currentBill = list[indexOfBill]
    val amount = sum / currentBill
    val newIndex = indexOfBill + 1
    if (amount <= 0 && newIndex < list.size) {
        return getBills(sum, list, newIndex)
    }
    val newSum = sum % (amount * currentBill)
    if (newSum == 0) return amount
    return amount + getBills(newSum, list, newIndex)
}

fun getBillsAgain(list: List<Int>, sum: Int): Int {
    var count = 0
    var newSum = sum
    list.forEach {
        if (newSum > 0) {
            count += newSum / it
            newSum -= newSum / it * it
        }
    }
    return count
}


import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
import java.util.Scanner
fun main(args: Array<String>) {
    val reader=Scanner(System.`in`)
    var x=reader.nextInt()
    if(x%2==0){
        println("Mahmoud")}
    else{
        println("Ehab")}

    }


//package problem959A

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

    if (n % 2 == 0) {
        println("Mahmoud")
    } else {
        println("Ehab")
    }
}


import java.util.*

fun main(args: Array<String>) = with(Scanner(System.`in`)) {
    val x = nextInt() % 2
    when(x) {
        0 -> print("Mahmoud")
        1 -> print("Ehab")
    }
}


fun main(args: Array<String>){
    if (readLine()!!.toInt() % 2 == 0) println("Mahmoud") else println("Ehab")
}


import java.util.*
import java.util.function.Consumer
import kotlin.math.abs

val counts = mutableListOf<Pair<Int, Int>>() // (odd, even)
val cuts = mutableListOf<Int>() // Price

fun main(args: Array<String>) {

    val data = mutableListOf<Int>()

    val reader = Scanner(System.`in`)
    var iterations: Int = reader.nextInt()
    var bitcoins: Int = reader.nextInt()

    for (i in 0..iterations - 1) {
        val number = reader.nextInt()
        data.add(number)
        createCount(number, i)
    }

    for (i in 1..iterations - 2) {
        if (isCuttable(counts.get(i))) {
            val price = absValue(data[i], data[i + 1])
            cuts.add(price)
        }
    }

    var count = 0
    var cutValue = 0
    cuts.sorted().forEach {
        cutValue += it
        if (bitcoins - cutValue >= 0)
            count++
    }

    print(count)

}

fun isCuttable(pairs: Pair<Int, Int>): Boolean {
    return pairs.first == pairs.second
}

fun createCount(number: Int, index: Int) {

    val even = isEven(number)

    if (index == 0) {
        addToCount(even, Pair(0, 0))
        return
    }
    addToCount(even, counts.get(index - 1))
}

fun addToCount(even: Boolean, pair: Pair<Int, Int>) {
    val (oddNumber, evenNumber) = pair
    if (even) {
        addToCount(oddNumber, evenNumber + 1)
    } else {
        addToCount(oddNumber + 1, evenNumber)
    }
}

fun addToCount(oddNumber: Int, evenNumber: Int) {
    add(counts, Pair(oddNumber, evenNumber))
}

fun add(list: MutableList<Pair<Int, Int>>, pairs: Pair<Int, Int>) {
    list.add(pairs)
}

fun isEven(x: Int): Boolean {
    return x % 2 == 0;
}

fun absValue(x: Int, y: Int): Int {
    return abs(x - y);
}


import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.io.InputStream
import java.util.*
import kotlin.math.abs
import kotlin.math.log

fun main(args: Array<String>) {
    class Scanner(s: InputStream) {
        private var st: StringTokenizer? = null
        private 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()
        }
    }

    val scan = Scanner(System.`in`)

    val n = scan.nextInt()
    val b = scan.nextInt()

    val a = (0 until n).map { scan.nextInt() }

    println(bestCuts(a, b, 0, a.size - 1))

}

data class Item(val start: Int, val end: Int, val budget: Int)

val dp = mutableMapOf<Item, Int>()

fun bestCuts(a: List<Int>, b: Int, start: Int, end: Int): Int {
    val memoryAns = dp[Item(start, end, b)]
    if (memoryAns != null) return memoryAns

    val size = end - start + 1
    if (size <= 2) return 0

    var ans = 0
    var odds = 0
    var evens = 0
    for (index in start..end) {
        val item = a[index]

        if (item % 2 == 0) evens++
        else odds++

        if (evens == odds && index + 1 <= end && abs(a[index + 1] - a[index]) <= b) {
            val rightBest = bestCuts(a, b - abs(a[index + 1] - a[index]), index + 1, a.size - 1)

            val tempAns = 1 + rightBest
            if (tempAns > ans) {
                ans = tempAns
            }
        }
    }

    dp[Item(start, end, b)] = ans
    return ans
}


fun main(args: Array<String>) {
    if (args.isNotEmpty() && args[0] == "debug") {
        System.setIn(object {}.javaClass.getResourceAsStream("/input.txt"))
    }

    solve()
}

fun getIntString() = readLine()!!
        .split(' ')
        .map { Integer.parseInt(it) }
        .toCollection(ArrayList())

fun solve() {
    val str1 = getIntString()
    val n = str1[0]
    var b = str1[1]
    val seq = getIntString()

    val costes = ArrayList<Int>()

    for (i in 1 until n) {
        if (checkSeq(seq.subList(0, i)) && checkSeq(seq.subList(i, n))) {
            val cost = Math.abs(seq[i-1] - seq[i])
            costes.add(cost)
        }
    }

    var result = 0
    var totalCost = 0
    costes.sorted().forEach {
        if (totalCost + it <= b) {
            totalCost += it
            result++
        }
    }

    println(result)

}

fun checkSeq(list: List<Int>): Boolean {
    if (list.size % 2 != 0) {
        return false
    }
    var even = 0
    var notEven = 0
    list.forEach {
        if (it % 2 ==0) {
            even++
        } else {
            notEven++
        }
    }
    return even == notEven
}


import kotlin.math.abs

fun main() {
    val (n, b) = readLine()!!.split(" ").map { it.toInt() }
    val a = readLine()!!.split(" ").map { it.toInt() }
    val cuts = mutableListOf<Int>()
    var odd = 0
    var even = 0
    if (a[0] % 2 == 0) {
        even++
    } else {
        odd++
    }
    for (j in 1 until n) {
        if (even == odd) {
            cuts.add(abs(a[j] - a[j - 1]))
        }
        if (a[j] % 2 == 0) {
            even++
        } else {
            odd++
        }
    }
    cuts.sort()
    var answer = 0
    var sum = 0
    for (c in cuts) {
        if (sum + c <= b) {
            answer++
            sum += c
        } else {
            break
        }
    }
    println(answer)
}


fun main(args: Array<String>) {
    /*
    int a = readInt();
    int b = readInt();
    int max = Math.min(a, b);
    int min = (Math.max(a, b) + 1) / 2;

    out.println(min + " " + max);
    */

    val n = nextInt();
    val k = nextInt();

    var ans = 0
    for (div in 1..n) {
        var kek = div
        var mod = 1
        while (mod < k) {
            if (kek == n) {
                ans = k * div + mod
                print(ans);
                return;
            }
            mod++
            kek += div
        }
    }

}

val inp = readLine()!!.split(' ');
var count = 0

fun nextInt(): Int {
    return inp[count++].toInt();
}


// modPart is the value of "x % k" that minimizes "x"
fun main() {
    fun readLongs() = readLine()!!.split(" ").map(String::toLong)

    val (n, k) = readLongs()
    var modPart = k - 1
    while (n % modPart != 0L) modPart--
    print((n / modPart * k) + modPart)
}


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

fun solve() {
    val n = sc!!.nextInt()
    val k = sc!!.nextInt()

    var min = 2000000000;
    for (mod in 1..k) {
        val div : Int = n / mod
        val ans = div * k + mod
        if ((ans % k) * (ans / k) == n)
            min = Math.min(ans, min);
    }
    out!!.print(min);
}

var sc : FastScanner? = null
var out : PrintWriter? = null

fun init() {
    sc = FastScanner(System.`in`)
    out = PrintWriter(System.out)
}

fun main(args: Array<String>) {
    init();
    solve();
    out!!.close();
}

class FastScanner(s: InputStream) {
    val br = BufferedReader(InputStreamReader(s))
    var st = StringTokenizer("")
    fun next(): String {
        if (!st.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
}


fun main(){
    val nk = readLine()!!.split(" ").map{it.toInt()}
    val n = nk.first()
    val k = nk.last()
    var greaterDivisor = k-1
    while (n%greaterDivisor!=0 && greaterDivisor>0) greaterDivisor--
    println(n/greaterDivisor*k+greaterDivisor)
}


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

fun main() {
    val inp = readInts()
    val n = inp[0];
    val k = inp[1];
    val l = inp[2];
    val c = inp[3];
    val d = inp[4];
    val p = inp[5];
    val nl = inp[6];
    val np = inp[7];
    val ans = minOf((k * l) / nl, c * d, p / np) / n;

    println(ans)
}


import java.util.*

fun main(args:Array<String>) {
    val sc = Scanner(System.`in`)
    var n = sc.nextInt()
    var drink = sc.nextInt()
    var ml = sc.nextInt()
    var lime = sc.nextInt()
    var slice = sc.nextInt()
    var salt = sc.nextInt()
    var nml = sc.nextInt()
    var nsalt = sc.nextInt()
    ml *= drink
    slice*= lime
    print(minOf(ml/nml,slice,salt/nsalt)/n)

}


fun solution(n:Int,k:Int,l:Int,c:Int,d:Int,p:Int,nl:Int,np:Int) :Int {
    val m = arrayOf(k*l/nl,c*d,p/np).min()!!
    return m/n
}

fun main(args: Array<String>) {50
//    myassert(solution(3,4,5,10,8,100,3,1),2)
//    myassert(solution(5,100,10,1,19,90,4,3),3)
//    myassert(solution(10,1000, 1000,25,23,1,50,1),0)

    val reader = java.util.Scanner(System.`in`)
    val n = reader.nextInt()
    val k = reader.nextInt()
    val l = reader.nextInt()
    val c = reader.nextInt()
    val d = reader.nextInt()
    val p = reader.nextInt()
    val nl = reader.nextInt()
    val np = reader.nextInt()

    println(solution(n,k,l,c,d,p,nl,np))
}


import kotlin.math.*

fun main () {
    operator fun List<Double>.component6() = this[5]
    operator fun List<Double>.component7() = this[6]
    operator fun List<Double>.component8() = this[7]
    val (n,k,l,c,d,p,nl,np) = readLine()!!.split(" ").map{ it.toDouble() }
    println(min(min(k * l / n / nl, p / n / np), c * d / n).toInt())
}


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

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
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 exit() : Nothing = exitProcess(0)

inline fun <T : Comparable<T> > min(x : T, y : T): T{
    if(x < y){return x;}
    else{return y;}
}

inline fun <T : Comparable<T> > max(x : T, y : T): T{
    if(x > y){return x;}
    else{return y;}
}

fun getid(row : Int): Int{
    val kek = (row - 1)/2;
    return 2 + 3 * kek;
}

fun main(){
    var (a, x, y) = readInts();
    a = a * 2;
    x = x * 2;
    y = y * 2;
    if(y%a == 0){
        println(-1);
        return;
    }
    val row = y/a;
    if(row <= 1){
        if(abs(x) >= a/2){println(-1);}
        else{println(row + 1);}
        return;
    }
    if(row%2 == 0){
        if(x != 0 && abs(x) < a){
            if(x < 0)println(getid(row - 1) + 1);
            else println(getid(row - 1) + 2);
        }
        else{println(-1);}
    }
    else{
        if(abs(x) < a/2){println(getid(row));}
        else{println(-1);}
    }
}