ring = list(map(int,input().split()))

print((sum(ring) - max(ring)))
a,b,c = sorted(map(int,input().split()))

print((a+b))
ring = list(map(int, input().split()))
print((sum(ring) - max(ring)))

a, b, c = sorted(map(int, input().split()))
print((a + b))

-ring = list(map(int, input().split())) -print((sum(ring) - max(ring))) +a, b, c = sorted(map(int, input().split())) +print((a + b))