program sample
    implicit none
    character(100)::s
    integer(8) :: i,j,m,n,k
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) s
    read(*,*)k
    do i=1,k-1
        if(s(i:i) .ne. '1')then
            write(*,*)s(i:i)
            stop
        end if
    end do
    write(*,*)s(k:k)
  
    stop
end program sample
  

