]>
The computer science department has decided to field a team in the newest sport spreading across the nation: Computerball. Computer ball is a team sport played with 5 players per team. Each player has a different position, one of: Adder, Multiplier, Subtracter, Divisor, and Recurser. Each position has its own particular difficulties, for example the Adder and Multiplier have to be able to commute, whereas the others don't really need to. It's possible for the Recurser to go into an infinite loop if he never reaches a base.
The team is allowed to have a roster of at most ten people. Of course only five are allowed to start. Each person on the team has been scored on their ability to play each position, a skill rating. Each skill rating is an integer between 1 and 10. A team's skill rating is the sum of the skill ratings for each starting player for the position they are playing. Given the roster and each player's skill ratings, you are to determine the highest skill rating possible for the team.
There will be several test cases.
Each test case will start with a positive integer N that is at least 5 and at most 10. N is the number of players on the roster. N lines follow. Each of the N lines has the five skill levels in the order: Adder, Multiplier, Subtracter, Divisor, Recurser.
For each test case output a line giving the case number and the highest possible team skill rating.
5 2 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2 5 3 4 1 1 1 1 3 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2
1: 10 2: 12