def isupper(c): return ord('A') <= ord(c) <= ord('Z') def islower(c): return ord('a') <= ord(c) <= ord('z') s = input() t = "" for c in s: if isupper(c): t += c.lower() else: t += c.upper() print(t)