import java.util.Scanner

fun main(args: Array<String>) {
  val cin = Scanner(System.`in`)
  val s = cin.next()
  val w = cin.nextInt()

  for (i in 0 until s.length step w) {
    print(s[i])
  }
  println()
  cin.close()
}