Сложность: Лёгкая
t = open('17_17133+.txt') s = [int(n) for n in t.readlines()] d = [] h = str(max(s))[-1] for i in range(len(s)-1): if s[i] % 9 == 0 or s[i+1] % 9 == 0: if str(s[i] + s[i+1])[-1] == h: d.append(s[i] + s[i+1]) print(len(d), max(d))