Ricci flow with surgery on three-manifolds