x = input() l = len(x) list = list(x) new_list = [] for i in range(0,l): if ord(list[i]) >= 97: list[i] = chr( ord(list[i]) - 32 ) new_list.extend(list[i]) else: list[i] = chr( ord(list[i]) + 32 ) new_list.extend(list[i]) password = "".join(new_list) print(password)