unittest
{
	assert( [ "abcdefgh", "3" ].parse.expand.solve == "adg" );
	assert( [ "lllll", "1" ].parse.expand.solve == "lllll" );
	assert( [ "souuundhound", "2" ].parse.expand.solve == "suudon" );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto s = input.front.to!( dchar[] );
	input.popFront;
	auto w = input.front.to!( long );
	return tuple( s, w );
}

auto solve( dchar[] s, long w )
{
	dchar[] ans;
	for( auto i = 0L; i < s.length; i += w )
	{
		ans ~= s[ i ];
	}
	return ans;
}
