#include int main() { std::string n1, n2; std::string p1, p2; std::string c1, c2; std::cin >> n1 >> p1 >> c1; std::cin >> n2 >> p2 >> c2; if( p1.size() > p2.size() ) { std::cout << n1 << std::endl; return 0; } if( p1.size() < p2.size() ) { std::cout << n2 << std::endl; return 0; } for(int i = 0; i < p1.size(); ++i) { if( p1[i] > p2[i] ) { std::cout << n1 << std::endl; return 0; } if( p1[i] < p2[i] ) { std::cout << n2 << std::endl; return 0; } } std::cout << "-1" << std::endl; return 0; }