#coding:utf-8 s=raw_input() str='' for i in s: if i.islower(): str+=i.upper() else: str+=i.lower() print str