Bobsled ------- The Canadian Bobsled Association (CBA) wants to choose 2 teams of 4 people each to send to the Olympics. There are 13 people who want to be members of the teams. The CBA tries grouping them in various ways to see which athletes perform well together. Each grouping gets one test run on the bobsled track and their time is recorded. Your task is to help the CBA choose two disjoint teams of 4 such that the sum of their practice times is minimal. Input ----- There will be several input instances. The first line of each instance gives the total number of practice runs, n where 0 <= n <= 715. This will be followed by n lines. Each of those lines will contain 5 numbers: a, b, c, d and t, where t is the time in milliseconds for the practice run done by the team consisting of a, b, c and d. (The numbers a, b, c and d are distinct numbers between 1 and 13, inclusive, and t <= 60000). The end of the input will be indicated by a line with n=0. Output ------ For each input instance, just output the best total time for the two teams that you choose. If it is impossible to choose two disjoint teams from the test runs given, output -1. Sample Input ------------ 4 1 2 3 4 40000 5 6 7 8 30000 10 11 12 13 35000 1 5 10 12 20000 2 1 5 7 10 10000 2 4 7 11 10000 0 Sample Output ------------- 65000 -1