jfz-2023-s473616/TaskF01/run.py

17 lines
387 B
Python

import re
def swap_case(match):
return match.group().swapcase()
if __name__ == "__main__":
while True:
try:
line = input()
if not line:
break
result = re.sub(r'\b(?=\w*[a-ząćęłńóśźż])(?=\w*[A-ZĄĆĘŁŃÓŚŹŻ])\w+\b', swap_case, line)
print(result)
except EOFError:
break