# 대문자면 소문자로, 소문자면 대문자로 바꾸는 함수
def swap_case(s):
swap_s = ""
for char in s:
if char.isupper():
swap_s += char.lower()
elif char.islower():
swap_s += char.upper()
else:
swap_s += char
return swap_s
if __name__ == '__main__':
s = input()
result = swap_case(s)
print(result)