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