input = STDIN.gets

input.chars{|c|
        if c.match(/[a-z]/) != nil then
                print c.upcase
        elsif c.match(/[A-Z]/) != nil then
                print c.downcase
        else
                print c
        end
}
print "\n"