#include #include #include #include #include #include using namespace std; int main() { string Sa, Pa, Xa, Sb, Pb, Xb; cin >> Sa >> Pa >> Xa >> Sb >> Pb >> Xb; if(Pa == Pb){ cout << -1 << endl; }else if(Pa.size() > Pb.size()){ cout << Sa << endl; }else if(Pa.size() < Pb.size()){ cout << Sb << endl; }else if(Pa.size() == Pb.size()){ for(int i = 0; i < Pa.size(); i++){ if(Pa[i] - '0' > Pb[i] - '0'){ cout << Sa << endl; break; }else if(Pa[i] - '0' > Pb[i] - '0'){ cout << Sb << endl; break; } } } return 0; }