P, Q, R = map(int, input().split())
time = [P, Q, R]
result = []
for i in range(len(time)):
  for j in range(i+1, len(time)):
    result.append(time[i]+time[j])
print(min(result)) P, Q, R = map(int, input().split()) P map(int, input().split()) map int input().split() ().split () input split Q R time = [P, Q, R] time [P, Q, R] P Q R result = [] result [] for i in range(len(time)):
  for j in range(i+1, len(time)):
    result.append(time[i]+time[j]) i range(len(time)) range len(time) len time for j in range(i+1, len(time)):
    result.append(time[i]+time[j]) j range(i+1, len(time)) range i+1 i 1 len(time) len time result.append(time[i]+time[j]) result.append result append time[i]+time[j] time[i] time i time[j] time j print(min(result)) print min(result) min result Q, R = map(int, input().split()) map(int, input().split()) Q result = [] [] result P, Q, R = map(int, input().split()) map(int, input().split()) P time = [P, Q, R] [P, Q, R] time R = map(int, input().split()) map(int, input().split()) R
P, Q, R = map(int, input().split())
time = [P, Q, R]
result = []
for i in range(len(time)):
  for j in range(i+1, len(time)):
    result.append(time[i]+time[j])
print(min(result))