A = raw_input() ans = "" B = [0, 1, 3] for i in A: if (i.isupper()): ans += i.lower() else: ans += i.upper() print ans