S=str(input()) len_S=len(S) s='' for i in range(len_S): if S[i].islower(): s+=S[i].upper() else: s+=S[i].lower() print(s)