#include #include #include #include using namespace std; int main(int argc, char *argv[]) { string sa, sb, pa, pb, xa, xb; string s; getline(cin, s); stringstream ssa(s); ssa >> sa >> pa >> xa; getline(cin, s); stringstream ssb(s); ssb >> sb >> pb >> xb; int winner = 0; int cmp = pa.compare(pb); if (cmp < 0) { winner = 2; } else if (cmp > 0) { winner = 1; } string names[3] = { "-1", sa, sb }; cout << names[winner] << endl; return 0; }