s = input() ans = '' for c in s: ans += c.lower() if c == c.upper() else c.upper() print(ans)