S = input() a = '' for v in S: if v == v.upper(): a += v.lower() else: a += v.upper() print(a)