distances = list(map(int, input().split()))
distances.sort()
ans = 0
for i in range(2):
  ans += distances[i]
print(ans) distances = list(map(int, input().split())) distances list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split distances.sort() distances.sort distances sort ans = 0 ans 0 for i in range(2):
  ans += distances[i] i range(2) range 2 ans += distances[i] ans distances[i] distances i print(ans) print ans ans += distances[i] distances[i] ans ans = 0 0 ans distances = list(map(int, input().split())) list(map(int, input().split())) distances
distances = list(map(int, input().split()))
distances.sort()
ans = 0
for i in range(2):
  ans += distances[i]
print(ans)