#P1174A. Ehab Fails to Be Thanos
Ehab Fails to Be Thanos
No submission language available for this problem.
Description
You're given an array of length . Is it possible to reorder it in such way so that the sum of the first elements isn't equal to the sum of the last elements?
The first line contains an integer (), where is the number of elements in the array .
The second line contains space-separated integers , , , () — the elements of the array .
If there's no solution, print "-1" (without quotes). Otherwise, print a single line containing space-separated integers. They must form a reordering of . You are allowed to not change the order.
Input
The first line contains an integer (), where is the number of elements in the array .
The second line contains space-separated integers , , , () — the elements of the array .
Output
If there's no solution, print "-1" (without quotes). Otherwise, print a single line containing space-separated integers. They must form a reordering of . You are allowed to not change the order.
Samples
Note
In the first example, the first elements have sum while the last elements have sum . The sums aren't equal.
In the second example, there's no solution.