print(max(input().split(),key=lambda x:int(x.translate(x.maketrans('47','74')))))