S = list(input()) A = [] for i in S: if i.islower(): A.append(i.upper()) else: A.append(i.lower()) print("".join(A))