djfz-2023-s473575/TaskE45/run.py

15 lines
316 B
Python
Raw Permalink Normal View History

2023-12-10 19:09:40 +01:00
import re
import sys
for line in sys.stdin:
stripped_line = line.strip()
words = stripped_line.split(' ')
if (len(words) == 2) and (len(words[1]) > 1):
if re.match(r'((?!.*a$)([A-Z]|Ł)[a-ząćęłńóśźż]+|Jarema|Kosma)$', words[0]):
print(words[1])
else:
print('<NONE>')
else:
print('<NONE>')