s = list(input()) for i,v in enumerate(s): if v.islower(): s[i] = v.upper() else: s[i] = v.lower() print(''.join(s))