Problem:
Toggling Cases Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string. Input A string is given in a line. Output Print the converted string in a line. Note that you do not need to convert any characters other than alphabetical letters. Constraints  The length of the input string < 1200  Sample Input fAIR, LATER, OCCASIONALLY CLOUDY. Sample Output Fair, later, occasionally cloudy.

Solution (Python):
def main():
    print(input().swapcase())

if __name__ == '__main__':
    main()

Solution (Python):
print(input().swapcase())

Solution (Python):
def main():
    line = input()

    for ch in line:
        if   65 <= ord(ch) <= 90:
            ch = chr(ord(ch)+32)
        elif 97 <= ord(ch) <= 122:
            ch = chr(ord(ch)-32)

        print(ch, end='')
    print()

if __name__ == '__main__':
    main()

Solution (Python):
print(input().swapcase())

Solution (Python):

tr = str.maketrans('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
                   ,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
input_text = input().translate(tr)

print(input_text)

Solution (Python):
print(input().swapcase())

Solution (Python):
s = input()
ans = [i.upper() if 'a' <= i <= 'z' else i.lower() if 'A' <= i <= 'Z' else i for i in s[:]]
print(*ans, sep='')

Solution (Python):

print(input().swapcase())

Solution (Python):
a = input()
print(a.swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
s = input()
t = ""
for i in range(len(s)):
    if s[i].islower():
        t += s[i].upper()
    elif s[i].isupper():
        t += s[i].lower()
    else:
        t += s[i]
print(t)

Solution (Python):
s = input()
print(s.swapcase())

Solution (Python):
s = raw_input().swapcase()
print s

Solution (Python):
s = input()
print(s.swapcase())

Solution (Python):


from string import ascii_lowercase, ascii_uppercase
s = input()
table = str.maketrans(dict(zip(ascii_lowercase+ascii_uppercase,
                               ascii_uppercase+ascii_lowercase)))
print(s.translate(table))

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
lit=input()
print(lit.swapcase())

Solution (Python):
from string import ascii_lowercase, ascii_uppercase
l = ascii_lowercase
u = ascii_uppercase
def conv(c):
    if c in l:
        return u[l.index(c)]
    if c in u:
        return l[u.index(c)]
    return c
open(1, 'w').write("".join(map(conv, open(0).readline())))

Solution (Python):
string = str(input())

print(string.swapcase())

Solution (Python):
C = input()
print(C.swapcase())

Solution (Python):
S = input()
S.swapcase()
print(S.swapcase())

Solution (Python):
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="")

Solution (Python):
from sys import stdin

s = stdin.readline().swapcase()
print(s, end="")

Solution (Python):
text = input()
print(text.swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
x = input()
print(x.swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
sentence = input()
for i in sentence:
    if i.isupper() == True:
        print(i.lower(), end = "")
    elif i.islower() == True:
        print(i.upper(), end = "")
    else:
        print(i, end = "")
print()

Solution (Python):
moji = input()

print(moji.swapcase())

Solution (Python):
string=input()
print(string.swapcase())

Solution (Python):
target=input()
Ans=target.swapcase()
print(Ans)

Solution (Python):


buf = list(str(input()))
for i in range(len(buf)):
    if buf[i].isupper() == True:
        buf[i] = buf[i].lower()
        buf_changed = "".join(buf)
    elif buf[i].islower() == True:
        buf[i] = buf[i].upper()
        buf_changed = "".join(buf)

print(buf_changed)

Solution (Python):
a = input()
print(a.swapcase())

Solution (Python):

print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
n=input()
m=''

for i in range(len(n)):
    c=str(n[i])
    
    if(n[i].islower()):
        c=n[i].upper()
    elif(n[i].isupper()):
        c=n[i].lower()
    
    m+=c

print(m)

Solution (Python):
str = input()
str = str.swapcase()
print(str)

Solution (Python):
char = input()
print(char.swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
s = input()

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

Solution (Python):
s = input("")
print(s.swapcase())

Solution (Python):
m=str(input())
print(m.swapcase())

Solution (Python):
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()

Solution (Python):
s = raw_input()
r = ''
for c in s:
    d = c
    if c >= 'a' and c <= 'z':
        d = chr(ord(c) - ord('a') + ord('A'))
    if c >= 'A' and c <= 'Z':
        d = chr(ord(c) - ord('A') + ord('a'))
    r = r + d
print r

Solution (Python):
s = raw_input()
ans = ""
for i in range(len(s)):
    if('A' <= s[i] and s[i] <= 'Z'):
        ans += s[i].lower()
    elif('a' <= s[i] and s[i] <= 'z'):
        ans += s[i].upper()
    else:
        ans += s[i]
print(ans)

Solution (Python):
print(input().swapcase())

Solution (Python):
text = raw_input()
t = list(text)
for i in range(len(t)):
    if t[i].isupper():
        t[i] = t[i].lower()
    elif t[i].islower():
        t[i] = t[i].upper()
print "".join(t)

Solution (Python):
n=raw_input()
a=''
for i in n:
    if i.islower():a+=i.upper()
    else:a+=i.lower()
print a

Solution (Python):
import string
s = raw_input()
print string.swapcase(s)

Solution (Python):
str = raw_input()
li = []
for a in list(str):
    if a.islower():
        li.append(a.upper())
    elif a.isupper():
        li.append(a.lower())
    else:
        li.append(a)
print "".join(li)

Solution (Python):
slist = raw_input().split(" ")

new_str_list=[]
for s in slist:
    new_str = ""
    for c in s:
        if c.isupper():
            new_str += c.lower()
        else:
            new_str += c.upper()
    new_str_list.append(new_str)

print " ".join(new_str_list)

Solution (Python):
slist = raw_input().split(" ")

def conv_char(c):
    if c.isupper(): return c.lower()
    return c.upper()
    
print " ".join(["".join([conv_char(c) for c in s]) for s in slist])

Solution (Python):
print(input().swapcase())

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
import sys
print(sys.stdin.readline().strip().swapcase())

Solution (Python):
st = raw_input()
ans = ''
for ch in st:
    if ch.islower():
        ans += ch.upper()
    elif ch.isupper():
        ans += ch.lower()
    else:
        ans += ch
print ans

Solution (Python):
if __name__ == '__main__':
    print(input().swapcase())

Solution (Python):


print(input().swapcase())

Solution (Python):
import sys
print(sys.stdin.readline().strip().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
import sys

print( sys.stdin.readline().rstrip().swapcase() )

Solution (Python):
import sys

print( sys.stdin.readline().rstrip().swapcase() )

Solution (Python):
import sys

line = sys.stdin.readline()
output = []
for i in range( len( line )-1 ):
	c = ord( line[i] )
	if ord( 'a' ) <= c and c <= ord( 'z' ):
		c = chr( c ).upper()
	elif ord( 'A' ) <= c and c <= ord( 'Z' ):
		c = chr( c ).lower()
	else:
		c = chr( c )
	output.append( c )

print( "".join( output ) )

Solution (Python):
import sys

line = sys.stdin.readline()
output = []
for i in range( len( line )-1 ):
	c = ord( line[i] )
	if ord( 'a' ) <= c and c <= ord( 'z' ):
		c = chr( c ).upper()
	elif ord( 'A' ) <= c and c <= ord( 'Z' ):
		c = chr( c ).lower()
	else:
		c = chr( c )
	output.append( c )

print( "".join( output ) )

Solution (Python):
print(input().swapcase())

Solution (Python):


line = raw_input()
print ''.join([((s.lower() if s.isupper() else s.upper()) if s.isalpha() else s) for s in line])

Solution (Python):
print(input().swapcase())

Solution (Python):
s = raw_input()

s = s.swapcase()

print s

Solution (Python):
input = raw_input()

for i in xrange(len(input)):
  
  if input[i].islower():
    input = input[:i] + input[i].upper() + input[i + 1:]
  elif input[i].isupper():
    input = input[:i] + input[i].lower() + input[i + 1:]

print input

Solution (Python):
import string
print raw_input().translate(string.maketrans("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'))

Solution (Python):
print raw_input().swapcase()

Solution (Python):
print raw_input().swapcase()

Solution (Python):
import sys
print(sys.stdin.readline().strip().swapcase())

Solution (Python):
S = raw_input()
tmp = ''
for s in S:
    if s.isupper():
        tmp += s.lower()
    elif s.islower():
        tmp += s.upper()
    else:
        tmp += s
print tmp

Solution (Python):



text = list(raw_input())
for i in range(len(text)) :
	if ord(text[i])<=90 and ord(text[i])>=65:
		text[i] = chr(ord(text[i])+32)
	elif ord(text[i])<=122 and ord(text[i])>=97:
		text[i] = chr(ord(text[i])-32)
print(''.join(text))

Solution (Python):
print(input().swapcase())

Solution (Python):
in_line = raw_input()
buf = ""
for i in xrange(len(in_line)):
    if in_line[i].isupper():
        buf += in_line[i].lower()
    elif in_line[i].islower():
        buf += in_line[i].upper()
    else:
        buf += in_line[i]
print buf

Solution (Python):
print(input().swapcase())

Solution (Python):
string = raw_input()
ans = ""
for i in string:
    ans += i.swapcase()
print ans

Solution (Python):
s = raw_input()
ans = ""
for x in xrange(len(s)):
    if s[x].islower():
        ans += s[x].upper()
    else:
        ans += s[x].lower()
print ans

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):


import sys

strings = input()

for s in strings:
    if s.islower():
        sys.stdout.write(s.upper())
    else:
        sys.stdout.write(s.lower())
print()

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
text = raw_input()
ans = ""
for s in text:
    if s.isalpha():
        ans += s.upper() if s.islower() else s.lower()
    else:
        ans += s
print ans

Solution (Python):
import sys

printf = sys.stdout.write

word = map(str, raw_input().split(', '))

count = []
new_word = []
for i in range(len(word)):
    for j in range(len(word[i])):
        if word[i][j].islower():
            new_word.append(chr(ord(word[i][j]) - 32))
        elif word[i][j].isupper(): 
            new_word.append(chr(ord(word[i][j]) + 32))
        else:
            new_word.append(word[i][j])
    new_word.append(", ")


for i in range(len(new_word) - 1):
    printf(new_word[i])
    
print ""

Solution (Python):
print(input().swapcase())

Solution (Python):
import sys
A=input().split()
for i in A:
	sys.stdout.write(i.swapcase())
	if i!=A[-1]:
		sys.stdout.write(" ")
print()

Solution (Python):
print raw_input().swapcase()

Solution (Python):
string_list = map(str, raw_input().split(","))

result = [i.swapcase() for i in string_list]
print ",".join(result)

Solution (Python):


buf = str(raw_input())
char_list = list(buf)
res = ""

for i in char_list:
    if i.isupper():
        res += i.lower()
    elif i.islower():
        res += i.upper()
    else:
        res += i

print res

Solution (Python):
letters = input()
for letter in letters:
    if letter.islower():
        print(letter.upper(), end='')
    elif letter.isupper():
        print(letter.lower(), end='')
    else:
        print(letter, end ='')
print('')

Solution (Python):
import string
a = raw_input()
b = ""
for i in range(len(a)):
    if a[i] in string.ascii_lowercase :
        b = b + a[i].upper()
    elif a[i] in string.ascii_uppercase :
        b = b + a[i].lower()
    else :
        b = b + a[i]

print b

Solution (Python):
print raw_input().swapcase()

Solution (Python):
print(input().swapcase())

Solution (Python):
input_line = raw_input()
print input_line.swapcase()

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):


input_str = input()

print(input_str.swapcase())

Solution (Python):



















print( input().swapcase())

Solution (Python):

array = input().swapcase()
print(array)

Solution (Python):
print(''.join([c.lower() if c.isupper() else c.upper() if c.islower() else c for c in list(input())]))

Solution (Python):
array = input().swapcase()
print(array)

Solution (Python):
inputText = input()

print(inputText.swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print raw_input().swapcase()

Solution (Python):
import sys
import math

S = raw_input()

for x in S:
    if "a" <= x <= "z":
        sys.stdout.write(x.upper())
    elif "A" <= x <= "Z":
        sys.stdout.write(x.lower())
    else:
        sys.stdout.write(x)
print

Solution (Python):
string = input()
print(string.swapcase())

Solution (Python):
I=raw_input()
O=str()
list_upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in I:
	if i in list_upper:
		O+=i.lower()
	else:
		O+=i.upper()
print O

Solution (Python):
print(input().swapcase())

Solution (Python):
def changeUL(str):
    if(str.islower()):
        return str.upper()
    else:
        return str.lower()
rc=list(map(changeUL,list(input())))
print("".join(rc))

Solution (Python):
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()

Solution (Python):
print(input().swapcase())

Solution (Python):
t = input()
nt = ""
for i in range(len(t)):
    if t[i].islower() :
        nt += t[i].upper()
    elif t[i].isupper() :
        nt += t[i].lower()
    else :
        nt += t[i]

print(nt)

Solution (Python):
str = input()

for char in str:
	if char.islower():
		print(char.upper(), end='')
	else:
		print(char.lower(), end='')
print("");

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

Solution (Python):
str = input()
new = ''
for i in str:
	if i.islower():
		new +=  i.upper()
	else:
		new += i.lower()
print(new)

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
i = input()
print(i.swapcase())

Solution (Python):
inputa = input()
 
print(inputa.swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
s = input()
print(s.swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
s = input()

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

Solution (Python):
print(input().swapcase())

Solution (Python):
letters=[str(x) for x in input().split(", ")]
list1=[]
for i in letters:
    list1.append(i.swapcase())
print(", ".join(list1))

Solution (Python):
a = input()
print (a.swapcase())

Solution (Python):
s = input()
print(s.swapcase())

Solution (Python):
uppers = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lowers = 'abcdefghijklmnopqrstuvwxyz'
s = str(input())
for i in range(len(s)):
    if s[i] in uppers:
        print(s[i].lower(), end='')
    elif s[i] in lowers:
        print(s[i].upper(), end='')
    else:
        print(s[i], end='')
print('')

Solution (Python):

str = raw_input()
s = []
for c in str:
 s.append(c.lower() if c.isupper() else c.upper())
print ''.join(s)

Solution (Python):

str = raw_input()
s = ""
for c in str:
 s += (c.lower() if c.isupper() else c.upper())
print s

Solution (Python):
S = input()
Slist = list(S)
big = ord('A')
small = ord('a')
diff = big-small
for i in range(len(Slist)):
    w = ord(Slist[i])
    if small <= w:
        
        Slist[i] = chr(w+diff)
    elif big <= w:
        Slist[i] = chr(w-diff)
print(''.join(Slist))

Solution (Python):
str = input()
dst = ''
for char in str:
    if char.isupper():
        dst += char.lower()
    elif char.islower():
        dst += char.upper()
    else:
        dst += char
print(dst)

Solution (Python):
text = raw_input()

print text.swapcase()

Solution (Python):
print(input().swapcase())

Solution (Python):
print raw_input().swapcase()

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
for i in raw_input().split():
    print i.swapcase(),

Solution (Python):
line = input()
result = []
for c in line:
    num = ord(c)
    if num >= ord("A") and num <= ord("Z"):
        c1 = chr(ord("a") + num - ord("A"))
        result.append(c1)
    elif num >= ord("a") and num <= ord("z"):
        c1 = chr(ord("A") + num - ord("a"))
        result.append(c1)
    else:
        result.append(c)
print("".join(result))

Solution (Python):
def toggle(c):
    L = c.lower()
    if c == L:
        return c.upper()
    else:
        return L
print(''.join(map(toggle, input())))

Solution (Python):
print(''.join([c.upper() if c.islower() else c.lower() for c in input()]))

Solution (Python):
i = input()
print(i.swapcase())

Solution (Python):
line = list(input())
for k,v in enumerate(line):
    line[k] = v.swapcase()
print(''.join(line))

Solution (Python):
before = input()
after = ''
for letter in before:
    if letter.isupper():
        after += letter.lower()
    elif letter.islower():
        after += letter.upper()
    else:
        after += letter
print(after)

Solution (Python):
print(raw_input().swapcase())

Solution (Python):
for c in input():
    if c.isupper():
        print(c.lower(), end='')
    elif c.islower():
        print(c.upper(), end='')
    else:
        print(c, end='')
print()

Solution (Python):
s = input()
print(s.swapcase())

Solution (Python):
print("".join([_.upper() if _.islower() else _.lower() for _ in input()]))

Solution (Python):

"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_A

??§????????¨?°????????????\?????????

????????????????????????????°?????????¨??§???????????\????????????????????°????????????????????????????????????
"""

if __name__ == '__main__':
    
    raw_input = input()

    
    print(raw_input.swapcase())

Solution (Python):
n=input()
m=''
for i in range(len(n)):
    c=str(n[i])
    if(n[i].islower()):
        c=n[i].upper()
    elif(n[i].isupper()):
        c=n[i].lower()
    m+=c
print(m)

Solution (Python):
value = input()
convert_value = []
for x in value:
    if x.isupper():
        convert_value.append(x.lower())
    elif x.islower():
        convert_value.append(x.upper())
    else:
        convert_value.append(x)
print(''.join(x for x in convert_value))

Solution (Python):
from itertools import starmap
print("".join(starmap(lambda c: c.lower() if 'A' <= c <= 'Z' else c.upper(), input())))

Solution (Python):
s=list(input())
for i in range(len(s)):
	if s[i].isalnum():
		if s[i].islower():
			s[i]=s[i].upper()
		elif s[i].isupper():
			s[i]=s[i].lower()
print("".join(s))

Solution (Python):
a=raw_input().split(',')
b=[]
c=[]
for i in range(len(a)):
    for j in range(len(a[i])):
        if a[i][j].isalpha():
            if a[i][j].islower():
                b.append(a[i][j].upper())
            else:
                b.append(a[i][j].lower())
        else:
            b.append(a[i][j])
    c.append(''.join(b))
    b=[]
print(','.join(c))

Solution (Python):


print("".join(i.upper() if i.islower() else i.lower() for i in input()))

Solution (Python):
def transform(c):
    if type(c) is str:
        if c.isupper():
            return c.lower()
        else:
            return c.upper()
    else:
        return c
    
print("".join(map(lambda c: transform(c), input())))

Solution (Python):
c_dif = ord('A')-ord('a')
s = input()
for c in s:
    if ord('a')<= ord(c) and ord(c) <= ord('z'): 
        print(chr(ord(c)+c_dif) ,end='')
    elif ord('A')<= ord(c) and ord(c) <= ord('Z'): 
        print(chr(ord(c)-c_dif) ,end='')
    else:
        print(c, end='')
print()

Solution (Python):
s = list(input())
for i in range(len(s)):
    if s[i].islower():
        s[i] = s[i].upper()
    else:
        s[i] = s[i].lower()
print(''.join(s))

Solution (Python):


s=input()
ans = ""
for x in s:
	if x.isupper():
		ans+=x.lower()
	else:
		ans+=x.upper()

print(ans)

Solution (Python):
print(input().swapcase())

Solution (Python):
S = raw_input()
T = ""
for x in S:
    if x.islower():
        T += x.upper()
    elif x.isupper():
        T += x.lower()
    else:
        T += x
print T

Solution (Python):
import string

s = input()

print(s.translate(str.maketrans(string.ascii_uppercase+string.ascii_lowercase, string.ascii_lowercase+string.ascii_uppercase)))

Solution (Python):
import string

s = input()

print(s.translate(str.maketrans(string.ascii_uppercase + string.ascii_lowercase,
                                string.ascii_lowercase + string.ascii_uppercase)))

Solution (Python):
import string

print(input().translate(str.maketrans(
    string.ascii_uppercase + string.ascii_lowercase,
    string.ascii_lowercase + string.ascii_uppercase)))

Solution (Python):
string = str(input())
for c in string:
    if c.isupper():
        print(c.lower(),end='')
    elif c.islower():
        print(c.upper(),end ='')
    else:
        print(c,end ='')
print('')

Solution (Python):
print(input().swapcase())

Solution (Python):
'''
ITP-1_8-A
 ??§????????¨?°????????????\?????????
????????????????????????????°?????????¨??§???????????\????????????????????°????????????????????????????????????
???Input
????????????1???????????????????????????
???Output
????????????????????????????°?????????¨??§???????????\????????????????????????????????????????????????
??¢????????????????????\???????????????????????????????????????????????????
'''

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('')

Solution (Python):
words = input()
_words = ""
for case in words:
  if case != case.upper():
    case = case.upper()
  elif case != case.lower():
    case = case.lower()
  _words += case
print (_words)

Solution (Python):
data = input()
print(data.swapcase())

Solution (Python):
import sys


fin = sys.stdin

str = fin.readline()

print(str.swapcase(), end="")

Solution (Python):



def main():
    print(input().swapcase())


if __name__ == '__main__':
    main()

Solution (Python):
print(input().swapcase())

Solution (Python):
S = input()

print(S.swapcase())

Solution (Python):
s = input()
print(s.swapcase())

Solution (Python):
S = raw_input()
O = ''
for s in S:
    if s.isupper():
        O += s.lower()
    elif s.islower():
        O += s.upper()
    else:
        O += s
print O

Solution (Python):
s = input()
for i in s:
    if i.islower():
        print(i.upper(),end="")
    else:
        print(i.lower(),end="")
print()

Solution (Python):
in_str = input().rstrip()
print(in_str.swapcase())

Solution (Python):
line = input()
result = line.swapcase()
print(result)

Solution (Python):
inp = input()
print(inp.swapcase())

Solution (Python):
sample = input()
res =[]

for s in sample:
    if s.lower() == s:
        res.append(s.upper())
    elif s.upper() == s:
        res.append(s.lower())

print("".join(res))

Solution (Python):
print(input().swapcase())

Solution (Python):
str1 = input()
print(str1.swapcase())

Solution (Python):
word = input()
print(word.swapcase())

Solution (Python):
import re
stt = ""
line = input()
for i in range(len(line)):
    if re.compile("[A-Z]").search(line[i]):
        stt += line[i].lower()
    elif re.compile("[a-z]").search(line[i]):
        stt += line[i].upper()
    else:
        stt += line[i]
print(stt)

Solution (Python):
print(input().swapcase())

Solution (Python):
s = list(raw_input())
for i in range(len(s)):
	if s[i].islower():
		s[i]=s[i].upper()
	else:
		s[i]=s[i].lower()	
print ''.join(s)

Solution (Python):
strings=input()

for i in strings:
    if "a" <= i <= "z":
        print(i.upper(), end="")
    elif "A" <= i <= "Z":
        print(i.lower(), end="")
    else:
        print(i, end="")
print("")

Solution (Python):
s = input()
print(s.swapcase())

Solution (Python):


import sys
import os


s = input().strip()
for c in s:
    if c.islower():
        print(c.upper(), end='')
    elif c.isupper():
        print(c.lower(), end='')
    else:
        print(c, end='')
print()

Solution (Python):
string = input()
for n in range(len(string)):
    if string[n] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
        print(string[n].lower(), end="")
    elif string[n] in "abcdefghijkelmnopqrstuvwxyz":
        print(string[n].upper(), end="")
    else:
        print(string[n], end="")
print()

Solution (Python):
string = input()

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

Solution (Python):
s = input()
print(s.swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):


 
def func():
    try:
        line=input().rstrip()
    except EOFError:
        return 0
    except:
        return inputError()

    print(line.swapcase())
        
def inputError():
    print("input Error")
    return -1
 
func()

Solution (Python):
text = input()
newText = ""

for x in text:
    if x.isupper():
        newText = newText + x.lower()
    elif x.islower():
        newText = newText + x.upper()
    else:
        newText = newText + x
    
print(newText)

Solution (Python):
print(input().swapcase())

Solution (Python):
str = raw_input()
li = []

for c in list(str):
    if c.isupper():
        li.append(c.lower())
    elif c.islower():
        li.append(c.upper())
    else:
        li.append(c)
print ''.join(li)

Solution (Python):

str = input()
for i in range(len(str)):
    if "a" <= str[i] <= "z":
        print(str[i].upper(), end='')
    else:
        print(str[i].lower(), end='')
print()

Solution (Python):
def convert(s):
    o = ord(s)
    if o >= 65 and o <= 90:
        return s.lower()
    elif o >= 97 and o <= 122:
        return s.upper()
    return s


def main():
    strings = input()
    answer = ""
    for s in strings:
        s = s
        answer += convert(s)
    print(answer)

if __name__ == "__main__":
    main()

Solution (Python):
line = input()

for ch in line:
    n = ord(ch)

    if   ord('a') <= n <= ord('z'):
        n -= 32
    elif ord('A') <= n <= ord('Z'):
        n += 32

    print(chr(n), end='')

print()

Solution (Python):
S = input()
for i in S:
 if i.islower():
  print(i.upper(), end="")
 elif i.isupper():
  print(i.lower(), end="")
 else:
  print(i, end="")
print("")

Solution (Python):
s = input()
for c in s:
    if (c.islower()):
        print(c.upper(), end='')
    else:
        print(c.lower(), end='')
print()

Solution (Python):
S = input()
for i in S:
    print(i.swapcase(), end='')
print()

Solution (Python):


moji = list(input().rstrip())
moji2 =[]
for i in moji:
    if i.isalpha() == False:
        moji2.append(i)

    elif i.islower() == True:
        moji2.append(i.upper())
    else:
        moji2.append(i.lower())

print("".join(moji2))

Solution (Python):
print(''.join(c.lower() if c.isupper() else c.upper() if c.islower() else c for c in input()))

Solution (Python):
s = input()
u = s.upper()
l = s.lower()
a = []
for i in range(len(s)):
    if s[i] == u[i]:
        a.append(l[i])
    else:
        a.append(u[i])
print("".join(a))

Solution (Python):
line = raw_input()
output = ""
for i in line:
    if i.isupper():
        output += i.lower()
    elif i.islower():
        output += i.upper()
    else:
        output += i
print output

Solution (Python):
print(input().swapcase())

Solution (Python):
S = input()
for s in S:
    print(s.swapcase(), end = "")
print()

Solution (Python):
S=input()
print(S.swapcase())

Solution (Python):
def swap(c):
    if c.isupper():
        return c.lower()
    else:
        return c.upper()

print(''.join(map(swap, input())))

Solution (Python):
x=[(i) for i in input().split()]
for i in range(len(x)-1):
    print(x[i].swapcase(),"",end="")
print(x[len(x)-1].swapcase())

Solution (Python):


"""
??§???????°?????????????
"""
tra = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
trb = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
inp = input().strip()
print(inp.translate(str.maketrans(tra,trb)))

Solution (Python):
from string import ascii_lowercase as LOW
from string import ascii_uppercase as UP

a = {l:u for l,u in zip(list(LOW),list(UP))}
b = {u:l for u,l in zip(list(UP),list(LOW))}
a.update(b)

data = input()
data = [a[s] if s in a else s for s in data]
data = ''.join(data)
print(data)

Solution (Python):
def main():
    S = input()
    print(S.swapcase())

main()

Solution (Python):
t = input()
print (str.swapcase(t))

Solution (Python):
s=input()
print(s.swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
c=str(input())
cl=list(c)
for i in range(len(cl)):
    if cl[i].islower():
        cl[i]=cl[i].upper()
        print(cl[i],end='')
    elif cl[i].isupper():
        cl[i] =cl[i].lower()
        print(cl[i], end='')
    elif not cl[i].isalpha():
        print(cl[i], end='')
print('')

Solution (Python):
print(input().swapcase())

Solution (Python):
print(input().swapcase())

Solution (Python):
string = input()
out_string = []
for i in range(len(string)):
    if string[i].isupper():
        out_string.append(string[i].lower())
    else:
        out_string.append(string[i].upper())

print("".join(out_string))

Solution (Python):
print(input().swapcase())

Solution (Python):
x=input()
ret = ''
for a in x:
    if a.islower() : a = a.upper()
    elif a.isupper(): a = a.lower()
    ret += a
print(ret)

Solution (Python):
s = input()
for c in s:
    if c.isupper():
        print(c.lower(), end = "")
    elif c.islower():
        print(c.upper(), end = "")
    else:
        print(c, end = "")
print()