P, Q, R = list(map(int, input().split()))



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

 

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

P, Q, R = list(map(int, input().split()))
print((P + Q + R - max(P, Q, R)))

-print((min(P + Q, Q + R, R + P))) +print((P + Q + R - max(P, Q, R)))