import itertools N = int(input()) input_list = [] for i in range(N): n = input() comp = n.split() if len(comp) == N: break else: input_list.append(int(n)) if len(input_list) == N: sums = [sum(c) for c in itertools.combinations(input_list,2)] sums.sort() print(sums[1]) else: print('assert')