import re s = input() if len(s) == 0:exit() regex_Alphabet = r"^[A-Za-z]+$" if not re.match(regex_Alphabet, s):exit() for char in s: if char.islower(): print(char.upper(), end="") else: print(char.lower(), end="")