from itertools import combinations def main(): n = int(input()) try: arr = [int(input()) for _ in range(n)] except ValueError: print('"assert"') return sums = {sum(x) for x in combinations(arr, 2)} print(sorted(sums, reverse=True)[1]) if __name__ == "__main__": main()