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