string = input() result = "" for s in string: if s.islower(): result += s.upper() elif s.isupper(): result += s.lower() print(result)