S = input() T = '' for s in S: if s.isupper(): T += s.lower() else: T += s.upper() print(T)