#P3742. umi的函数
umi的函数
Background
umi found a mysterious function .
Problem Description
This function takes two strings . These strings consist only of lowercase letters and have the same length. The output of this function is another string whose length is the same as and . The -th character of equals the minimum of the -th character of and ; simply put, .
For example: , .
She now has two strings of the same length, consisting only of lowercase letters. Find any string such that . If no such string exists, please output .
Input Format
The first line contains the length of the two strings. The second line contains the string . The third line contains the string .
Output Format
Output one string in the first line, representing a valid string you found. If none exists, output .
2
ab
aa
ba
5
nzwzl
niwel
xiyez
2
ab
ba
-1
Hint
Constraints: For of the testdata, .
Translated by ChatGPT 5