Readily switchable one-pot 5-exo-dig cyclization using a palladium catalyst