n = str(input()) if n.isupper()==True:
print(n.lower())
elif n.islower()==True:
print(n.upper())
else:
print(ord(n))