11804 - Argentina


Difficulty : medium

Solution Description :
Sorting problem

The sum of the attacking abilities of the 5 attackers needs to be maximized - i.e sort the attacking value descending order.

If there is more than one combination, maximize the sum of the defending abilities of the 5 defenders -  i.e sort the attacking value descending order and sort the defending value ascending order.
 
If there is still more than one combination, pick the attackers that come lexicographically earliest - i.e sort the attacking value descending order and sort the defending value ascending order and sort the player name ascending order.

You need only 
sort the attacking value descending order and sort the defending value ascending order and sort the player name ascending order.

Now print 1 to 5 player name(lexicographically ascending order) in first line and 6 to 10 player name(lexicographically ascending order) in second line.