import itertools N = int(input().strip()) A = [] try: for i in range(N): A.append(int(input().strip())) except: print('assert') exit(0) print(sorted(list(set([sum(i) for i in list(itertools.combinations(A, r=2))])), reverse=True)[1])