Олимпиадный тренинг

Задача 38223. gold bars


Given N gold bars. It is required to cut no more than one of them into two parts (not necessarily equal, but with a whole mass), and then divide the ingots into two heaps of equal mass.

Input
The first line contains one natural number N, not exceeding 100.

The second line contains N natural numbers, separated by a space, not exceeding 100 - the mass of the available ingots.

Imprint
Print the masses of the ingots that were included in the first pile (including the mass of the part of the sawn ingot).

If there are several solutions, print any of them.

If there are no solutions, print the phrase NO SOLUTION (in capital letters).

You can display the masses in any order, but the mass of the part of the sawn ingot (if any) should be the last one.
Examples
# Input Output
1 3
5 5 5
NO SOLUTION
2 4
1 2 3 8
1 2 3 1