S = input() for i, value in S: if S == S.lower(): s[i] = S.upper() else: s[i] = S.lower() print(s)