#include #include #include using namespace std; void solve1(){ string a, b; int Pa, Pb; string Xa, Xb; cin >> a >> Pa >> Xa; cin >> b >> Pb >> Xb; if (Pa == Pb) cout << "-1" << endl; if (Pa > Pb) cout << a << endl; else cout << b << endl; } int main(){ solve1(); return 0; }