Title: Toggling Cases

Write a program that converts uppercase letters to lowercase and lowercase letters to uppercase for a given string.

Input:
A string is provided in a line.

Output:
Print the converted string in a line. Note that only alphabetical letters need to be converted.

Constraints:
The length of the input string is less than 1200.

Sample Input:
fAIR, LATER, OCCASIONALLY CLOUDY.

Sample Output:
Fair, later, occasionally cloudy.

# Buggy version:
from sys import stdin

s = list(stdin.readline())
print(s)
for i in range(len(s)):
    if s[i].islower():
        s[i] = s[i].upper()
    elif s[i].isupper():
        s[i] = s[i].lower()

print(*s, sep="")


# Fixed version:
from sys import stdin

s = list(stdin.readline())
for i in range(len(s)):
    if s[i].islower():
        s[i] = s[i].upper()
    elif s[i].isupper():
        s[i] = s[i].lower()

print(*s, sep="", end="")

# Buggy version:
text = input()

for i in range(len(text)):
    code = ord(text[i])
    if ord('A') <= code <= ord('Z'):
        result += chr(code + 32)
    elif ord('a') <= code <= ord('z'):
        result += chr(code - 32)
    else:
        result += chr(code)

print(result)

# Fixed version:
text = input()

result = ''

for i in range(len(text)):
    code = ord(text[i])
    if ord('A') <= code <= ord('Z'):
        result += chr(code + 32)
    elif ord('a') <= code <= ord('z'):
        result += chr(code - 32)
    else:
        result += chr(code)

print(result)

# Buggy version:
string = input()
for i in string:
    if i.isupper():
        print(i.lower(), end = "")
    elif string[i].islower():
        print(i.upper(), end = "")
    else:
        print(i, end = "")

# Fixed version:
string = input()
for i in string:
    if i.isupper():
        print(i.lower(), end = "")
    elif i.islower():
        print(i.upper(), end = "")
    else:
        print(i, end = "")
print()

# Buggy version:
'''
ITP-1_8-A
 ??§????????¨?°????????????\?????????
????????????????????????????°?????????¨??§???????????\????????????????????°????????????????????????????????????
???Input
????????????1???????????????????????????
???Output
????????????????????????????°?????????¨??§???????????\????????????????????????????????????????????????
??¢????????????????????\???????????????????????????????????????????????????
'''
# inputData
inputData = input()

for i in range(len(inputData)):
    if "a"<=inputData[i]<="z":
        # ??§????????????
        print(inputData[i].upper(),end='')
    elif "A"<=inputData[i]<="Z":
        # ?°?????????????
        print(inputData[i].lower(),end='')

# Fixed version:
'''
ITP-1_8-A
 ??§????????¨?°????????????\?????????
????????????????????????????°?????????¨??§???????????\????????????????????°????????????????????????????????????
???Input
????????????1???????????????????????????
???Output
????????????????????????????°?????????¨??§???????????\????????????????????????????????????????????????
??¢????????????????????\???????????????????????????????????????????????????
'''
# inputData
inputData = input()

for i in range(len(inputData)):
    if "a"<=inputData[i]<="z":
        # ??§????????????
        print(inputData[i].upper(),end='')
    elif "A"<=inputData[i]<="Z":
        # ?°?????????????
        print(inputData[i].lower(),end='')
    else:
        # ??¢????????????????????\?????????????????????
        print(inputData[i],end='')

# ????????????
print('')

# Buggy version:
s=input();u=s.upper();l=s.lower()
print(''.join([(l[i],u[i])[s[i]==u[i]]for i in range(len(s))]))

# Fixed version:
s=input();u=s.upper();l=s.lower()
print(''.join([(u[i],l[i])[s[i]==u[i]]for i in range(len(s))]))

# Buggy version:
s=input();ans=""
for i in range(len(s)):
    if s[i].islower():
        ans+=s[i].upper(),end=""
    else:
        ans+=s[i].lower(),end=""
print(ans)


# Fixed version:
s=input();ans=""
for i in range(len(s)):
    if s[i].islower():
        ans+=s[i].upper()
    else:
        ans+=s[i].lower()
print(ans)

# Buggy version:
# -*- coding: utf-8 -*-

char = input()

char.swapcase()

print(char)


# Fixed version:
# -*- coding: utf-8 -*-

char = input()
print(char.swapcase())

# Buggy version:
print(input).swapcase()

# Fixed version:
print(input().swapcase())

# Buggy version:
for c in input():
    if c.islower():
        s += c.upper()
    elif c.isupper():
        s += c.lower()
    else:
        s += c
print (s)

# Fixed version:
s = input()
  
r = ""
for c in s:
    if c.isupper():
        r += c.lower()
    elif c.islower():
        r += c.upper()
    else:
        r += c

print(r)

# Buggy version:
string=input()
print(string.swapcase()


# Fixed version:
string = input()
print(string.swapcase())

# Buggy version:
s=input()
for c in s:
  if 'A' <= c and c <= 'Z':
    print(c.lower(), end='')
  elif 'a' <= c and c <= 'z':
    print(c.upper(), end='')
  else:
    print(c)


# Fixed version:
s=input()
for c in s:
  if 'A' <= c and c <= 'Z':
    print(c.lower(),end='')
  elif 'a' <= c and c <= 'z':
    print(c.upper(),end='')
  else:
    print(c,end='')
print()

# Buggy version:
s = input()

for i in s:
	if(i.isupper()):
		print(i.lower(), end="")
	else
		print(i.upper(), end="")

# Fixed version:
s=input()
for i in s:
    if i==i.lower():
        print(i.upper(),end='')
    else:
        print(i.lower(),end='')
print()

# Buggy version:
inp = input()
inp.swapcase()
print(inp)

# Fixed version:
inp = input()
print(inp.swapcase())

# Buggy version:
a=str(input())
print(a.swapcase)

# Fixed version:
a= str(input())
a= str.swapcase(a)
print(a)

# Buggy version:
s = input()
s.swapcase()
print(s)

# Fixed version:
s = input()

print(s.swapcase())

# Buggy version:
a = input()
a.swapcase()
print(a)

# Fixed version:
a = input()

print(a.swapcase())