Question
Next Wonder Word

In a magical land of words, Aanya stumbled upon a fascinating concept called “Wonder Words.” These special words were made up of distinct lowercase English letters. For instance, “newton” and “brave” were Wonder Words, while “bubble” and “silly” were not.
One day, Aanya found a Wonder Word and became curious about the smallest Wonder Word that was lexicographically larger than the one she had. Determined to explore this linguistic challenge, she set out to discover what that next Wonder Word would be. Can you help Aanya find the smallest Wonder Word that is larger than the one she found?

Input
The first line of the input consists of a single integer N, denoting the wonder word.

Note: The number can be too large thus provided in the form of string.

Constraints
1 ≤ N ≤ 50
Output
Print the smallest wonder word which is lexicographically larger than the given word. Print -1 if it doesn't exist.
Example
Sample Input
abc
Sample Output
abcd

Online