#include #include #include #include using namespace std; int main(){ string a,b,c,d; string pa,pb; cin >> a >> pa >> c; cin >> b >> pb >> d; if( pa == pb ){ cout << -1 << endl; return 0; } if( pa.size() == pb.size()){ for(int i = 0; i < pa.size(); i++){ if(pa[i] == pb[i]) continue; if(pa[i] > pb[i]) cout << a << endl; else cout << b << endl; } } else if( pa.size() > pb.size() ) cout << a << endl; else cout << b << endl; return 0; }