S = input().strip() r = "" for c in S: if c.isupper(): r += c.lower() else: r += c.upper() print(r)