The 1,3-dipolar cycloaddition as an approach to novel tricyclic O,N- and S,N-heterocycles