S = input() ans = "" for i in range(len(S)): if S[i].islower(): ans = ans + S[i].upper() else: ans = ans + S[i].lower() print(ans)