S = list(input()) ans = [] for s in S: if s.isupper(): ans.append(s.lower()) else: ans.append(s.upper()) print("".join(ans))