Metal-mediated post-Ugi transformations for the construction of diverse heterocyclic scaffolds.