string = input() ans = "" for s in string: if s.isupper(): ans += s.lower() else: ans += s.upper() print(ans)