function Main(s){
  s = s.split("\n");
  var w = +s[1];
  var ans = "";
  for(var i = 0; i < s[0].length; i += w)ans += s[0][i];
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));