7 for line in open("input.txt", "r"):
9 (pos1, pos2, letter, password) = regex.match('([0-9]+)-([0-9]+) ([a-z]): ([a-z]*)', line).group(1,2,3,4)
12 if (password[pos1-1] == letter or password[pos2-1] == letter) and password[pos1-1] != password[pos2-1]:
15 print(valid_lines, "valid lines of", total_lines)