S = input() str = '' for i in S: if i.islower(): str += i.upper() elif i.isupper(): str += i.lower() else: str += i print(str)