Synthesis and Ring Transformation of Oxygen and Nitrogen Spiro Bisheterocycles