S = raw_input() S_coll = "" for i in range(0,len(S)): if S[i].islower(): S_coll = S_coll +(S[i].upper()) else: S_coll = S_coll +(S[i].lower()) print S_coll