Efficient construction of tri- and tetracyclic heterocycles from linear 1,6-dienes by a domino reaction.