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

print((sum(sorted(A)[:2])))
P, Q, R = list(map(int, input().split()))



ans = min((P + Q, Q + R, R + P))

print(ans)
A = list(map(int, input().split()))
print((sum(sorted(A)[:2])))

P, Q, R = list(map(int, input().split()))
ans = min((P + Q, Q + R, R + P))
print(ans)

-A = list(map(int, input().split())) -print((sum(sorted(A)[:2]))) +P, Q, R = list(map(int, input().split())) +ans = min((P + Q, Q + R, R + P)) +print(ans)