Splitting into Two Groups
An unusual situation occurred with the polar explorers—they were remembered. Unfortunately, this wasn't to replenish their food and fuel supplies. Instead, they were remembered because a decision was made to establish a new station nearby, and experienced polar explorers are rare. Consequently, it was decided to divide all the polar explorers at this station into two groups, sending one group to the new station. However, a challenge arose: some polar explorers have formed such strong bonds that they refuse to work at different stations. Each group of polar explorers at the station insists on working together or not at all. Your task is to help divide these groups into two parts that are as equal in size as possible (i.e., the absolute difference in the number of polar explorers between the two parts should be minimal), while keeping each group intact. Both parts must contain at least one group.
Input
The first line contains the integer n (2 ≤ n ≤ 30000), representing the number of groups. The second line contains n positive integers, each indicating the number of people in a group. The total number of polar explorers across all n groups does not exceed 50000.
Output
On the first line, print the sizes of the two parts.
On the second and third lines, list the group numbers assigned to the first and second parts, respectively (groups are numbered according to their order in the input, starting from one). If there are multiple valid solutions, any of them may be provided.