S = raw_input() ans = "" for i in S: if i.islower(): ans = ans + i.upper() else: ans = ans + i.lower() print ans