last1kdigits and Hamiltonian Cycle