n = int(input()) A = [] for i in range(3): temp = list(map(int, input().split())) if len(temp) == 3: print('"assert"') exit() a = temp[0] A.append(a) B = [A[0]+A[1], A[1]+A[2], A[2]+A[0]] B = list(set(B)) B.sort(reverse=True) print(B[1])