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