Synthesis of Medium-Sized Heterocycles by Transition-Metal-Catalyzed Intramolecular Cyclization