Sorting Multisets and Electing a Leader in Anonymous Rings