S=input() t="" for s in S: if s.isupper(): s=s.lower() t+=s elif s.islower(): s=s.upper() t+=s print(t)