- Time limit: 1.00 s
- Memory limit: 512 MB
Given a set of positive integers, your task is to choose two disjoint subsets of the elements that have the same sum.
Input
The first line has an integer : the set size.
The second line has integers : the set elements.
Output
For both subsets, first print the size of the subset and then its contents. You can print any valid solution. If there is no solution, print IMPOSSIBLE
.
Constraints
Example
Input:
6 1 2 3 5 7 8
Output:
2 2 3 1 5
Explanation: The first subset is and the second subset is .