One day, Sasha received a mysterious box containing two bracelets.
Sasha loves playing with letters, and she decided to use her wisdom to rearrange them. Her goal was to form the $$$^\dagger$$$lexicographically minimal $$$^\ddagger$$$palindrome possible on the second bracelet.
To achieve this, she must transfer all the letters from the first bracelet to the second one. Since the second bracelet is fixed on the left, she can only add letters to its right end.
The process works as follows:
Your task is to help Sasha determine: If it is possible to form a palindrome on the second bracelet, print the lexicographically minimal palindrome string. Otherwise, print -1.
$$$^\dagger$$$ String $$$x$$$ is lexicographically less than string $$$y$$$, if either $$$x$$$ is a prefix of $$$y$$$ (and $$$x \neq y$$$), or there exists such $$$i$$$ ($$$1 \le i \le \min(|x|, |y|)$$$), that $$$x_i \lt y_i$$$, and for any $$$j$$$ $$$(1 \le j \lt i)$$$ $$$x_j = y_j$$$. Here $$$|a|$$$ denotes the length of the string $$$a$$$.
$$$^\ddagger$$$ A palindrome is a string that reads the same backward as forward, for example strings 'z', 'aaa', 'aba', 'abccba' are palindromes, but strings 'codeforces', 'reality', 'ab' are not.
The first and only line contains a string $$$S$$$ consisting of lowercase English letters $$$(1 \leq |S| \leq 40)$$$ — representing the first bracelet.
Print a string $$$T$$$ that corresponds to the given trace — the second bracelet.
If there is no solution output -1 .
abb
bab
aabb
abba
xy
-1