S = input() ans = [] for s in S: if s.islower(): ans.append(s.upper()) else: ans.append(s.lower()) print(''.join(ans))