S = input() print(''.join([i.lower() if i.upper()==i else i.upper() for i in S]))