from itertools import permutations L1,L2,L3 = map(int,input().split()) A = list(map(int,input().split())) a = 2*(L1+L2) b = 2*(L2+L3) c = 2*(L3+L1) ans = 10**6 L = [] for z in permutations(range(3)): if a*A[z[0]]+b*A[z[1]]+c*A[z[2]]