s = list(input()) t = "" for i in range(len(s)): if s[i] == s[i].upper(): t += s[i].lower() else: t += s[i].upper() print(t)