s=list(input().split()) k=list(input().split()) if len(s[1])>len(k[1]): print(s[0]) elif len(s[1])k[1][0]: print(s[0]) elif s[1][0]