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

sums = [P + Q, R + Q, Q + R, P + R, R + P, Q + P]

print(min(sums)) P, Q, R = map(int, input().split()) P map(int, input().split()) map int input().split() ().split () input split Q R sums = [P + Q, R + Q, Q + R, P + R, R + P, Q + P] sums [P + Q, R + Q, Q + R, P + R, R + P, Q + P] P + Q P Q R + Q R Q Q + R Q R P + R P R R + P R P Q + P Q P print(min(sums)) print min(sums) min sums 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 sums = [P + Q, R + Q, Q + R, P + R, R + P, Q + P] [P + Q, R + Q, Q + R, P + R, R + P, Q + P] sums
P, Q, R = map(int, input().split())

sums = [P + Q, R + Q, Q + R, P + R, R + P, Q + P]

print(min(sums))