p, q, r = map(int, input().split())
ABC = p + q
ACB = r + q
BAC = p + r
ans = min((ABC, ACB, BAC))
print(ans) p, q, r = map(int, input().split()) p map(int, input().split()) map int input().split() ().split () input split q r ABC = p + q ABC p + q p q ACB = r + q ACB r + q r q BAC = p + r BAC p + r p r ans = min((ABC, ACB, BAC)) ans min((ABC, ACB, BAC)) min (ABC, ACB, BAC) ABC ACB BAC print(ans) print ans ABC = p + q p + q ABC p, q, r = map(int, input().split()) map(int, input().split()) p ACB = r + q r + q ACB q, r = map(int, input().split()) map(int, input().split()) q r = map(int, input().split()) map(int, input().split()) r ans = min((ABC, ACB, BAC)) min((ABC, ACB, BAC)) ans BAC = p + r p + r BAC
p, q, r = map(int, input().split())
ABC = p + q
ACB = r + q
BAC = p + r
ans = min((ABC, ACB, BAC))
print(ans)