Intramolecular Diels-Alder reaction of functionalized trienes: synthesis of medium ring lactones