a=input()
f=0
q=""
for i in range(len(a)):
if 90>=ord(a[i])>64:
c=chr((ord(a[i]) - ord('A')) + ord('a'))
q=q+c
elif 122>=ord(a[i])>96:
q=q+a[i]
elif 64>ord(a[i])>=32:
q=q+a[i]
for i in range(len(q)):
if ord(a[i])>64:
b=chr(ord(q[f])-ord('a')+ord('A'))
c=q[:f:]
q=q[f+1::]
q=c+b+q
f+=2
elif ord(a[i])<64:
q=q+a[i]
print(q)