def solve(): n = int(input()) a = input() if " " in a: return "assert" a = int(a) b = int(input()) c = int(input()) ans = sorted([a + b, a + c, b + c])[::-1] return ans[1] if ans[0] != ans[1] else ans[2] print(solve())