Ring-expanding and Ring-opening Transformations of Benzofurans and Indoles with Introducing Heteroatoms