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