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