#C11721. Unique Reordering
Unique Reordering
Unique Reordering
You are given an integer \( n \) and a list of \( n \) integers. Your task is to reorder the list in ascending order if all the elements are unique. Otherwise, if there is any duplicate, you should output \(-1\) to indicate that a unique reordering is not possible.
The input is read from standard input and the result should be printed to standard output.
inputFormat
The first line contains a single integer \( n \) that represents the number of integers. The second line contains \( n \) space-separated integers.
outputFormat
If all numbers are unique, print the list of integers in ascending order separated by a space. Otherwise, if duplicates exist, print \(-1\).
## sample3
3 1 2
1 2 3