S = str(input()) for i in S: if S == S.lower(): S.upper() else: S.lower() print(S)