def main(): s = input() list_s = list(str(s)) for i in range(len(list_s)): if list_s[i].islower(): list_s[i] = list_s[i].upper() else: list_s[i] = list_s[i].lower() print("".join(list_s)) if __name__ == "__main__": main()