rewrite sum root to leaf numbers