P28316 [洛谷] umi's Function
普及-
题目描述

Problem Background

umi has discovered a mysterious function $f$.

Problem Description

This function takes two strings $s1$ and $s2$. These strings consist only of lowercase letters and have the same length. The output of the function is another string $g$ of the same length as $s1$ and $s2$. The $i$-th character of $g$ is the minimum of the $i$-th character of $s1$ and the $i$-th character of $s2$, in simpler terms, $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$ and $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, 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

The first line should output a string representing the found string that meets the condition. If no such string exists, output $-1$.

Sample Input and Output

Sample Input #1

2
ab
aa

Sample Output #1

ba

Sample Input #2

5
nzwzl
niwel

Sample Output #2

xiyez

Sample Input #3

2
ab
ba

Sample Output #3

-1

Notes

For $100\%$ of the data, $1 \le n \le 100$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 ab aa
样例输出
ba