s = input() ret = '' for c in s: if c.upper() == c: ret += c.lower() else: ret += c.upper() print(ret)