def capslock(c): n = ord(c) if n <= 90: n += 32 else: n -= 32 return chr(n) s = raw_input() ans = '' for i in range(0, len(s)): ans = ans + capslock(s[i]) print ans