P3742 {{umi's Function}}
Background
{{umi found a mysterious function $f$.}}
Description
{{This function takes two strings $s1, s2$. These strings consist only of lowercase letters and have the same length. The output of this function is another string $g$ whose length is the same as $s1$ and $s2$. The $i$-th character of $g$ equals the minimum of the $i$-th character of $s1$ and $s2$; simply put, $g_i=min(s1_i,s2_i)$.
For example: $f(\verb!ab!,\verb!ba!)= \verb!aa!$, $f(\verb!nzwzl!,\verb!zizez!)=\verb!niwel!$.
She now has two strings $x, y$ of the same length, consisting only of lowercase letters. Find any string $z$ such that $f(x,z)=y$. If no such string exists, please output -1.}}
Input Format
{{The first line contains the length $n$ of the two strings.
The second line contains the string $x$.
The third line contains the string $y$.}}
Output Format
{{Output one string in the first line, representing a valid string you found. If none exists, output -1.}}
Explanation/Hint
{{Constraints: For 100% of the testdata, $1 \le n \le 100$.}}
Translated by ChatGPT 5