import java.io.*;
public class Main {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
public static void main(String[] args) throws IOException {
br.readLine();
String x,y;
x = br.readLine();
y = br.readLine();
for(int i = 0 ; i < x.length() ; i++){
if(y.charAt(i) > x.charAt(i)){
System.out.println("-1");
System.exit(0);
}
}
out.write(y);
out.flush();
out.close();
br.close();
}
}
ps:最后答案可以直接输出y的值,因为y本身也可以是z