import sequtils,strutils
var
    s = stdin.readline
for i,c in s:
    if c.isLowerAscii:
        s[i] = s[i].toUpperAscii
    else:
        s[i] = s[i].toLowerAscii

echo s