Relevel Question
You have integer array of length n ([1 2 1 2 1 3 1 3]).Remove all occurance of 1(array become [2 2 3 3]).Now you can append this resulting array to initial array , any number of time ([1 2 1 2 1 3 1 3 2 2 3 3]).
Given a resulting array print the initial array
eg.
input
1 2 1 2 1 3 1 3 2 2 3 3 2 2 3 3
output:
1 2 1 2 1 3 1 3
if no initial array possible print -1
if multiple ans possible print lexicographically smaller array.