Solid phase synthesis of bicyclic pyrrolidines