15 lines
345 B
Python
15 lines
345 B
Python
|
import re
|
||
|
import sys
|
||
|
|
||
|
|
||
|
def repl(char):
|
||
|
x = char.group(0)
|
||
|
output_str = ""
|
||
|
for c in x:
|
||
|
c = c.swapcase()
|
||
|
output_str += c
|
||
|
return output_str
|
||
|
|
||
|
for line in sys.stdin:
|
||
|
print(re.sub(r'\b[a-ząćęłńóśźż]+[A-ZĄĆĘŁŃÓŚŹŻ]+\b|\b[A-ZĄĆĘŁŃÓŚŹŻ]+[a-ząćęłńóśźż]+\b', repl, line).rstrip('\n'))
|