S = input() print(''.join([l if S == u else u for l, u, s in zip(S.lower(), S.upper(), S)]))