Gravitating monopole-antimonopole chains and vortex rings