program main
	implicit none
    character(1000) S, ans
	integer w, i
	read(*, *) S
	read(*, *) w
	do i = 1, len_trim(S)
		if(w == 1) then
			write(*, *) trim(S)
			goto 1
		else if(mod(i,w) == 1) then
			write(*, '(a)', advance = 'No') S(i:i)
		end if
	end do
	write(*, *) ''
1 continue
end program main