program aaa
implicit none
integer :: i,j,k,n,a,b,len,w

character(len=1000) :: s
character(len=1000) :: s2

read(*,*) s
read(*,*) w

s2=""
a=1

do while(a <= len_trim(s))
s2 = s2(1:len_trim(s2))//s(a:a)

a = a + w
enddo

write(*,*) s2(1:len_trim(s2))

end program