You are given a sequence of length .
Choose indices . If the sequence satisfies , it is called an of . Its length is .
Consider the increasing subsequences of with the maximum length. Among them, the one with the largest sum of elements is called the fat sequence of .
Find the fat sequence of and the sum of its elements.
The input is given from Standard Input in the following format:
case case
For each test case, print the following two lines.
On the first line, print the elements of the fat sequence of in order, separated by spaces.
On the second line, print the sum of the elements of the fat sequence of .
If there are multiple solutions, print any of them.
In the first case, is the only longest increasing subsequence.
In the second case, the longest increasing subsequences have length . They are and , with sums and .
Each case is given in the following format:
| 3 | 17 | (). |
| 4 | 53 | No additional constraints. |
In the third case, equal values cannot appear together in an increasing subsequence, so the longest increasing subsequence has length .