n=int(input()) try: ns=[int(input()) for i in range(n)] ans=set() for i in range(n-1): for j in range(i+1,n): ans.add(ns[i]+ns[j]) ans=sorted(list(ans)) print(ans[-2]) except ValueError: print('"assert"')