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