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

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

print(( a+b+c- max(a, b, c)))

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

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

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