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