Reverse groups solution