djfz-2020-s450026/TaskC18/C18.py
2020-11-22 19:24:16 +01:00

14 lines
325 B
Python

import re
import sys
def line_contains(line):
return re.match("(^(Mt ([1-9]|[1][0-9]|[2][0-8])))?(^(Mk ([1-9]|[1][0-6])))?(^(Łk ([1-9]|[1][0-9]|[2][0-4])))?(^(J ([1-9]|[1][0-9]|[2][0-2])))?(\, [1-9]?[0-9])", line)
for line in sys.stdin:
if line_contains(line):
print("yes")
else:
print("no")