S = raw_input() ans = "" for c in S: if ord(c) >= 97: ans += chr(ord(c) - 32) else: ans += chr(ord(c) + 32) print ans