P, Q, R = map(int,input().split())

time = [P+Q,P+R,R+Q]
time.sort()
print(time[0]) P, Q, R = map(int,input().split()) P map(int,input().split()) map int input().split() ().split () input split Q R time = [P+Q,P+R,R+Q] time [P+Q,P+R,R+Q] P+Q P Q P+R P R R+Q R Q time.sort() time.sort time sort print(time[0]) print time[0] time 0 P, Q, R = map(int,input().split()) map(int,input().split()) P R = map(int,input().split()) map(int,input().split()) R time = [P+Q,P+R,R+Q] [P+Q,P+R,R+Q] time Q, R = map(int,input().split()) map(int,input().split()) Q
P, Q, R = map(int,input().split())

time = [P+Q,P+R,R+Q]
time.sort()
print(time[0])