import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	string s = readln.chomp;
	long w = read.to!long;
	
	string ans;
	foreach(i, c; s){
		if(i % w == 0) ans ~= c;
		}
	
	ans.writeln;
	}