E. Sasha and palindrome
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

One day, Sasha received a mysterious box containing two bracelets.

  • The first bracelet was filled with letters, but unfortunately, they were arranged in a completely random order. This disorder greatly annoyed Sasha.
  • The second bracelet was empty and special it was fixed on the left side.

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:

  1. Take a letter from either the beginning or the end of the first bracelet.
  2. Insert this letter at the end of the second bracelet.
She repeats this process until the first bracelet become empty.

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.

Input

The first and only line contains a string $$$S$$$ consisting of lowercase English letters $$$(1 \leq |S| \leq 40)$$$ — representing the first bracelet.

Output

Print a string $$$T$$$ that corresponds to the given trace — the second bracelet.

If there is no solution output -1 .

Examples
Input
abb
Output
bab
Input
aabb
Output
abba
Input
xy
Output
-1