b = lambda c : c.upper() if c.islower() else c.lower() a = [b(x) for x in input()] print("".join(a))