Input diffusion and the evolution of production networks