str = gets.chomp
str_len = str.length
str = str.split("")

for i in 0 ..str_len - 1
	if (str[i].ord > 64) && (str[i].ord < 91)
		str[i] = str[i].downcase
	elsif (str[i].ord > 96) && (str[i].ord < 123)
		str[i] = str[i].upcase
	end
end

puts str.join