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

l=[0,0,0]
l[0]=p+q
l[1]=p+r
l[2]=q+r
print(min(l)) p,q,r = map(int, input().split()) p map(int, input().split()) map int input().split() ().split () input split q r l=[0,0,0] l [0,0,0] 0 0 0 l[0]=p+q l[0] l 0 p+q p q l[1]=p+r l[1] l 1 p+r p r l[2]=q+r l[2] l 2 q+r q r print(min(l)) print min(l) min l l=[0,0,0] [0,0,0] l 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
p,q,r = map(int, input().split())

l=[0,0,0]
l[0]=p+q
l[1]=p+r
l[2]=q+r
print(min(l))
