S = raw_input() s = '' for c in S: if c.islower(): s += c.upper() else: s += c.lower() print s