N = int(input()) l = list(map(int,input().split())) if len(l) > 1: print('"assert"') else: a = l[0] b = int(input()) c = int(input()) s = {a + b,b + c,a + c} s = sorted(s,reverse = True) print(s[1])