S = raw_input() O = '' for s in S: if s.islower(): O+=s.upper() elif s.isupper(): O+=s.lower() print O