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

print((sum(t) - max(t)))
p, q, r = list(map(int, input().split()))

print((p + q + r - max(p, q, r)))
t = list(map(int, input().split()))
print((sum(t) - max(t)))

p, q, r = list(map(int, input().split()))
print((p + q + r - max(p, q, r)))

-t = list(map(int, input().split())) -print((sum(t) - max(t))) +p, q, r = list(map(int, input().split())) +print((p + q + r - max(p, q, r)))