a=gets.split b=gets.split x=a[1].to_i y=b[1].to_i puts (x>y ? a[0] : x