import numpy as np



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



list = [p, q, r]



max_ = max(list)



sum_ = sum(list) - max_



print(sum_)



import numpy as np



P,Q,R = (int(x) for x in input().split())



times = []



times.append(P+Q)

times.append(P+R)

times.append(Q+R)



print((min(times)))
import numpy as np

p, q, r = list(map(int, input().split()))
list = [p, q, r]
max_ = max(list)
sum_ = sum(list) - max_
print(sum_)

import numpy as np

P, Q, R = (int(x) for x in input().split())
times = []
times.append(P + Q)
times.append(P + R)
times.append(Q + R)
print((min(times)))

-p, q, r = list(map(int, input().split())) -list = [p, q, r] -max_ = max(list) -sum_ = sum(list) - max_ -print(sum_) +P, Q, R = (int(x) for x in input().split()) +times = [] +times.append(P + Q) +times.append(P + R) +times.append(Q + R) +print((min(times)))