def toggle_case(char)
  ord = char.ord
  return char if ord < 65 || (90 < ord) && (ord < 97) || 122 < ord
  return (ord - 32).chr if 97 <= ord
  (ord + 32).chr
end

line = gets.chomp.split("")
puts line.map{|c| toggle_case(c)}.join("")