S = input() ans = "" for i, s in enumerate(S): ans += s.upper() if s.islower() else s.lower() print(ans)