A_name, A_point = [int(i) if i.isnumeric() else i for i in input().split()][:2] B_name, B_point = [int(i) if i.isnumeric() else i for i in input().split()][:2] if A_point>B_point:print(A_name) elif A_point