s = input() ans = [] for i in range(len(s)): ans.append(s[i].upper() if s[i].islower() else s[i].lower()); print("".join(ans))