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