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