Carlo loves organizing his library and has arranged all books in lexicographical order. To enhance their appearance, he wants to insert a new book between two existing titles. The two titles, and , are given as strings containing only lowercase letters of the English alphabet.
Task
Your task is to help Carlo find a title , also consisting of only lowercase letters of the English alphabet for the new book such that:
- is lexicographically strictly between and .
- The length of is minimized.
Help Carlo find a title satisfying these requirements, or determine that it doesn't exist.
Input data
The input file consists of:
- a line containing string .
- a line containing string .
Output data
The output file must contain a single line consisting of string or -1
if it doesn't exist. If there is more than one correct answer, you can print any.
Constraints and clarifications
- lexicographically.
- and contain only lowercase letters of the English alphabet.
# | Points | Constraints |
---|---|---|
1 | 0 | Examples |
2 | 15 | |
3 | 15 | and contain only vowels. |
4 | 30 | |
5 | 40 | No additional constraints. |
Example 1
stdin
abc
abca
stdout
-1
Explanation
There is no title that satisfies the constraints.
Example 2
stdin
abc
def
stdout
c
Explanation
We have that abc
c
def
, and there is no shorter title that satisfies the constraints.
Note that b
or d
are strings of length which satisfy the constraints and are, therefore, accepted by the checker.
Example 3
stdin
pcn
pk
stdout
pf
Example 4
stdin
mppxtzmo
mppxu
stdout
mppxtzz
Example 5
stdin
abc
abcaa
stdout
abca