S = list(input()) list1 = [] for i in S: if i.isupper() == True: list1.append(i.lower()) if i.islower() == True: list1.append(i.upper()) print(''.join(list1))