Applications of ring rearrangements involving a participating side chain for the synthesis of five-membered heterocycles