s = str(input()) t = [] for i in s: if i.isupper(): t.append(str.lower(i)) else: t.append(str.upper(i)) u = ''.join(t) print(u)