b = list(map(int, sorted(input().split(), reverse=True)))
for i in range(len(b) - 1):
if b[i]-1 != b[i+1]:
print(b[i]-1)
break
b = list(map(int, sorted(input().split(), reverse=True)))
for i in range(len(b) - 1):
if b[i]-1 != b[i+1]:
print(b[i]-1)
break