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