p,q,r = map(int,input().split())
pq = p+q
qr = q+r
rp = r+p
print(min(pq,qr,rp)) p,q,r = map(int,input().split()) p map(int,input().split()) map int input().split() ().split () input split q r pq = p+q pq p+q p q qr = q+r qr q+r q r rp = r+p rp r+p r p print(min(pq,qr,rp)) print min(pq,qr,rp) min pq qr rp r = map(int,input().split()) map(int,input().split()) r p,q,r = map(int,input().split()) map(int,input().split()) p q,r = map(int,input().split()) map(int,input().split()) q pq = p+q p+q pq qr = q+r q+r qr rp = r+p r+p rp
p,q,r = map(int,input().split())
pq = p+q
qr = q+r
rp = r+p
print(min(pq,qr,rp))