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

fun main(args: Array<String>) {
    val S = readLine()!!
    val w = readInts()[0]
    println((0 until S.length step w).map { S[it] }.joinToString(""))

}