l=input().split() a,b=[x.zfill(10) for x in l] for i,j in zip(a,b): if i==j: continue else: if i in '47' and j in '47': i,j=j,i print(l[i