# coding: utf-8 word = list(input().strip()) outword = [] for x in word: if x.isupper(): x = x.lower() outword.append(x) else: x = x.upper() outword.append(x) ans = "".join(outword) print(ans)