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



if P >= Q and P >= R:

    print((Q + R))

elif Q >= P and Q >= R:

    print((P + R))

else:

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



distance = [P+Q , Q+R , R+P]



print((min(distance)))
P, Q, R = list(map(int, input().split()))
if P >= Q and P >= R:
    print((Q + R))
elif Q >= P and Q >= R:
    print((P + R))
else:
    print((P + Q))

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

-if P >= Q and P >= R: -    print((Q + R)) -elif Q >= P and Q >= R: -    print((P + R)) -else: -    print((P + Q)) +distance = [P + Q, Q + R, R + P] +print((min(distance)))