function main(input) {
  const test = input.split('\n');
  let s = test[0],
      w = parseInt(test[1]);
  let args = new Array(), ans;
  for(let i = 0; s.length > i + 1; i += w){
    args.push(s.substr(i, w));
  }
  for(let i = 0; i < args.length; i++){
    ans += args[i].slice(0, 1);
  }

  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));