import std.range;
import std.conv;
import std.stdio;
import std.string;

void main ()
{
	string s;
	while ((s = readln.strip) != "")
	{
		auto k = readln.strip.to !(int);
		writeln (s.stride (k));
	}
}
