n = int(input()) a = input() if ' ' in a: print('assert') else: a = int(a) b = int(input()) c = int(input()) l = list(set(sorted([a+b, b+c, c+a]))) if len(l)==2: print(l[0]) else: print(l[1])