n = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) X = list(map(int,input().split())) Y = list(map(int,input().split())) score = 0 change = [] for i in range(n): a1,a2 = A[2*i],A[2*i+1] b1,b2 = B[2*i],B[2*i+1] x,y = X[i],Y[i] same = max(a1+a2,b1+b2)+x dif = max(a1+b2,a2+b1)+y score += same change.append(dif-same) ans = score change.sort(reverse=True) for c in change: score += c ans = max(ans,score) print(ans)