#include #define PI 3.14159265359 using namespace std; const int64_t mod = 1e9 + 7; int main() { string Sa, Sb, Pa, Pb, Xa, Xb; cin >> Sa >> Pa >> Xa; cin >> Sb >> Pb >> Xb; if (Pa.size() == Pb.size()) { if (Pa == Pa) { cout << -1 << endl; } else if (Pa > Pb) { cout << Sa << endl; } else { cout << Sb << endl; } } else if (Pa.size() > Pb.size()) { cout << Sa << endl; } else { cout << Sb << endl; } }