#include <iostream> #include <iomanip> #include <string> #include <cmath> using namespace std; int main() { int T; cin>>T; string x,y; cin>>x>>y; if(x<y){ cout<<-1; }else{ cout<<y; } }