# -*- coding: utf-8 -*-

str = input()

s = []

for c in str:

 s.append(c.lower() if c.isupper() else c.upper())

print(''.join(s))
# -*- coding: utf-8 -*-

str = input()

s = ""

for c in str:

 s += (c.lower() if c.isupper() else c.upper())

print(s)
# -*- coding: utf-8 -*-
str = input()
s = []
for c in str:
    s.append(c.lower() if c.isupper() else c.upper())
print("".join(s))

# -*- coding: utf-8 -*-
str = input()
s = ""
for c in str:
    s += c.lower() if c.isupper() else c.upper()
print(s)

-s = [] +s = "" -    s.append(c.lower() if c.isupper() else c.upper()) -print("".join(s)) +    s += c.lower() if c.isupper() else c.upper() +print(s)