import heapq import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline N = int(input()) try: A = [int(input()) for _ in range(N)] cand = [] for i in range(N): for j in range(i+1, N): heapq.heappush(cand, -A[i]-A[j]) _ = heapq.heappop(cand) print(-heapq.heappop(cand)) except: print("assert")