score_combinations = [((1, 5, 9), (2, 6, 7), (3, 4, 8)),((1, 6, 8), (2, 4, 9), (3, 5, 7)),((2, 5, 8), (3, 4, 6), (1, 7, 9))]
for comb in score_combinations:
flag = True
for sub_comb in comb:
sub_comb = sorted(sub_comb)
for i in range(len(sub_comb) - 1):
if sub_comb[i + 1] - sub_comb[i] == 1:
flag = False
break
if not flag:
break
if flag:
fam_order = [name1, name2, name3]
for i in range(3):
if 1 in comb[i]:
print(f"最后一名是{fam_order[i]}家的孩子")
break