"use strict";

process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

function Main(input) {

    const s = input[0].split('');
    const w = parseInt(input[1], 10);

    let ans = '';
    for (let i = 0; i < s.length; i += w) {
        ans = ans + s[i];
    }

    console.log(ans);

    return 0;
}
