#include using namespace std; int main(){ char name[2][102]; char point[2][10002] = {0}; char te[2][10]; for(int i=0; i<2; i++){ cin >> name[i]; cin >> point[i]; cin >> te[i]; } int i = 0; while(point[0][i] == point[1][i] && i < 10002){ i++; } if(point[0][i] > point[1][i]){ cout << name[0] << endl; }else if(point[0][i] < point[1][i]){ cout << name[1] << endl; }else{ cout << -1 << endl; } return 0; }