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

num.sort()

print((num[0]+num[1]))



p,q,r = list(map(int,input().split()))



print((min(p+q,q+r,r+p)))
num = list(map(int, input().split()))
num.sort()
print((num[0] + num[1]))

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

-num = list(map(int, input().split())) -num.sort() -print((num[0] + num[1])) +p, q, r = list(map(int, input().split())) +print((min(p + q, q + r, r + p)))