A) odd Sum
Hint 1
When is it impossible to reorder the elements?
Hint 2
Maybe sorting the elements might help.
Approach
If all elements in the array are equal, there's no solution. Otherwise, sort the array. The sum of the second half will indeed be greater than that of the first half.
Code
def main():
half = int(input())
nums = list(map(int, input().split()))
nums.sort()
if nums[0] == nums[-1]:
print(-1)
else:
print(*nums)
main()