input_strings = gets.chomp.chars
length = input_strings.length
for i in 0..(length-1)
  if input_strings[i] != input_strings[i].upcase
    input_strings[i].upcase!
  else input_strings[i] != input_strings[i].downcase
    input_strings[i].downcase!
  end
end
p input_strings.join