#CF801B. Valued Keys

Valued Keys

题目描述

You found a mysterious function f f . The function takes two strings s1 s_{1} and s2 s_{2} . These strings must consist only of lowercase English letters, and must be the same length.

The output of the function f f is another string of the same length. The i i -th character of the output is equal to the minimum of the i i -th character of s1 s_{1} and the i i -th character of s2 s_{2} .

For example, f( f( "ab", "ba" ) ) = "aa", and f( f( "nzwzl", "zizez" ) ) = "niwel".

You found two strings x x and y y of the same length and consisting of only lowercase English letters. Find any string z z such that f(x,z)=y f(x,z)=y , or print -1 if no such string z z exists.

输入格式

The first line of input contains the string x x .

The second line of input contains the string y y .

Both x x and y y consist only of lowercase English letters, x x and y y have same length and this length is between 1 1 and 100 100 .

输出格式

If there is no string z z such that f(x,z)=y f(x,z)=y , print -1.

Otherwise, print a string z z such that f(x,z)=y f(x,z)=y . If there are multiple possible answers, print any of them. The string z z should be the same length as x x and y y and consist only of lowercase English letters.

题目大意

找出来一个字符串s3,能让s1的第i位跟s3的第i位比较,二者最小的是s2的第i位 大小比较方法为比较字典序大小 Translated by @liyifeng

ab
aa

ba

nzwzl
niwel

xiyez

ab
ba

-1

提示

The first case is from the statement.

Another solution for the second case is "zizez"

There is no solution for the third case. That is, there is no z z such that f( f( "ab", z)= z)= "ba".