Took a simple route. Not sure if I got the right answer, But, am confident that I took logical and straightforward steps!
*// EDIT: I completed this challenge for all possible combinations!!!!
Here my first 'weekly challenge' solution contribution, not short as in 5 tools (I have 3 extras for sorting and to calculate the net), but hey, this is my first contribution and it is exactly sorted the way it was sorted in the output request and works for any given number of names/records (not only 50). Wish all a happy 'advents' time.
I went down a route that I wasn't 100% sure would work due to the logic being very simple.....