s=raw_input() a="" for i in xrange(len(s)): if s[i].islower(): a+=s[i].upper() else: a+=s[i].lower() print a