hours_p_distance, hours_q_distance, hours_r_distance = map(int, input().split())

root_p_q = hours_p_distance + hours_q_distance
root_p_r = hours_p_distance + hours_r_distance
root_q_r = hours_q_distance + hours_r_distance

if hours_p_distance == 0 or hours_q_distance == 0 or hours_r_distance == 0:
    print(max(root_p_q, root_p_r, root_q_r))
else:
    print(min(root_p_q, root_p_r, root_q_r)) hours_p_distance, hours_q_distance, hours_r_distance = map(int, input().split()) hours_p_distance map(int, input().split()) map int input().split() ().split () input split hours_q_distance hours_r_distance root_p_q = hours_p_distance + hours_q_distance root_p_q hours_p_distance + hours_q_distance hours_p_distance hours_q_distance root_p_r = hours_p_distance + hours_r_distance root_p_r hours_p_distance + hours_r_distance hours_p_distance hours_r_distance root_q_r = hours_q_distance + hours_r_distance root_q_r hours_q_distance + hours_r_distance hours_q_distance hours_r_distance if hours_p_distance == 0 or hours_q_distance == 0 or hours_r_distance == 0:
    print(max(root_p_q, root_p_r, root_q_r))
else:
    print(min(root_p_q, root_p_r, root_q_r)) hours_p_distance == 0 or hours_q_distance == 0 or hours_r_distance == 0 hours_p_distance == 0 or hours_q_distance == 0 hours_p_distance == 0 hours_p_distance 0 hours_q_distance == 0 hours_q_distance 0 hours_r_distance == 0 hours_r_distance 0 print(max(root_p_q, root_p_r, root_q_r)) print max(root_p_q, root_p_r, root_q_r) max root_p_q root_p_r root_q_r print(min(root_p_q, root_p_r, root_q_r)) print min(root_p_q, root_p_r, root_q_r) min root_p_q root_p_r root_q_r root_p_q = hours_p_distance + hours_q_distance hours_p_distance + hours_q_distance root_p_q hours_p_distance, hours_q_distance, hours_r_distance = map(int, input().split()) map(int, input().split()) hours_p_distance hours_r_distance = map(int, input().split()) map(int, input().split()) hours_r_distance hours_q_distance, hours_r_distance = map(int, input().split()) map(int, input().split()) hours_q_distance root_p_r = hours_p_distance + hours_r_distance hours_p_distance + hours_r_distance root_p_r root_q_r = hours_q_distance + hours_r_distance hours_q_distance + hours_r_distance root_q_r
hours_p_distance, hours_q_distance, hours_r_distance = map(int, input().split())

root_p_q = hours_p_distance + hours_q_distance
root_p_r = hours_p_distance + hours_r_distance
root_q_r = hours_q_distance + hours_r_distance

if hours_p_distance == 0 or hours_q_distance == 0 or hours_r_distance == 0:
    print(max(root_p_q, root_p_r, root_q_r))
else:
    print(min(root_p_q, root_p_r, root_q_r))