#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.size() > pb.size()) cout << a << endl; else if(pb.size() > pa.size()) cout << b << endl; else if(pa.compare(pb) > 0) cout << a << endl; else if(pb.compare(pa) > 0) cout << b << endl; else cout << -1 << endl; return 0; }