s = raw_input() l = [] for x in s: if ord(x) < 97: x = chr(ord(x) +32) l.append(x) else: x = chr(ord(x) - 32) l.append(x) print "".join(l)